Starting the skeleton

This commit is contained in:
Jim Blake 2014-10-27 12:42:48 -04:00
parent 59ad0c9aa2
commit 21df0f53be
9 changed files with 342 additions and 2 deletions

View file

@ -0,0 +1,12 @@
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
package edu.cornell.mannlib.vitro.webapp.controller.edit;
import edu.cornell.mannlib.vedit.controller.BaseEditController;
/**
* TODO
*/
public class FauxPropertyEditController extends BaseEditController {
}

View file

@ -0,0 +1,31 @@
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
package edu.cornell.mannlib.vitro.webapp.controller.edit;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import edu.cornell.mannlib.vedit.controller.BaseEditController;
import edu.cornell.mannlib.vitro.webapp.auth.permissions.SimplePermission;
/**
* TODO
*/
public class FauxPropertyRetryController extends BaseEditController {
@Override
public void doPost(HttpServletRequest req, HttpServletResponse response) {
if (!isAuthorizedToDisplayPage(req, response,
SimplePermission.EDIT_ONTOLOGY.ACTION)) {
return;
}
// TODO
}
@Override
public void doGet (HttpServletRequest request, HttpServletResponse response) {
doPost(request, response);
}
}

View file

@ -0,0 +1,10 @@
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
package edu.cornell.mannlib.vitro.webapp.dao;
/**
* TODO
*/
public interface FauxPropertyDao {
}

View file

@ -91,6 +91,11 @@ public interface WebappDaoFactory {
* returns a Data Access Object for working with ontology class objects * returns a Data Access Object for working with ontology class objects
*/ */
public VClassDao getVClassDao(); public VClassDao getVClassDao();
/**
* returns a Data Access Object for working with "faux" ObjectProperties.
*/
public FauxPropertyDao getFauxPropertyDao();
/* ==================== DAOs for ABox manipulation ===================== */ /* ==================== DAOs for ABox manipulation ===================== */

View file

@ -0,0 +1,218 @@
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
package edu.cornell.mannlib.vitro.webapp.dao.filtering;
import edu.cornell.mannlib.vitro.webapp.dao.FauxPropertyDao;
import edu.cornell.mannlib.vitro.webapp.dao.filtering.filters.VitroFilters;
class FauxPropertyDaoFiltering extends BaseFiltering implements FauxPropertyDao{
final FauxPropertyDao innerFauxPropertyDao;
final VitroFilters filters;
public FauxPropertyDaoFiltering(FauxPropertyDao fauxPropertyDao,
VitroFilters filters) {
super();
this.innerFauxPropertyDao = fauxPropertyDao;
this.filters = filters;
}
// /* filtered methods */
// public List getAllObjectProperties() {
// return filterAndWrap(innerFauxPropertyDao.getAllObjectProperties(), filters);
// }
//
// public List getObjectPropertiesForFauxPropertyStatements(List fauxPropertyStatements) {
// //assume that the objPropStmts are already filtered
// List<FauxProperty> list =
// innerFauxPropertyDao
// .getObjectPropertiesForFauxPropertyStatements(fauxPropertyStatements);
// return filterAndWrap(list, filters);
// }
//
//
// public FauxProperty getFauxPropertyByURI(String fauxPropertyURI) {
// FauxProperty newOprop=innerFauxPropertyDao.getFauxPropertyByURI(fauxPropertyURI);
// return (newOprop == null) ? null : new FauxPropertyFiltering(newOprop, filters);
// }
//
// public FauxProperty getFauxPropertyByURIs(String fauxPropertyURI, String domainURI, String rangeURI) {
// FauxProperty newOprop=innerFauxPropertyDao.getFauxPropertyByURIs(fauxPropertyURI, domainURI, rangeURI);
// return (newOprop == null) ? null : new FauxPropertyFiltering(newOprop, filters);
// }
//
// public FauxProperty getFauxPropertyByURIs(String fauxPropertyURI, String domainURI, String rangeURI, FauxProperty base) {
// FauxProperty newOprop=innerFauxPropertyDao.getFauxPropertyByURIs(fauxPropertyURI, domainURI, rangeURI, base);
// return (newOprop == null) ? null : new FauxPropertyFiltering(newOprop, filters);
// }
//
// public List<FauxPropertyStatement> getStatementsUsingFauxProperty(FauxProperty op) {
// return FauxPropertyStatementDaoFiltering.filterAndWrapList(innerFauxPropertyDao.getStatementsUsingFauxProperty(op),filters);
// }
//
// public List getRootObjectProperties() {
// return filterAndWrap(innerFauxPropertyDao.getRootObjectProperties(),filters);
// }
//
//
// /* other methods */
// public void deleteFauxProperty(String fauxPropertyURI) {
// innerFauxPropertyDao.deleteFauxProperty(fauxPropertyURI);
// }
//
//
// public void deleteFauxProperty(FauxProperty fauxProperty) {
// innerFauxPropertyDao.deleteFauxProperty(fauxProperty);
// }
//
//
// public void fillObjectPropertiesForIndividual(Individual individual) {
// innerFauxPropertyDao.fillObjectPropertiesForIndividual(individual);
// }
//
// public int insertFauxProperty(FauxProperty fauxProperty) throws InsertException {
// return innerFauxPropertyDao.insertFauxProperty(fauxProperty);
// }
//
// public void updateFauxProperty(FauxProperty fauxProperty) {
// innerFauxPropertyDao.updateFauxProperty(fauxProperty);
// }
//
// public void addSuperproperty(FauxProperty property, FauxProperty superproperty) {
// innerFauxPropertyDao.addSuperproperty(property, superproperty);
// }
//
// public void addSuperproperty(String propertyURI, String superpropertyURI) {
// innerFauxPropertyDao.addSuperproperty(propertyURI, superpropertyURI);
// }
//
// public void removeSuperproperty(FauxProperty property, FauxProperty superproperty) {
// innerFauxPropertyDao.removeSuperproperty(property, superproperty);
// }
//
// public void removeSuperproperty(String propertyURI, String superpropertyURI) {
// innerFauxPropertyDao.removeSuperproperty(propertyURI, superpropertyURI);
// }
//
// public void addSubproperty(FauxProperty property, FauxProperty subproperty) {
// innerFauxPropertyDao.addSubproperty(property, subproperty);
// }
//
// public void addSubproperty(String propertyURI, String subpropertyURI) {
// innerFauxPropertyDao.addSubproperty(propertyURI, subpropertyURI);
// }
//
// public void removeSubproperty(FauxProperty property, FauxProperty subproperty) {
// innerFauxPropertyDao.removeSubproperty(property, subproperty);
// }
//
// public void removeSubproperty(String propertyURI, String subpropertyURI) {
// innerFauxPropertyDao.removeSubproperty(propertyURI, subpropertyURI);
// }
//
// public List <String> getSubPropertyURIs(String propertyURI) {
// return innerFauxPropertyDao.getSubPropertyURIs(propertyURI);
// }
//
// public List <String> getAllSubPropertyURIs(String propertyURI) {
// return innerFauxPropertyDao.getAllSubPropertyURIs(propertyURI);
// }
//
// public List <String> getSuperPropertyURIs(String propertyURI, boolean direct) {
// return innerFauxPropertyDao.getSuperPropertyURIs(propertyURI, direct);
// }
//
// public List <String> getAllSuperPropertyURIs(String propertyURI) {
// return innerFauxPropertyDao.getAllSuperPropertyURIs(propertyURI);
// }
//
// public static List<FauxProperty> filterAndWrap(List<FauxProperty> list, VitroFilters filters){
// if( list == null ) return null;
// if( list.size() ==0 ) return list;
//
// List<FauxProperty> filtered = new LinkedList<FauxProperty>();
// Filter.filter(list,
// new AndUnary<FauxProperty>(notNull,filters.getFauxPropertyFilter()),
// filtered);
//
// List<FauxProperty> wrapped = new LinkedList<FauxProperty>();
// for( FauxProperty prop : filtered){
// if( prop != null){
// wrapped.add( new FauxPropertyFiltering(prop, filters));
// }
// }
// return wrapped;
// }
//
// private static final UnaryFunctor<FauxProperty,Boolean> notNull =
// new UnaryFunctor<FauxProperty,Boolean>(){
// @Override
// public Boolean fn(FauxProperty arg) {
// return arg != null;
// }
// };
//
// public void addSubproperty(Property property, Property subproperty) {
// innerFauxPropertyDao.addSubproperty(property, subproperty);
// }
//
// public void addSuperproperty(Property property, Property superproperty) {
// innerFauxPropertyDao.addSuperproperty(property, superproperty);
// }
//
// public void removeSubproperty(Property property, Property subproperty) {
// innerFauxPropertyDao.removeSubproperty(property, subproperty);
// }
//
// public void removeSuperproperty(Property property, Property superproperty) {
// innerFauxPropertyDao.removeSuperproperty(property, superproperty);
// }
//
// public void addEquivalentProperty(String propertyURI,
// String equivalentPropertyURI) {
// innerFauxPropertyDao.addEquivalentProperty(propertyURI, equivalentPropertyURI);
// }
//
// public void addEquivalentProperty(Property property,
// Property equivalentProperty) {
// innerFauxPropertyDao.addEquivalentProperty(property, equivalentProperty);
// }
//
// public List<String> getEquivalentPropertyURIs(String propertyURI) {
// return innerFauxPropertyDao.getEquivalentPropertyURIs(propertyURI);
// }
//
// public void removeEquivalentProperty(String propertyURI,
// String equivalentPropertyURI) {
// innerFauxPropertyDao.removeEquivalentProperty(propertyURI, equivalentPropertyURI);
// }
//
// public void removeEquivalentProperty(Property property,
// Property equivalentProperty) {
// innerFauxPropertyDao.removeEquivalentProperty(property, equivalentProperty);
// }
//
// public boolean skipEditForm(String predicateURI) {
// return innerFauxPropertyDao.skipEditForm(predicateURI);
// }
//
// public List <VClass> getClassesWithRestrictionOnProperty(String propertyURI) {
// return innerFauxPropertyDao.getClassesWithRestrictionOnProperty(propertyURI);
// }
//
// @Override
// // This may need to be filtered at some point.
// public List<FauxProperty> getFauxPropertyList(Individual subject) {
// return innerFauxPropertyDao.getFauxPropertyList(subject);
// }
//
// @Override
// // This may need to be filtered at some point.
// public List<FauxProperty> getFauxPropertyList(String subjectUri) {
// return innerFauxPropertyDao.getFauxPropertyList(subjectUri);
// }
//
// @Override
// public String getCustomListViewConfigFileName(FauxProperty fauxProperty) {
// return innerFauxPropertyDao.getCustomListViewConfigFileName(fauxProperty);
// }
}

View file

@ -10,6 +10,7 @@ import edu.cornell.mannlib.vitro.webapp.dao.DataPropertyDao;
import edu.cornell.mannlib.vitro.webapp.dao.DataPropertyStatementDao; import edu.cornell.mannlib.vitro.webapp.dao.DataPropertyStatementDao;
import edu.cornell.mannlib.vitro.webapp.dao.DatatypeDao; import edu.cornell.mannlib.vitro.webapp.dao.DatatypeDao;
import edu.cornell.mannlib.vitro.webapp.dao.DisplayModelDao; import edu.cornell.mannlib.vitro.webapp.dao.DisplayModelDao;
import edu.cornell.mannlib.vitro.webapp.dao.FauxPropertyDao;
import edu.cornell.mannlib.vitro.webapp.dao.IndividualDao; import edu.cornell.mannlib.vitro.webapp.dao.IndividualDao;
import edu.cornell.mannlib.vitro.webapp.dao.MenuDao; import edu.cornell.mannlib.vitro.webapp.dao.MenuDao;
import edu.cornell.mannlib.vitro.webapp.dao.ObjectPropertyDao; import edu.cornell.mannlib.vitro.webapp.dao.ObjectPropertyDao;
@ -57,6 +58,7 @@ public class WebappDaoFactoryFiltering implements WebappDaoFactory {
transient private DataPropertyStatementDao filteringDataPropertyStatementDao=null; transient private DataPropertyStatementDao filteringDataPropertyStatementDao=null;
transient private IndividualDao filteringIndividualDao=null; transient private IndividualDao filteringIndividualDao=null;
transient private ObjectPropertyDao filteringObjectPropertyDao=null; transient private ObjectPropertyDao filteringObjectPropertyDao=null;
transient private FauxPropertyDao filteringFauxPropertyDao=null;
transient private ObjectPropertyStatementDao filteringObjectPropertyStatementDao=null; transient private ObjectPropertyStatementDao filteringObjectPropertyStatementDao=null;
transient private VClassDao filteringVClassDao=null; transient private VClassDao filteringVClassDao=null;
@ -232,6 +234,14 @@ public class WebappDaoFactoryFiltering implements WebappDaoFactory {
return filteringObjectPropertyDao; return filteringObjectPropertyDao;
} }
public FauxPropertyDao getFauxPropertyDao() {
if (filteringFauxPropertyDao == null ){
filteringFauxPropertyDao = new FauxPropertyDaoFiltering(innerWebappDaoFactory.getFauxPropertyDao(),
filters);
}
return filteringFauxPropertyDao;
}
public VClassDao getVClassDao() { public VClassDao getVClassDao() {
if (filteringVClassDao == null ){ if (filteringVClassDao == null ){

View file

@ -0,0 +1,33 @@
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
package edu.cornell.mannlib.vitro.webapp.dao.jena;
import java.util.Map;
import org.apache.jena.atlas.lib.Pair;
import edu.cornell.mannlib.vitro.webapp.beans.ObjectProperty;
import edu.cornell.mannlib.vitro.webapp.dao.FauxPropertyDao;
import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService;
/**
* TODO
*/
public class FauxPropertyDaoJena implements FauxPropertyDao {
/**
* @param rdfService
* @param dwf
* @param customListViewConfigFileMap
* @param webappDaoFactoryJena
*/
public FauxPropertyDaoJena(
RDFService rdfService,
DatasetWrapperFactory dwf,
Map<Pair<String, Pair<ObjectProperty, String>>, String> customListViewConfigFileMap,
WebappDaoFactoryJena webappDaoFactoryJena) {
// TODO Auto-generated constructor stub
throw new RuntimeException("FauxPropertyDaoJena Constructor not implemented.");
}
}

View file

@ -33,6 +33,7 @@ import edu.cornell.mannlib.vitro.webapp.dao.DataPropertyDao;
import edu.cornell.mannlib.vitro.webapp.dao.DataPropertyStatementDao; import edu.cornell.mannlib.vitro.webapp.dao.DataPropertyStatementDao;
import edu.cornell.mannlib.vitro.webapp.dao.DatatypeDao; import edu.cornell.mannlib.vitro.webapp.dao.DatatypeDao;
import edu.cornell.mannlib.vitro.webapp.dao.DisplayModelDao; import edu.cornell.mannlib.vitro.webapp.dao.DisplayModelDao;
import edu.cornell.mannlib.vitro.webapp.dao.FauxPropertyDao;
import edu.cornell.mannlib.vitro.webapp.dao.IndividualDao; import edu.cornell.mannlib.vitro.webapp.dao.IndividualDao;
import edu.cornell.mannlib.vitro.webapp.dao.MenuDao; import edu.cornell.mannlib.vitro.webapp.dao.MenuDao;
import edu.cornell.mannlib.vitro.webapp.dao.ObjectPropertyDao; import edu.cornell.mannlib.vitro.webapp.dao.ObjectPropertyDao;
@ -375,6 +376,15 @@ public class WebappDaoFactoryJena implements WebappDaoFactory {
return objectPropertyDao; return objectPropertyDao;
} }
private FauxPropertyDao fauxPropertyDao = null;
@Override
public FauxPropertyDao getFauxPropertyDao() {
if( fauxPropertyDao == null )
fauxPropertyDao = new FauxPropertyDaoJena(
rdfService, dwf, config.customListViewConfigFileMap, this);
return fauxPropertyDao;
}
private PropertyInstanceDao propertyInstanceDao = null; private PropertyInstanceDao propertyInstanceDao = null;
@Override @Override
public PropertyInstanceDao getPropertyInstanceDao() { public PropertyInstanceDao getPropertyInstanceDao() {

View file

@ -3,7 +3,6 @@
package stubs.edu.cornell.mannlib.vitro.webapp.dao; package stubs.edu.cornell.mannlib.vitro.webapp.dao;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.Set; import java.util.Set;
import edu.cornell.mannlib.vitro.webapp.dao.ApplicationDao; import edu.cornell.mannlib.vitro.webapp.dao.ApplicationDao;
@ -11,6 +10,7 @@ import edu.cornell.mannlib.vitro.webapp.dao.DataPropertyDao;
import edu.cornell.mannlib.vitro.webapp.dao.DataPropertyStatementDao; import edu.cornell.mannlib.vitro.webapp.dao.DataPropertyStatementDao;
import edu.cornell.mannlib.vitro.webapp.dao.DatatypeDao; import edu.cornell.mannlib.vitro.webapp.dao.DatatypeDao;
import edu.cornell.mannlib.vitro.webapp.dao.DisplayModelDao; import edu.cornell.mannlib.vitro.webapp.dao.DisplayModelDao;
import edu.cornell.mannlib.vitro.webapp.dao.FauxPropertyDao;
import edu.cornell.mannlib.vitro.webapp.dao.IndividualDao; import edu.cornell.mannlib.vitro.webapp.dao.IndividualDao;
import edu.cornell.mannlib.vitro.webapp.dao.MenuDao; import edu.cornell.mannlib.vitro.webapp.dao.MenuDao;
import edu.cornell.mannlib.vitro.webapp.dao.ObjectPropertyDao; import edu.cornell.mannlib.vitro.webapp.dao.ObjectPropertyDao;
@ -42,6 +42,7 @@ public class WebappDaoFactoryStub implements WebappDaoFactory {
private MenuDao menuDao; private MenuDao menuDao;
private ObjectPropertyDao objectPropertyDao; private ObjectPropertyDao objectPropertyDao;
private ObjectPropertyStatementDao objectPropertyStatementDao; private ObjectPropertyStatementDao objectPropertyStatementDao;
private FauxPropertyDao fauxPropertyDao;
private OntologyDao ontologyDao; private OntologyDao ontologyDao;
private UserAccountsDao userAccountsDao; private UserAccountsDao userAccountsDao;
private VClassDao vClassDao; private VClassDao vClassDao;
@ -74,6 +75,10 @@ public class WebappDaoFactoryStub implements WebappDaoFactory {
this.objectPropertyStatementDao = objectPropertyStatementDao; this.objectPropertyStatementDao = objectPropertyStatementDao;
} }
public void setFauxPropertyDao(FauxPropertyDao fauxPropertyDao) {
this.fauxPropertyDao = fauxPropertyDao;
}
public void setOntologyDao(OntologyDao ontologyDao) { public void setOntologyDao(OntologyDao ontologyDao) {
this.ontologyDao = ontologyDao; this.ontologyDao = ontologyDao;
} }
@ -120,9 +125,15 @@ public class WebappDaoFactoryStub implements WebappDaoFactory {
return this.objectPropertyDao; return this.objectPropertyDao;
} }
@Override
public FauxPropertyDao getFauxPropertyDao() {
return this.fauxPropertyDao;
}
@Override @Override
public ObjectPropertyStatementDao getObjectPropertyStatementDao() { public ObjectPropertyStatementDao getObjectPropertyStatementDao() {
return this.objectPropertyStatementDao; } return this.objectPropertyStatementDao;
}
@Override @Override
public OntologyDao getOntologyDao() { public OntologyDao getOntologyDao() {