Merge branch 'maint-rel-1.6' into develop

This commit is contained in:
j2blake 2013-11-20 17:07:38 -05:00
commit a35afb3151
9 changed files with 70 additions and 40 deletions

View file

@ -444,7 +444,7 @@ please_create = Por favor, cree
a_classgroup = un grupo de clase
associate_classes_with_group = y las clases asociadas con el grupo creado.
refresh_content = Actualizar contenido
site_maintenance = Mantenimiento del sitio
rebuild_search_index = Reconstruir índice de búsqueda
rebuild_vis_cache = Reconstruir caché de visualización
recompute_inferences_mixed_caps = Inferencias Recompute

View file

@ -53,14 +53,14 @@ public class BaseSiteAdminController extends FreemarkerHttpServlet {
body.put("dataInput", getDataInputData(vreq));
body.put("siteConfig", getSiteConfigData(vreq));
body.put("indexCacheRebuild", getIndexCacheRebuildUrls(vreq));
body.put("siteMaintenance", getSiteMaintenanceUrls(vreq));
body.put("ontologyEditor", getOntologyEditorData(vreq));
body.put("dataTools", getDataToolsUrls(vreq));
return new TemplateResponseValues(TEMPLATE_DEFAULT, body);
}
protected Map<String, String> getIndexCacheRebuildUrls(VitroRequest vreq) {
protected Map<String, String> getSiteMaintenanceUrls(VitroRequest vreq) {
Map<String, String> urls = new HashMap<String, String>();
@ -73,6 +73,10 @@ public class BaseSiteAdminController extends FreemarkerHttpServlet {
urls.put("rebuildSearchIndex", UrlBuilder.getUrl("/SearchIndex"));
}
if (PolicyHelper.isAuthorizedForActions(vreq, SimplePermission.LOGIN_DURING_MAINTENANCE.ACTIONS)) {
urls.put("restrictLogins", UrlBuilder.getUrl("/admin/restrictLogins"));
}
if (PolicyHelper.isAuthorizedForActions(vreq, SimplePermission.ENABLE_DEVELOPER_PANEL.ACTIONS)) {
urls.put("activateDeveloperPanel", "javascript:new DeveloperPanel(developerAjaxUrl).setupDeveloperPanel({developerEnabled: true});");
}
@ -147,10 +151,6 @@ public class BaseSiteAdminController extends FreemarkerHttpServlet {
data.put("startupStatusAlert", !StartupStatus.getBean(getServletContext()).allClear());
}
if (PolicyHelper.isAuthorizedForActions(vreq, SimplePermission.LOGIN_DURING_MAINTENANCE.ACTIONS)) {
data.put("restrictLogins", UrlBuilder.getUrl("/admin/restrictLogins"));
}
return data;
}

View file

@ -11,11 +11,14 @@ import org.apache.commons.logging.LogFactory;
import edu.cornell.mannlib.vitro.webapp.auth.permissions.SimplePermission;
import edu.cornell.mannlib.vitro.webapp.auth.policy.PolicyHelper;
import edu.cornell.mannlib.vitro.webapp.beans.BaseResourceBean.RoleLevel;
import edu.cornell.mannlib.vitro.webapp.beans.DataProperty;
import edu.cornell.mannlib.vitro.webapp.beans.Individual;
import edu.cornell.mannlib.vitro.webapp.beans.ObjectProperty;
import edu.cornell.mannlib.vitro.webapp.beans.Property;
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
import edu.cornell.mannlib.vitro.webapp.controller.freemarker.UrlBuilder;
import edu.cornell.mannlib.vitro.webapp.controller.freemarker.UrlBuilder.Route;
import edu.cornell.mannlib.vitro.webapp.dao.ObjectPropertyDao;
import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary;
import edu.cornell.mannlib.vitro.webapp.web.templatemodels.BaseTemplateModel;
@ -94,6 +97,27 @@ public abstract class PropertyTemplateModel extends BaseTemplateModel {
String editUrl = UrlBuilder.getUrl(getPropertyEditRoute(), "uri", property.getURI());
verboseDisplay.put("propertyEditUrl", editUrl);
if(isFauxProperty(property)) {
verboseDisplay.put("fauxProperty", "true");
}
}
private boolean isFauxProperty(Property prop) {
if(!(prop instanceof ObjectProperty)) {
return false;
}
ObjectPropertyDao opDao = vreq.getWebappDaoFactory().getObjectPropertyDao();
ObjectProperty baseProp = opDao.getObjectPropertyByURI(prop.getURI());
if(baseProp == null) {
return false;
}
ObjectProperty possibleFaux = (ObjectProperty) prop;
if (possibleFaux.getDomainPublic() == null) {
return (baseProp.getDomainPublic() != null);
} else {
return !possibleFaux.getDomainPublic().equals(baseProp.getDomainPublic());
}
}
protected abstract int getPropertyDisplayTier(Property p);

View file

@ -456,7 +456,7 @@ please_create = Please create
a_classgroup = a class group
associate_classes_with_group = and associate classes with the group created.
refresh_content = Refresh Content
site_maintenance = Site Maintenance
rebuild_search_index = Rebuild search index
rebuild_vis_cache = Rebuild visualization cache
recompute_inferences_mixed_caps = Recompute inferences

View file

@ -1,27 +0,0 @@
<#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
<#-- Template for the main Site Administration page -->
<#if indexCacheRebuild?has_content>
<section class="pageBodyGroup indexCacheRebuild" role="region">
<h3>${i18n().refresh_content}</h3>
<ul role="navigation">
<#if indexCacheRebuild.rebuildSearchIndex?has_content>
<li role="listitem"><a href="${indexCacheRebuild.rebuildSearchIndex }" title="${i18n().rebuild_search_index}">${i18n().rebuild_search_index}</a></li>
</#if>
<#if indexCacheRebuild.rebuildVisCache?has_content>
<li role="listitem"><a href="${indexCacheRebuild.rebuildVisCache}" title="${i18n().rebuild_vis_cache}">${i18n().rebuild_vis_cache}</a></li>
</#if>
<#if indexCacheRebuild.recomputeInferences?has_content>
<li role="listitem"><a href="${indexCacheRebuild.recomputeInferences}" title="${i18n().recompute_inferences}">${i18n().recompute_inferences_mixed_caps}</a></li>
</#if>
<#if indexCacheRebuild.activateDeveloperPanel?has_content>
<li role="listitem"><a href="${indexCacheRebuild.activateDeveloperPanel}" title="${i18n().activate_developer_panel}">${i18n().activate_developer_panel_mixed_caps}</a></li>
</#if>
</ul>
</section>
</#if>

View file

@ -13,5 +13,5 @@ ${stylesheets.add('<link rel="stylesheet" href="${urls.base}/css/admin.css" />')
<#include "siteAdmin-siteConfiguration.ftl">
<#include "siteAdmin-ontologyEditor.ftl">
<#include "siteAdmin-advancedDataTools.ftl">
<#include "siteAdmin-indexCacheRebuild.ftl">
<#include "siteAdmin-siteMaintenance.ftl">
</div>

View file

@ -23,10 +23,6 @@
<li role="listitem"><a href="${siteConfig.menuManagement}" title="${i18n().menu_ordering}">${i18n().menu_ordering_mixed_caps}</a></li>
</#if>
<#if siteConfig.restrictLogins?has_content>
<li role="listitem"><a href="${siteConfig.restrictLogins}" title="${i18n().restrict_logins}">${i18n().restrict_logins_mixed_caps}</a></li>
</#if>
<#if siteConfig.siteInfo?has_content>
<li role="listitem"><a href="${siteConfig.siteInfo}" title="${i18n().site_information}">${i18n().site_information}</a></li>
</#if>

View file

@ -0,0 +1,31 @@
<#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
<#-- Template for the main Site Administration page -->
<#if siteMaintenance?has_content>
<section class="pageBodyGroup" role="region">
<h3>${i18n().site_maintenance}</h3>
<ul role="navigation">
<#if siteMaintenance.rebuildSearchIndex?has_content>
<li role="listitem"><a href="${siteMaintenance.rebuildSearchIndex }" title="${i18n().rebuild_search_index}">${i18n().rebuild_search_index}</a></li>
</#if>
<#if siteMaintenance.rebuildVisCache?has_content>
<li role="listitem"><a href="${siteMaintenance.rebuildVisCache}" title="${i18n().rebuild_vis_cache}">${i18n().rebuild_vis_cache}</a></li>
</#if>
<#if siteMaintenance.recomputeInferences?has_content>
<li role="listitem"><a href="${siteMaintenance.recomputeInferences}" title="${i18n().recompute_inferences}">${i18n().recompute_inferences_mixed_caps}</a></li>
</#if>
<#if siteMaintenance.restrictLogins?has_content>
<li role="listitem"><a href="${siteMaintenance.restrictLogins}" title="${i18n().restrict_logins}">${i18n().restrict_logins_mixed_caps}</a></li>
</#if>
<#if siteMaintenance.activateDeveloperPanel?has_content>
<li role="listitem"><a href="${siteMaintenance.activateDeveloperPanel}" title="${i18n().activate_developer_panel}">${i18n().activate_developer_panel_mixed_caps}</a></li>
</#if>
</ul>
</section>
</#if>

View file

@ -231,7 +231,13 @@ name will be used as the label. -->
<#local verboseDisplay = property.verboseDisplay!>
<#if verboseDisplay?has_content>
<section class="verbosePropertyListing">
<#if verboseDisplay.fauxProperty??>
(faux property of
</#if>
<a class="propertyLink" href="${verboseDisplay.propertyEditUrl}" title="${i18n().name}">${verboseDisplay.localName}</a>
<#if verboseDisplay.fauxProperty??>
)
</#if>
(<span>${property.type?lower_case}</span> property);
order in group: <span>${verboseDisplay.displayRank};</span>
display level: <span>${verboseDisplay.displayLevel};</span>