Removed the concept of a default object property data preprocessor, since profile urls are now handled elsewhere.

This commit is contained in:
rjy7 2010-12-17 17:59:00 +00:00
parent 796f6e0965
commit 04f244baef
4 changed files with 6 additions and 21 deletions

View file

@ -5,10 +5,9 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import edu.cornell.mannlib.vitro.webapp.beans.Individual; import edu.cornell.mannlib.vitro.webapp.beans.Individual;
import edu.cornell.mannlib.vitro.webapp.controller.freemarker.UrlBuilder;
import edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactory; import edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactory;
public class BaseObjectPropertyDataPreprocessor implements public abstract class BaseObjectPropertyDataPreprocessor implements
ObjectPropertyDataPreprocessor { ObjectPropertyDataPreprocessor {
protected ObjectPropertyTemplateModel objectPropertyTemplateModel; protected ObjectPropertyTemplateModel objectPropertyTemplateModel;
@ -23,28 +22,14 @@ public class BaseObjectPropertyDataPreprocessor implements
@Override @Override
public void process(List<Map<String, String>> data) { public void process(List<Map<String, String>> data) {
for (Map<String, String> map : data) { for (Map<String, String> map : data) {
applyStandardPreprocessing(map); process(map);
applyPropertySpecificPreprocessing(map);
} }
} }
/* Standard preprocessing that applies to all views. */ protected abstract void process(Map<String, String> map);
protected void applyStandardPreprocessing(Map<String, String> map) {
/* none identified yet */
}
protected void applyPropertySpecificPreprocessing(Map<String, String> map) {
/* Base class method is empty because this method is defined
* to apply subclass preprocessing.
*/
}
/* Preprocessor helper methods callable from any preprocessor */ /* Preprocessor helper methods callable from any preprocessor */
protected String getLink(String uri) {
return UrlBuilder.getIndividualProfileUrl(uri, wdf);
}
protected String getMoniker(String uri) { protected String getMoniker(String uri) {
return getIndividual(uri).getMoniker(); return getIndividual(uri).getMoniker();
} }

View file

@ -15,7 +15,7 @@ public class DefaultObjectPropertyDataPreprocessor extends
@Override @Override
/* Apply preprocessing specific to this preprocessor */ /* Apply preprocessing specific to this preprocessor */
protected void applyPropertySpecificPreprocessing(Map<String, String> map) { protected void process(Map<String, String> map) {
addName(map); addName(map);
addMoniker(map); addMoniker(map);
} }

View file

@ -16,5 +16,5 @@ import java.util.Map;
public interface ObjectPropertyDataPreprocessor { public interface ObjectPropertyDataPreprocessor {
public void process(List<Map<String, String>> data); public void process(List<Map<String, String>> data);
} }

View file

@ -71,7 +71,7 @@ public abstract class ObjectPropertyTemplateModel extends PropertyTemplateModel
protected void preprocess(List<Map<String, String>> data, WebappDaoFactory wdf) { protected void preprocess(List<Map<String, String>> data, WebappDaoFactory wdf) {
String preprocessorName = config.preprocessor; String preprocessorName = config.preprocessor;
if (preprocessorName == null) { if (preprocessorName == null) {
preprocessorName = DEFAULT_PREPROCESSOR; return;
} }
try { try {