web.xml updates and bugfix for VIVO-less vitro

This commit is contained in:
brianjlowe 2011-05-10 21:28:26 +00:00
parent fbead2b020
commit c4f4785674
2 changed files with 41 additions and 76 deletions

View file

@ -235,6 +235,15 @@
<url-pattern>/*</url-pattern> <url-pattern>/*</url-pattern>
</filter-mapping> </filter-mapping>
<filter>
<filter-name>WebappDaoFactorySDBPrep</filter-name>
<filter-class>edu.cornell.mannlib.vitro.webapp.filters.WebappDaoFactorySDBPrep</filter-class>
</filter>
<filter-mapping>
<filter-name>WebappDaoFactorySDBPrep</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter> <filter>
<filter-name>VitroRequestPrep</filter-name> <filter-name>VitroRequestPrep</filter-name>
<filter-class>edu.cornell.mannlib.vitro.webapp.filters.VitroRequestPrep</filter-class> <filter-class>edu.cornell.mannlib.vitro.webapp.filters.VitroRequestPrep</filter-class>
@ -246,6 +255,16 @@
<dispatcher>forward</dispatcher> <dispatcher>forward</dispatcher>
</filter-mapping> </filter-mapping>
<filter>
<filter-name>PageRoutingFilter</filter-name>
<filter-class>edu.cornell.mannlib.vitro.webapp.filters.PageRoutingFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>PageRoutingFilter</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>request</dispatcher>
</filter-mapping>
<!-- Spring setup **************************************************** --> <!-- Spring setup **************************************************** -->
<!-- <!--
<context-param> <context-param>
@ -604,33 +623,6 @@
<url-pattern>/individualTypeOp</url-pattern> <url-pattern>/individualTypeOp</url-pattern>
</servlet-mapping> </servlet-mapping>
<servlet>
<servlet-name>Tabs2TypesOperationController</servlet-name>
<servlet-class>edu.cornell.mannlib.vitro.webapp.controller.edit.Tabs2TypesOperationController</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Tabs2TypesOperationController</servlet-name>
<url-pattern>/tabs2TypesOp</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>TabIndividualRelationOperationController</servlet-name>
<servlet-class>edu.cornell.mannlib.vitro.webapp.controller.edit.TabIndividualRelationOperationController</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>TabIndividualRelationOperationController</servlet-name>
<url-pattern>/tabIndividualRelationOp</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>TabHierarchyOperationController</servlet-name>
<servlet-class>edu.cornell.mannlib.vitro.webapp.controller.edit.TabHierarchyOperationController</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>TabHierarchyOperationController</servlet-name>
<url-pattern>/doTabHierarchyOperation</url-pattern>
</servlet-mapping>
<servlet> <servlet>
<servlet-name>DatapropEditController</servlet-name> <servlet-name>DatapropEditController</servlet-name>
<servlet-class>edu.cornell.mannlib.vitro.webapp.controller.edit.DatapropEditController</servlet-class> <servlet-class>edu.cornell.mannlib.vitro.webapp.controller.edit.DatapropEditController</servlet-class>
@ -650,15 +642,6 @@
<url-pattern>/keywordEdit</url-pattern> <url-pattern>/keywordEdit</url-pattern>
</servlet-mapping> </servlet-mapping>
<servlet>
<servlet-name>TabEditController</servlet-name>
<servlet-class>edu.cornell.mannlib.vitro.webapp.controller.edit.TabEditController</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>TabEditController</servlet-name>
<url-pattern>/tabEdit</url-pattern>
</servlet-mapping>
<servlet> <servlet>
<servlet-name>UserEditController</servlet-name> <servlet-name>UserEditController</servlet-name>
<servlet-class>edu.cornell.mannlib.vitro.webapp.controller.edit.UserEditController</servlet-class> <servlet-class>edu.cornell.mannlib.vitro.webapp.controller.edit.UserEditController</servlet-class>
@ -713,15 +696,6 @@
<url-pattern>/datatype_retry</url-pattern> <url-pattern>/datatype_retry</url-pattern>
</servlet-mapping> </servlet-mapping>
<servlet>
<servlet-name>AllTabsForPortalListingController</servlet-name>
<servlet-class>edu.cornell.mannlib.vitro.webapp.controller.edit.listing.AllTabsForPortalListingController</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>AllTabsForPortalListingController</servlet-name>
<url-pattern>/listTabs</url-pattern>
</servlet-mapping>
<servlet> <servlet>
<servlet-name>AllClassGroupsListingController</servlet-name> <servlet-name>AllClassGroupsListingController</servlet-name>
<servlet-class>edu.cornell.mannlib.vitro.webapp.controller.edit.listing.AllClassGroupsListingController</servlet-class> <servlet-class>edu.cornell.mannlib.vitro.webapp.controller.edit.listing.AllClassGroupsListingController</servlet-class>
@ -993,27 +967,6 @@
<url-pattern>/dataservice</url-pattern> <url-pattern>/dataservice</url-pattern>
</servlet-mapping> </servlet-mapping>
<servlet>
<servlet-name>TabEntitiesController</servlet-name>
<servlet-class>edu.cornell.mannlib.vitro.webapp.controller.TabEntitiesController</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>TabEntitiesController</servlet-name>
<url-pattern>/TabEntitiesController</url-pattern>
</servlet-mapping>
<!-- NOTICE: index.jsp is mapped to TabController so that we
can have the urls that use to be in the system still work even
though we no longer use index.jsp -->
<servlet>
<servlet-name>TabController</servlet-name>
<servlet-class>edu.cornell.mannlib.vitro.webapp.controller.TabController</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>TabController</servlet-name>
<url-pattern>/index.jsp</url-pattern>
</servlet-mapping>
<servlet> <servlet>
<servlet-name>DashboardPropertyListController</servlet-name> <servlet-name>DashboardPropertyListController</servlet-name>
<servlet-class>edu.cornell.mannlib.vitro.webapp.controller.DashboardPropertyListController</servlet-class> <servlet-class>edu.cornell.mannlib.vitro.webapp.controller.DashboardPropertyListController</servlet-class>

View file

@ -96,15 +96,21 @@ public class UpdateKnowledgeBase implements ServletContextListener {
settings.setDefaultNamespace(wadf.getDefaultNamespace()); settings.setDefaultNamespace(wadf.getDefaultNamespace());
settings.setOntModelSelector(oms); settings.setOntModelSelector(oms);
OntModel oldTBoxModel = loadModelFromDirectory(ctx.getRealPath(OLD_TBOX_MODEL_DIR)); try {
settings.setOldTBoxModel(oldTBoxModel); OntModel oldTBoxModel = loadModelFromDirectory(ctx.getRealPath(OLD_TBOX_MODEL_DIR));
OntModel newTBoxModel = loadModelFromDirectory(ctx.getRealPath(NEW_TBOX_MODEL_DIR)); settings.setOldTBoxModel(oldTBoxModel);
settings.setNewTBoxModel(newTBoxModel); OntModel newTBoxModel = loadModelFromDirectory(ctx.getRealPath(NEW_TBOX_MODEL_DIR));
OntModel oldTBoxAnnotationsModel = loadModelFromDirectory(ctx.getRealPath(OLD_TBOX_ANNOTATIONS_DIR)); settings.setNewTBoxModel(newTBoxModel);
settings.setOldTBoxAnnotationsModel(oldTBoxAnnotationsModel); OntModel oldTBoxAnnotationsModel = loadModelFromDirectory(ctx.getRealPath(OLD_TBOX_ANNOTATIONS_DIR));
OntModel newTBoxAnnotationsModel = loadModelFromDirectory(ctx.getRealPath(NEW_TBOX_ANNOTATIONS_DIR)); settings.setOldTBoxAnnotationsModel(oldTBoxAnnotationsModel);
settings.setNewTBoxAnnotationsModel(newTBoxAnnotationsModel); OntModel newTBoxAnnotationsModel = loadModelFromDirectory(ctx.getRealPath(NEW_TBOX_ANNOTATIONS_DIR));
settings.setNewTBoxAnnotationsModel(newTBoxAnnotationsModel);
} catch (ModelDirectoryNotFoundException e) {
log.info("Knowledge base update directories not found. " +
"No update will be performed.");
return;
}
try { try {
KnowledgeBaseUpdater ontologyUpdater = new KnowledgeBaseUpdater(settings); KnowledgeBaseUpdater ontologyUpdater = new KnowledgeBaseUpdater(settings);
@ -211,7 +217,7 @@ public class UpdateKnowledgeBase implements ServletContextListener {
OntModel om = ModelFactory.createOntologyModel(OntModelSpec.OWL_MEM); OntModel om = ModelFactory.createOntologyModel(OntModelSpec.OWL_MEM);
File directory = new File(directoryPath); File directory = new File(directoryPath);
if (!directory.isDirectory()) { if (!directory.isDirectory()) {
throw new RuntimeException(directoryPath + " must be a directory " + throw new ModelDirectoryNotFoundException(directoryPath + " must be a directory " +
"containing RDF files."); "containing RDF files.");
} }
File[] rdfFiles = directory.listFiles(); File[] rdfFiles = directory.listFiles();
@ -251,4 +257,10 @@ public class UpdateKnowledgeBase implements ServletContextListener {
return ctx.getRealPath(ASK_EMPTY_QUERY_FILE); return ctx.getRealPath(ASK_EMPTY_QUERY_FILE);
} }
private class ModelDirectoryNotFoundException extends RuntimeException {
public ModelDirectoryNotFoundException(String msg) {
super(msg);
}
}
} }