diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/freemarker/IndividualController.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/freemarker/IndividualController.java index 65a008a26..fab97432e 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/freemarker/IndividualController.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/freemarker/IndividualController.java @@ -58,7 +58,7 @@ import edu.cornell.mannlib.vitro.webapp.utils.NamespaceMapperFactory; import edu.cornell.mannlib.vitro.webapp.utils.jena.ExtendedLinkedDataUtils; import edu.cornell.mannlib.vitro.webapp.web.ContentType; import edu.cornell.mannlib.vitro.webapp.web.templatemodels.individual.IndividualTemplateModel; -import edu.cornell.mannlib.vitro.webapp.web.templatemodels.individual.ListedIndividual; +import edu.cornell.mannlib.vitro.webapp.web.templatemodels.individuallist.ListedIndividual; import freemarker.ext.beans.BeansWrapper; /** diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/freemarker/IndividualListController.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/freemarker/IndividualListController.java index 6509575c2..1d3cc9b28 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/freemarker/IndividualListController.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/freemarker/IndividualListController.java @@ -45,8 +45,8 @@ import edu.cornell.mannlib.vitro.webapp.search.lucene.Entity2LuceneDoc; import edu.cornell.mannlib.vitro.webapp.search.lucene.Entity2LuceneDoc.VitroLuceneTermNames; import edu.cornell.mannlib.vitro.webapp.search.lucene.LuceneIndexFactory; import edu.cornell.mannlib.vitro.webapp.search.solr.SolrSetup; -import edu.cornell.mannlib.vitro.webapp.web.templatemodels.individual.BaseListedIndividual; -import edu.cornell.mannlib.vitro.webapp.web.templatemodels.individual.ListedIndividual; +import edu.cornell.mannlib.vitro.webapp.web.templatemodels.individuallist.BaseListedIndividual; +import edu.cornell.mannlib.vitro.webapp.web.templatemodels.individuallist.ListedIndividual; import freemarker.ext.beans.BeansWrapper; import freemarker.template.TemplateModel; @@ -109,7 +109,7 @@ public class IndividualListController extends FreemarkerHttpServlet { body.putAll(map); List inds = (List)map.get("entities"); - List indsTm = new ArrayList(); + List indsTm = new ArrayList(); for(Individual ind : inds ){ indsTm.add(new ListedIndividual(ind,vreq)); } diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/freemarker/SolrIndividualListController.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/freemarker/SolrIndividualListController.java index c2d7bae6f..e749cdfbd 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/freemarker/SolrIndividualListController.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/freemarker/SolrIndividualListController.java @@ -31,8 +31,8 @@ import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.Tem import edu.cornell.mannlib.vitro.webapp.dao.IndividualDao; import edu.cornell.mannlib.vitro.webapp.search.VitroSearchTermNames; import edu.cornell.mannlib.vitro.webapp.search.solr.SolrSetup; -import edu.cornell.mannlib.vitro.webapp.web.templatemodels.individual.BaseListedIndividual; -import edu.cornell.mannlib.vitro.webapp.web.templatemodels.individual.ListedIndividual; +import edu.cornell.mannlib.vitro.webapp.web.templatemodels.individuallist.BaseListedIndividual; +import edu.cornell.mannlib.vitro.webapp.web.templatemodels.individuallist.ListedIndividual; import freemarker.ext.beans.BeansWrapper; import freemarker.template.TemplateModel; @@ -96,7 +96,7 @@ public class SolrIndividualListController extends FreemarkerHttpServlet { @SuppressWarnings("unchecked") List inds = (List)map.get("entities"); - List indsTm = new ArrayList(); + List indsTm = new ArrayList(); for ( Individual ind : inds ) { indsTm.add(new ListedIndividual(ind,vreq)); } diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/search/controller/PagedSearchController.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/search/controller/PagedSearchController.java index 2a77c8b6a..a7155b828 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/search/controller/PagedSearchController.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/search/controller/PagedSearchController.java @@ -68,7 +68,7 @@ import edu.cornell.mannlib.vitro.webapp.search.lucene.Entity2LuceneDoc; import edu.cornell.mannlib.vitro.webapp.search.lucene.Entity2LuceneDoc.VitroLuceneTermNames; import edu.cornell.mannlib.vitro.webapp.search.lucene.LuceneIndexFactory; import edu.cornell.mannlib.vitro.webapp.web.templatemodels.LinkTemplateModel; -import edu.cornell.mannlib.vitro.webapp.web.templatemodels.individual.BaseListedIndividual; +import edu.cornell.mannlib.vitro.webapp.web.templatemodels.individuallist.BaseListedIndividual; import freemarker.template.Configuration; /** diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/search/controller/SolrPagedSearchController.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/search/controller/SolrPagedSearchController.java index ba6cac08e..f2b7ca7ae 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/search/controller/SolrPagedSearchController.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/search/controller/SolrPagedSearchController.java @@ -52,8 +52,8 @@ import edu.cornell.mannlib.vitro.webapp.search.beans.VitroQuery; import edu.cornell.mannlib.vitro.webapp.search.beans.VitroQueryFactory; import edu.cornell.mannlib.vitro.webapp.search.solr.SolrSetup; import edu.cornell.mannlib.vitro.webapp.web.templatemodels.LinkTemplateModel; -import edu.cornell.mannlib.vitro.webapp.web.templatemodels.individual.IndividualSearchResult; -import edu.cornell.mannlib.vitro.webapp.web.templatemodels.individual.BaseListedIndividual; +import edu.cornell.mannlib.vitro.webapp.web.templatemodels.individuallist.BaseListedIndividual; +import edu.cornell.mannlib.vitro.webapp.web.templatemodels.searchresult.IndividualSearchResult; import freemarker.template.Configuration; /** diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/utils/pageDataGetter/BrowseDataGetter.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/utils/pageDataGetter/BrowseDataGetter.java index 1282e0c0d..e89dcf5cf 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/utils/pageDataGetter/BrowseDataGetter.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/utils/pageDataGetter/BrowseDataGetter.java @@ -27,8 +27,8 @@ import edu.cornell.mannlib.vitro.webapp.dao.jena.VClassGroupCache; import edu.cornell.mannlib.vitro.webapp.utils.JSONtoFmModel; import edu.cornell.mannlib.vitro.webapp.web.templatemodels.VClassGroupTemplateModel; import edu.cornell.mannlib.vitro.webapp.web.templatemodels.VClassTemplateModel; -import edu.cornell.mannlib.vitro.webapp.web.templatemodels.individual.BaseListedIndividual; -import edu.cornell.mannlib.vitro.webapp.web.templatemodels.individual.ListedIndividual; +import edu.cornell.mannlib.vitro.webapp.web.templatemodels.individuallist.BaseListedIndividual; +import edu.cornell.mannlib.vitro.webapp.web.templatemodels.individuallist.ListedIndividual; public class BrowseDataGetter implements PageDataGetter { final static Log log = LogFactory.getLog(BrowseDataGetter.class); @@ -146,7 +146,7 @@ public class BrowseDataGetter implements PageDataGetter { List inds = vreq.getWebappDaoFactory().getIndividualDao() .getIndividualsByVClass(vclass); - List tInds = new ArrayList(inds.size()); + List tInds = new ArrayList(inds.size()); for( Individual ind : inds){ tInds.add(new ListedIndividual(ind, vreq)); } diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/utils/pageDataGetter/DataGetterUtils.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/utils/pageDataGetter/DataGetterUtils.java index 164a067b9..56e0372f7 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/utils/pageDataGetter/DataGetterUtils.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/utils/pageDataGetter/DataGetterUtils.java @@ -35,7 +35,7 @@ import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary; import edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactory; import edu.cornell.mannlib.vitro.webapp.dao.jena.VClassGroupCache; import edu.cornell.mannlib.vitro.webapp.web.templatemodels.VClassGroupTemplateModel; -import edu.cornell.mannlib.vitro.webapp.web.templatemodels.individual.BaseListedIndividual; +import edu.cornell.mannlib.vitro.webapp.web.templatemodels.individuallist.BaseListedIndividual; import freemarker.ext.beans.BeansWrapper; import freemarker.template.TemplateModel; diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/utils/pageDataGetter/IndividualsForClassesDataGetter.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/utils/pageDataGetter/IndividualsForClassesDataGetter.java index a76908e54..f5a2ac3eb 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/utils/pageDataGetter/IndividualsForClassesDataGetter.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/utils/pageDataGetter/IndividualsForClassesDataGetter.java @@ -33,7 +33,7 @@ import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary; import edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactory; import edu.cornell.mannlib.vitro.webapp.dao.jena.VClassGroupCache; import edu.cornell.mannlib.vitro.webapp.web.templatemodels.VClassGroupTemplateModel; -import edu.cornell.mannlib.vitro.webapp.web.templatemodels.individual.BaseListedIndividual; +import edu.cornell.mannlib.vitro.webapp.web.templatemodels.individuallist.BaseListedIndividual; import edu.cornell.mannlib.vitro.webapp.controller.JSONServlet; import freemarker.ext.beans.BeansWrapper; import freemarker.template.TemplateModel; diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/web/templatemodels/individual/BaseListedIndividual.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/web/templatemodels/individuallist/BaseListedIndividual.java similarity index 99% rename from webapp/src/edu/cornell/mannlib/vitro/webapp/web/templatemodels/individual/BaseListedIndividual.java rename to webapp/src/edu/cornell/mannlib/vitro/webapp/web/templatemodels/individuallist/BaseListedIndividual.java index 43bfea0b4..d94d4d121 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/web/templatemodels/individual/BaseListedIndividual.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/web/templatemodels/individuallist/BaseListedIndividual.java @@ -1,6 +1,6 @@ /* $This file is distributed under the terms of the license in /doc/license.txt$ */ -package edu.cornell.mannlib.vitro.webapp.web.templatemodels.individual; +package edu.cornell.mannlib.vitro.webapp.web.templatemodels.individuallist; import java.util.ArrayList; import java.util.List; diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/web/templatemodels/individual/ListedIndividual.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/web/templatemodels/individuallist/ListedIndividual.java similarity index 98% rename from webapp/src/edu/cornell/mannlib/vitro/webapp/web/templatemodels/individual/ListedIndividual.java rename to webapp/src/edu/cornell/mannlib/vitro/webapp/web/templatemodels/individuallist/ListedIndividual.java index e18225d26..12fbc098b 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/web/templatemodels/individual/ListedIndividual.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/web/templatemodels/individuallist/ListedIndividual.java @@ -1,6 +1,6 @@ /* $This file is distributed under the terms of the license in /doc/license.txt$ */ -package edu.cornell.mannlib.vitro.webapp.web.templatemodels.individual; +package edu.cornell.mannlib.vitro.webapp.web.templatemodels.individuallist; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/web/templatemodels/individual/IndividualSearchResult.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/web/templatemodels/searchresult/BaseIndividualSearchResult.java similarity index 81% rename from webapp/src/edu/cornell/mannlib/vitro/webapp/web/templatemodels/individual/IndividualSearchResult.java rename to webapp/src/edu/cornell/mannlib/vitro/webapp/web/templatemodels/searchresult/BaseIndividualSearchResult.java index 8b6e70772..2bfd7079b 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/web/templatemodels/individual/IndividualSearchResult.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/web/templatemodels/searchresult/BaseIndividualSearchResult.java @@ -1,6 +1,6 @@ /* $This file is distributed under the terms of the license in /doc/license.txt$ */ -package edu.cornell.mannlib.vitro.webapp.web.templatemodels.individual; +package edu.cornell.mannlib.vitro.webapp.web.templatemodels.searchresult; import java.util.ArrayList; import java.util.List; @@ -16,20 +16,19 @@ import edu.cornell.mannlib.vitro.webapp.web.ViewFinder; import edu.cornell.mannlib.vitro.webapp.web.ViewFinder.ClassView; import edu.cornell.mannlib.vitro.webapp.web.templatemodels.BaseTemplateModel; -public class IndividualSearchResult extends BaseTemplateModel { +public abstract class BaseIndividualSearchResult extends BaseTemplateModel { - private static final Log log = LogFactory.getLog(IndividualSearchResult.class); + private static final Log log = LogFactory.getLog(BaseIndividualSearchResult.class); protected Individual individual; protected VitroRequest vreq; - public IndividualSearchResult(Individual individual, VitroRequest vreq) { - this.individual = individual; - this.vreq = vreq; - + public BaseIndividualSearchResult(Individual individual, VitroRequest vreq) { + this.individual = individual; + this.vreq = vreq; } - private String getView(ClassView view) { + protected String getView(ClassView view) { ViewFinder vf = new ViewFinder(view); return vf.findClassView(individual, vreq); } diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/web/templatemodels/searchresult/IndividualSearchResult.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/web/templatemodels/searchresult/IndividualSearchResult.java new file mode 100644 index 000000000..4014c48ef --- /dev/null +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/web/templatemodels/searchresult/IndividualSearchResult.java @@ -0,0 +1,22 @@ +/* $This file is distributed under the terms of the license in /doc/license.txt$ */ + +package edu.cornell.mannlib.vitro.webapp.web.templatemodels.searchresult; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +import edu.cornell.mannlib.vitro.webapp.beans.Individual; +import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; + +public class IndividualSearchResult extends BaseIndividualSearchResult { + + private static final Log log = LogFactory.getLog(IndividualSearchResult.class); + + protected Individual individual; + protected VitroRequest vreq; + + public IndividualSearchResult(Individual individual, VitroRequest vreq) { + super(individual, vreq); + } + +} \ No newline at end of file diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/web/widgets/BrowseWidget.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/web/widgets/BrowseWidget.java index 052d13636..57ffac447 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/web/widgets/BrowseWidget.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/web/widgets/BrowseWidget.java @@ -26,8 +26,8 @@ import edu.cornell.mannlib.vitro.webapp.dao.jena.VClassGroupCache; import edu.cornell.mannlib.vitro.webapp.utils.JSONtoFmModel; import edu.cornell.mannlib.vitro.webapp.web.templatemodels.VClassGroupTemplateModel; import edu.cornell.mannlib.vitro.webapp.web.templatemodels.VClassTemplateModel; -import edu.cornell.mannlib.vitro.webapp.web.templatemodels.individual.BaseListedIndividual; -import edu.cornell.mannlib.vitro.webapp.web.templatemodels.individual.ListedIndividual; +import edu.cornell.mannlib.vitro.webapp.web.templatemodels.individuallist.BaseListedIndividual; +import edu.cornell.mannlib.vitro.webapp.web.templatemodels.individuallist.ListedIndividual; import freemarker.core.Environment; import freemarker.template.TemplateModelException; @@ -162,7 +162,7 @@ public class BrowseWidget extends Widget { List inds = vreq.getWebappDaoFactory().getIndividualDao() .getIndividualsByVClass(vclass); - List tInds = new ArrayList(inds.size()); + List tInds = new ArrayList(inds.size()); for( Individual ind : inds){ tInds.add(new ListedIndividual(ind, vreq)); }