NIHVIVO-1334 removing input element for short view on vclass editor plus fixes for bugs affecting ontology editor

This commit is contained in:
bjl23 2011-01-03 20:38:14 +00:00
parent 97ecd6100f
commit c2a2c67c77
5 changed files with 13 additions and 19 deletions

View file

@ -33,7 +33,7 @@ import edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactory;
public class VclassEditController extends BaseEditController { public class VclassEditController extends BaseEditController {
private static final Log log = LogFactory.getLog(VclassEditController.class.getName()); private static final Log log = LogFactory.getLog(VclassEditController.class.getName());
private static final int NUM_COLS = 13; private static final int NUM_COLS = 12;
public void doPost (HttpServletRequest req, HttpServletResponse response) { public void doPost (HttpServletRequest req, HttpServletResponse response) {
@ -72,11 +72,10 @@ public class VclassEditController extends BaseEditController {
results.add("group"); // 6 results.add("group"); // 6
results.add("display level"); // 7 results.add("display level"); // 7
results.add("update level"); // 8 results.add("update level"); // 8
results.add("custom entry form"); // 10 results.add("custom entry form"); // 9
results.add("custom display view"); // 11 results.add("custom display view"); // 10
results.add("custom short view"); // 12 results.add("custom search view"); // 11
results.add("custom search view"); // 13 results.add("URI"); // 12
results.add("URI"); // 14
String name = vcl.getLocalNameWithPrefix(); String name = vcl.getLocalNameWithPrefix();
String shortDef = (vcl.getShortDef()==null) ? "" : vcl.getShortDef(); String shortDef = (vcl.getShortDef()==null) ? "" : vcl.getShortDef();
@ -128,9 +127,8 @@ public class VclassEditController extends BaseEditController {
results.add(ProhibitedFromUpdate); // 8 results.add(ProhibitedFromUpdate); // 8
results.add(customEntryForm); // 9 results.add(customEntryForm); // 9
results.add(customDisplayView); // 10 results.add(customDisplayView); // 10
results.add(customShortView); // 11 results.add(customSearchView); // 11
results.add(customSearchView); // 12 results.add(uri); // 12
results.add(uri); // 13
request.setAttribute("results", results); request.setAttribute("results", results);
request.setAttribute("columncount", NUM_COLS); request.setAttribute("columncount", NUM_COLS);
request.setAttribute("suppressquery", "true"); request.setAttribute("suppressquery", "true");

View file

@ -139,7 +139,7 @@ public class VclassRetryController extends BaseEditController {
try { try {
Class[] args = new Class[1]; Class[] args = new Class[1];
args[0] = String.class; args[0] = String.class;
epo.setGetMethod(vcwDao.getClass().getDeclaredMethod("getVClassByURI",args)); epo.setGetMethod(VClassDao.class.getDeclaredMethod("getVClassByURI",args));
} catch (NoSuchMethodException e) { } catch (NoSuchMethodException e) {
log.error(this.getClass().getName()+" could not find the getVClassByURI method"); log.error(this.getClass().getName()+" could not find the getVClassByURI method");
} }

View file

@ -119,7 +119,7 @@ public class JenaBaseDao extends JenaBaseDaoCon {
protected String getPropertyStringValue(OntResource res, Property dataprop) { protected String getPropertyStringValue(OntResource res, Property dataprop) {
if (dataprop != null) { if (dataprop != null) {
try { try {
ClosableIterator stateIt = getOntModel().listStatements(res,dataprop,(Literal)null); ClosableIterator stateIt = res.getModel().listStatements(res,dataprop,(Literal)null);
try { try {
if (stateIt.hasNext()) if (stateIt.hasNext())
return ((Literal)((Statement)stateIt.next()).getObject()).getString(); return ((Literal)((Statement)stateIt.next()).getObject()).getString();
@ -142,6 +142,7 @@ public class JenaBaseDao extends JenaBaseDaoCon {
protected void addPropertyStringValue(Resource res, Property dataprop, String value, Model model) { protected void addPropertyStringValue(Resource res, Property dataprop, String value, Model model) {
if (res != null && dataprop != null && value != null && value.length()>0) { if (res != null && dataprop != null && value != null && value.length()>0) {
model.add(res, dataprop, value, XSDDatatype.XSDstring); model.add(res, dataprop, value, XSDDatatype.XSDstring);
System.out.println("JenaBaseDao" + value);
} }
} }

View file

@ -252,7 +252,7 @@ public class VClassJena extends VClass {
} else { } else {
cls.getOntModel().enterCriticalSection(Lock.READ); cls.getOntModel().enterCriticalSection(Lock.READ);
try { try {
setCustomEntryForm(webappDaoFactory.getJenaBaseDao().getPropertyStringValue(cls, webappDaoFactory.getJenaBaseDao().PROPERTY_CUSTOMDISPLAYVIEWANNOT)); setCustomDisplayView(webappDaoFactory.getJenaBaseDao().getPropertyStringValue(cls, webappDaoFactory.getJenaBaseDao().PROPERTY_CUSTOMDISPLAYVIEWANNOT));
return this.customDisplayView; return this.customDisplayView;
} finally { } finally {
cls.getOntModel().leaveCriticalSection(); cls.getOntModel().leaveCriticalSection();

View file

@ -102,14 +102,9 @@
<input name="CustomDisplayView" style="width:90%" value="${formValue['CustomDisplayView']}"/> <input name="CustomDisplayView" style="width:90%" value="${formValue['CustomDisplayView']}"/>
<font size="2" color="red"><form:error name="CustomDisplayView"/></font> <font size="2" color="red"><form:error name="CustomDisplayView"/></font>
</td> </td>
<td valign="bottom" colspan="1"> <td valign="bottom" colspan="2">
<em>Optional: <strong>custom short view</strong></em><br />
<input name="CustomShortView" style="width:90%" value="${formValue['CustomShortView']}"/>
<font size="2" color="red"><form:error name="CustomShortView"/></font>
</td>
<td valign="bottom" colspan="1">
<em>Optional: <strong>custom search view</strong></em><br /> <em>Optional: <strong>custom search view</strong></em><br />
<input name="CustomSearchView" style="width:90%" value="${formValue['CustomSearchView']}"/> <input name="CustomSearchView" style="width:45%" value="${formValue['CustomSearchView']}"/>
<font size="2" color="red"><form:error name="CustomSearchView"/></font> <font size="2" color="red"><form:error name="CustomSearchView"/></font>
</td> </td>
</tr> </tr>