VIVO-999: when showing the list of classes that have a restriction on a property, hide the display option select and add class button. When no classes, diplay a message to tht effect.

This commit is contained in:
Tim Worrall 2015-03-17 16:47:53 -04:00
parent f078bc4931
commit 4e09f96548
6 changed files with 51 additions and 29 deletions

View file

@ -885,3 +885,5 @@ faux_property_capitalized = Faux propiedad
faux_property_listing = Lista de faux propiedades faux_property_listing = Lista de faux propiedades
faux_property_by_base = Faux propiedades por base propriedad faux_property_by_base = Faux propiedades por base propriedad
faux_property_alpha = Faux propiedades en orden alfabético faux_property_alpha = Faux propiedades en orden alfabético
no_class_restrictions=No hay clases con una restricción de esta propiedad.

View file

@ -46,10 +46,18 @@ public class ListVClassWebappsController extends FreemarkerHttpServlet {
body.put("displayOption", "all"); body.put("displayOption", "all");
body.put("pageTitle", "All Classes"); body.put("pageTitle", "All Classes");
body.put("propertyURI", vreq.getParameter("propertyURI"));
if ( vreq.getParameter("propertyType").equals("object") ) {
body.put("editController", "propertyEdit?uri=");
}
else {
body.put("editController", "datapropEdit?uri=");
}
List<VClass> classes = null; List<VClass> classes = null;
if (vreq.getParameter("showPropertyRestrictions") != null) { if (vreq.getParameter("showPropertyRestrictions") != null) {
body.put("propertyName", vreq.getParameter("propertyName"));
PropertyDao pdao = vreq.getLanguageNeutralWebappDaoFactory().getObjectPropertyDao(); PropertyDao pdao = vreq.getLanguageNeutralWebappDaoFactory().getObjectPropertyDao();
classes = pdao.getClassesWithRestrictionOnProperty(vreq.getParameter("propertyURI")); classes = pdao.getClassesWithRestrictionOnProperty(vreq.getParameter("propertyURI"));
} else { } else {

View file

@ -898,3 +898,5 @@ faux_property_capitalized = Faux Property
faux_property_listing = Faux Property Listing faux_property_listing = Faux Property Listing
faux_property_by_base = faux properties by base property faux_property_by_base = faux properties by base property
faux_property_alpha = faux properties alphabetically faux_property_alpha = faux properties alphabetically
no_class_restrictions=There are no classes with a restriction on this property.

View file

@ -32,6 +32,8 @@
<form action="listVClassWebapps" method="get"> <form action="listVClassWebapps" method="get">
<input type="hidden" name="showPropertyRestrictions" value="true"/> <input type="hidden" name="showPropertyRestrictions" value="true"/>
<input type="hidden" name="propertyURI" value="${datatypeProperty.URI}"/> <input type="hidden" name="propertyURI" value="${datatypeProperty.URI}"/>
<input type="hidden" name="propertyName" value="${datatypeProperty.publicName}"/>
<input type="hidden" name="propertyType" value="data"/>
<input type="submit" class="form-button" value="Show Classes With a Restriction on This Property"/> <input type="submit" class="form-button" value="Show Classes With a Restriction on This Property"/>
</form> </form>
<form action="listDataPropertyStatements" method="get"> <form action="listDataPropertyStatements" method="get">

View file

@ -41,6 +41,8 @@
<form action="listVClassWebapps" method="get"> <form action="listVClassWebapps" method="get">
<input type="hidden" name="showPropertyRestrictions" value="true"/> <input type="hidden" name="showPropertyRestrictions" value="true"/>
<input type="hidden" name="propertyURI" value="${property.URI}"/> <input type="hidden" name="propertyURI" value="${property.URI}"/>
<input type="hidden" name="propertyName" value="${property.domainPublic}"/>
<input type="hidden" name="propertyType" value="object"/>
<input type="submit" class="form-button" value="Show Classes With a Restriction on This Property"/> <input type="submit" class="form-button" value="Show Classes With a Restriction on This Property"/>
</form> </form>
<form action="listObjectPropertyStatements" method="get"> <form action="listObjectPropertyStatements" method="get">

View file

@ -1,7 +1,10 @@
<#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> <#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
<section role="region"> <section role="region">
<#if propertyName?? >
<h2>Classes with a restriction on <em><a href="${editController}${propertyURI?url}">${propertyName!}</a></em></h2>
<br/>
<#else>
<h2>${pageTitle!}</h2> <h2>${pageTitle!}</h2>
<#if !displayOption?has_content> <#if !displayOption?has_content>
@ -26,10 +29,13 @@
<#else> <#else>
<div id="expandLink"><span id="expandAll" ><a href="#" title="${i18n().expand_all}">${i18n().expand_all}</a></span></div> <div id="expandLink"><span id="expandAll" ><a href="#" title="${i18n().expand_all}">${i18n().expand_all}</a></span></div>
</#if> </#if>
</#if>
<section id="container"> <section id="container">
<#if propertyName?? && !jsonTree?? >
${i18n().no_class_restrictions}
</#if>
</section> </section>
</section> </se ction>
<script language="javascript" type="text/javascript" > <script language="javascript" type="text/javascript" >
var json = [${jsonTree!}]; var json = [${jsonTree!}];
var i18nStrings = { var i18nStrings = {