Removed the concept of a default object property data preprocessor, since profile urls are now handled elsewhere.
This commit is contained in:
parent
796f6e0965
commit
04f244baef
4 changed files with 6 additions and 21 deletions
|
@ -5,10 +5,9 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
|
||||
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;
|
||||
|
||||
public class BaseObjectPropertyDataPreprocessor implements
|
||||
public abstract class BaseObjectPropertyDataPreprocessor implements
|
||||
ObjectPropertyDataPreprocessor {
|
||||
|
||||
protected ObjectPropertyTemplateModel objectPropertyTemplateModel;
|
||||
|
@ -23,28 +22,14 @@ public class BaseObjectPropertyDataPreprocessor implements
|
|||
@Override
|
||||
public void process(List<Map<String, String>> data) {
|
||||
for (Map<String, String> map : data) {
|
||||
applyStandardPreprocessing(map);
|
||||
applyPropertySpecificPreprocessing(map);
|
||||
process(map);
|
||||
}
|
||||
}
|
||||
|
||||
/* Standard preprocessing that applies to all views. */
|
||||
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.
|
||||
*/
|
||||
}
|
||||
protected abstract void process(Map<String, String> map);
|
||||
|
||||
/* Preprocessor helper methods callable from any preprocessor */
|
||||
|
||||
protected String getLink(String uri) {
|
||||
return UrlBuilder.getIndividualProfileUrl(uri, wdf);
|
||||
}
|
||||
|
||||
protected String getMoniker(String uri) {
|
||||
return getIndividual(uri).getMoniker();
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ public class DefaultObjectPropertyDataPreprocessor extends
|
|||
|
||||
@Override
|
||||
/* Apply preprocessing specific to this preprocessor */
|
||||
protected void applyPropertySpecificPreprocessing(Map<String, String> map) {
|
||||
protected void process(Map<String, String> map) {
|
||||
addName(map);
|
||||
addMoniker(map);
|
||||
}
|
||||
|
|
|
@ -16,5 +16,5 @@ import java.util.Map;
|
|||
public interface ObjectPropertyDataPreprocessor {
|
||||
|
||||
public void process(List<Map<String, String>> data);
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -71,7 +71,7 @@ public abstract class ObjectPropertyTemplateModel extends PropertyTemplateModel
|
|||
protected void preprocess(List<Map<String, String>> data, WebappDaoFactory wdf) {
|
||||
String preprocessorName = config.preprocessor;
|
||||
if (preprocessorName == null) {
|
||||
preprocessorName = DEFAULT_PREPROCESSOR;
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue