Changed package and class names for view objects
This commit is contained in:
parent
75b9030cc3
commit
49fdfb1019
14 changed files with 36 additions and 34 deletions
|
@ -17,7 +17,7 @@ import edu.cornell.mannlib.vitro.webapp.dao.filtering.WebappDaoFactoryFiltering;
|
|||
import edu.cornell.mannlib.vitro.webapp.dao.filtering.filters.VitroFilterUtils;
|
||||
import edu.cornell.mannlib.vitro.webapp.dao.filtering.filters.VitroFilters;
|
||||
import edu.cornell.mannlib.vitro.webapp.flags.PortalFlag;
|
||||
import edu.cornell.mannlib.vitro.webapp.web.templatemodels.VClassGroupView;
|
||||
import edu.cornell.mannlib.vitro.webapp.web.templatemodels.VClassGroupTemplateModel;
|
||||
import freemarker.template.SimpleSequence;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
|
@ -85,9 +85,9 @@ public class BrowseController extends FreeMarkerHttpServlet {
|
|||
// FreeMarker will wrap vcgroups in a SimpleSequence. So do we want to create the SimpleSequence directly?
|
||||
// But, makes code less portable to another system.
|
||||
// SimpleSequence vcgroups = new SimpleSequence(groups.size());
|
||||
List<VClassGroupView> vcgroups = new ArrayList<VClassGroupView>(groups.size());
|
||||
List<VClassGroupTemplateModel> vcgroups = new ArrayList<VClassGroupTemplateModel>(groups.size());
|
||||
for (VClassGroup g: groups) {
|
||||
vcgroups.add(new VClassGroupView(g));
|
||||
vcgroups.add(new VClassGroupTemplateModel(g));
|
||||
}
|
||||
body.put("classGroups", vcgroups);
|
||||
}
|
||||
|
|
|
@ -32,6 +32,7 @@ import edu.cornell.mannlib.vitro.webapp.web.PortalWebUtil;
|
|||
import edu.cornell.mannlib.vitro.webapp.web.templatemodels.filelist.ScriptList;
|
||||
import edu.cornell.mannlib.vitro.webapp.web.templatemodels.filelist.StylesheetList;
|
||||
import edu.cornell.mannlib.vitro.webapp.web.templatemodels.menu.TabMenu;
|
||||
|
||||
import freemarker.cache.ClassTemplateLoader;
|
||||
import freemarker.cache.FileTemplateLoader;
|
||||
import freemarker.cache.MultiTemplateLoader;
|
||||
|
|
|
@ -10,7 +10,7 @@ import org.apache.commons.logging.Log;
|
|||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import edu.cornell.mannlib.vitro.webapp.ConfigurationProperties;
|
||||
import edu.cornell.mannlib.vitro.webapp.web.templatemodels.ViewObject;
|
||||
import edu.cornell.mannlib.vitro.webapp.web.templatemodels.BaseTemplateModel;
|
||||
import freemarker.ext.beans.BeansWrapper;
|
||||
import freemarker.template.Configuration;
|
||||
import freemarker.template.DefaultObjectWrapper;
|
||||
|
@ -69,7 +69,7 @@ public class FreeMarkerSetup implements ServletContextListener {
|
|||
|
||||
FreeMarkerHttpServlet.config = cfg;
|
||||
FreeMarkerHttpServlet.context = sc;
|
||||
ViewObject.context = sc;
|
||||
BaseTemplateModel.context = sc;
|
||||
UrlBuilder.contextPath = sc.getContextPath();
|
||||
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@ import edu.cornell.mannlib.vitro.webapp.beans.Individual;
|
|||
import edu.cornell.mannlib.vitro.webapp.beans.VClass;
|
||||
import edu.cornell.mannlib.vitro.webapp.beans.VClassGroup;
|
||||
import edu.cornell.mannlib.vitro.webapp.utils.StringUtils;
|
||||
import edu.cornell.mannlib.vitro.webapp.web.templatemodels.IndividualView;
|
||||
import edu.cornell.mannlib.vitro.webapp.web.templatemodels.IndividualTemplateModel;
|
||||
|
||||
/**
|
||||
* Generates a list of individuals for display in a template
|
||||
|
@ -64,7 +64,7 @@ public class IndividualListController extends FreeMarkerHttpServlet {
|
|||
if (vclass != null) {
|
||||
// Create list of individual view objects
|
||||
List<Individual> individualList = vreq.getWebappDaoFactory().getIndividualDao().getIndividualsByVClass(vclass);
|
||||
List<IndividualView> individuals = new ArrayList<IndividualView>(individualList.size());
|
||||
List<IndividualTemplateModel> individuals = new ArrayList<IndividualTemplateModel>(individualList.size());
|
||||
|
||||
if (individualList == null) {
|
||||
// RY Is this really an error?
|
||||
|
@ -72,7 +72,7 @@ public class IndividualListController extends FreeMarkerHttpServlet {
|
|||
message = "No individuals to display.";
|
||||
} else {
|
||||
for (Individual i: individualList) {
|
||||
individuals.add(new IndividualView(i));
|
||||
individuals.add(new IndividualTemplateModel(i));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
package edu.cornell.mannlib.vitro.webapp.web;
|
||||
|
||||
import java.io.File;
|
||||
import java.lang.reflect.InvocationTargetException;
|
|
@ -10,9 +10,9 @@ import org.apache.commons.logging.LogFactory;
|
|||
import edu.cornell.mannlib.vitro.webapp.controller.freemarker.UrlBuilder;
|
||||
import edu.cornell.mannlib.vitro.webapp.controller.freemarker.UrlBuilder.Params;
|
||||
|
||||
public abstract class ViewObject {
|
||||
public abstract class BaseTemplateModel {
|
||||
|
||||
private static final Log log = LogFactory.getLog(ViewObject.class.getName());
|
||||
private static final Log log = LogFactory.getLog(BaseTemplateModel.class.getName());
|
||||
|
||||
public static ServletContext context = null;
|
||||
|
|
@ -12,17 +12,18 @@ import edu.cornell.mannlib.vitro.webapp.beans.Individual;
|
|||
import edu.cornell.mannlib.vitro.webapp.beans.Link;
|
||||
import edu.cornell.mannlib.vitro.webapp.controller.freemarker.UrlBuilder.Route;
|
||||
import edu.cornell.mannlib.vitro.webapp.utils.StringUtils;
|
||||
import edu.cornell.mannlib.vitro.webapp.web.templatemodels.ViewFinder.ClassView;
|
||||
import edu.cornell.mannlib.vitro.webapp.web.ViewFinder;
|
||||
import edu.cornell.mannlib.vitro.webapp.web.ViewFinder.ClassView;
|
||||
|
||||
public class IndividualView extends ViewObject {
|
||||
public class IndividualTemplateModel extends BaseTemplateModel {
|
||||
|
||||
private static final Log log = LogFactory.getLog(IndividualView.class.getName());
|
||||
private static final Log log = LogFactory.getLog(IndividualTemplateModel.class.getName());
|
||||
|
||||
private static final String PATH = Route.INDIVIDUAL.path();
|
||||
|
||||
private Individual individual;
|
||||
|
||||
public IndividualView(Individual individual) {
|
||||
public IndividualTemplateModel(Individual individual) {
|
||||
this.individual = individual;
|
||||
}
|
||||
|
|
@ -12,14 +12,14 @@ import org.apache.commons.logging.LogFactory;
|
|||
import edu.cornell.mannlib.vitro.webapp.beans.VClass;
|
||||
import edu.cornell.mannlib.vitro.webapp.beans.VClassGroup;
|
||||
|
||||
public class VClassGroupView extends ViewObject {
|
||||
public class VClassGroupTemplateModel extends BaseTemplateModel {
|
||||
|
||||
private static final Log log = LogFactory.getLog(VClassGroupView.class.getName());
|
||||
private static final Log log = LogFactory.getLog(VClassGroupTemplateModel.class.getName());
|
||||
|
||||
private VClassGroup vClassGroup = null;
|
||||
private List<VClassView> classes = null;
|
||||
private List<VClassTemplateModel> classes = null;
|
||||
|
||||
public VClassGroupView(VClassGroup vClassGroup) {
|
||||
public VClassGroupTemplateModel(VClassGroup vClassGroup) {
|
||||
this.vClassGroup = vClassGroup;
|
||||
}
|
||||
|
||||
|
@ -43,12 +43,12 @@ public class VClassGroupView extends ViewObject {
|
|||
return vClassGroup.getPublicName();
|
||||
}
|
||||
|
||||
public List<VClassView> getClasses() {
|
||||
public List<VClassTemplateModel> getClasses() {
|
||||
if (classes == null) {
|
||||
List<VClass> classList = vClassGroup.getVitroClassList();
|
||||
classes = new ArrayList<VClassView>();
|
||||
classes = new ArrayList<VClassTemplateModel>();
|
||||
for (VClass vc : classList) {
|
||||
classes.add(new VClassView(vc));
|
||||
classes.add(new VClassTemplateModel(vc));
|
||||
}
|
||||
}
|
||||
|
|
@ -9,14 +9,14 @@ import edu.cornell.mannlib.vitro.webapp.beans.VClass;
|
|||
import edu.cornell.mannlib.vitro.webapp.controller.freemarker.UrlBuilder.Params;
|
||||
import edu.cornell.mannlib.vitro.webapp.controller.freemarker.UrlBuilder.Route;
|
||||
|
||||
public class VClassView extends ViewObject {
|
||||
public class VClassTemplateModel extends BaseTemplateModel {
|
||||
|
||||
private static final Log log = LogFactory.getLog(VClassView.class.getName());
|
||||
private static final Log log = LogFactory.getLog(VClassTemplateModel.class.getName());
|
||||
private static final String PATH = Route.INDIVIDUAL_LIST.path();
|
||||
|
||||
private VClass vclass;
|
||||
|
||||
public VClassView(VClass vclass) {
|
||||
public VClassTemplateModel(VClass vclass) {
|
||||
this.vclass = vclass;
|
||||
}
|
||||
|
|
@ -1,14 +1,14 @@
|
|||
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
||||
|
||||
package edu.cornell.mannlib.vitro.webapp.web.templatemodels.fileList;
|
||||
package edu.cornell.mannlib.vitro.webapp.web.templatemodels.filelist;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import edu.cornell.mannlib.vitro.webapp.web.templatemodels.ViewObject;
|
||||
import edu.cornell.mannlib.vitro.webapp.web.templatemodels.BaseTemplateModel;
|
||||
|
||||
public abstract class FileList extends ViewObject {
|
||||
public abstract class FileList extends BaseTemplateModel {
|
||||
|
||||
protected List<String> list = null;
|
||||
private String themeDir = null;
|
||||
|
|
|
@ -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.fileList;
|
||||
package edu.cornell.mannlib.vitro.webapp.web.templatemodels.filelist;
|
||||
|
||||
public class ScriptList extends FileList {
|
||||
|
||||
|
|
|
@ -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.fileList;
|
||||
package edu.cornell.mannlib.vitro.webapp.web.templatemodels.filelist;
|
||||
|
||||
public class StylesheetList extends FileList {
|
||||
|
||||
|
|
|
@ -9,9 +9,9 @@ import org.apache.commons.logging.Log;
|
|||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
|
||||
import edu.cornell.mannlib.vitro.webapp.web.templatemodels.ViewObject;
|
||||
import edu.cornell.mannlib.vitro.webapp.web.templatemodels.BaseTemplateModel;
|
||||
|
||||
public class Menu extends ViewObject {
|
||||
public class Menu extends BaseTemplateModel {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
private static final Log log = LogFactory.getLog(Menu.class.getName());
|
||||
|
|
|
@ -5,9 +5,9 @@ package edu.cornell.mannlib.vitro.webapp.web.templatemodels.menu;
|
|||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import edu.cornell.mannlib.vitro.webapp.web.templatemodels.ViewObject;
|
||||
import edu.cornell.mannlib.vitro.webapp.web.templatemodels.BaseTemplateModel;
|
||||
|
||||
public class MenuItem extends ViewObject {
|
||||
public class MenuItem extends BaseTemplateModel {
|
||||
|
||||
private static final Log log = LogFactory.getLog(MenuItem.class.getName());
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue