net.anotheria.anosite.decorator.BoxCMS2Decorator Maven / Gradle / Ivy
package net.anotheria.anosite.decorator;
import net.anotheria.anodoc.data.Document;
import net.anotheria.anodoc.data.NoSuchDocumentException;
import net.anotheria.anodoc.data.NoSuchPropertyException;
import net.anotheria.anoprise.metafactory.MetaFactory;
import net.anotheria.anoprise.metafactory.MetaFactoryException;
import net.anotheria.anosite.gen.aswebdata.data.Box;
import net.anotheria.anosite.gen.aswebdata.data.Pagex;
import net.anotheria.anosite.gen.aswebdata.service.IASWebDataService;
import net.anotheria.asg.data.DataObject;
import net.anotheria.asg.exception.ASGRuntimeException;
import net.anotheria.asg.util.decorators.IAttributeDecorator;
import net.anotheria.util.StringUtils;
import org.slf4j.LoggerFactory;
import org.slf4j.MarkerFactory;
import java.util.ArrayList;
import java.util.List;
/**
* Decorator for linked boxes.
* @author lrosenberg
*/
public class BoxCMS2Decorator implements IAttributeDecorator{
/**
* As web data service for box retrieval.
*/
/**
* Instance of webdataservice for retrieval of box definitions.
*/
private static IASWebDataService service;
static {
try {
service = MetaFactory.get(IASWebDataService.class);
} catch (MetaFactoryException e) {
LoggerFactory.getLogger(BoxCMS2Decorator.class).error(MarkerFactory.getMarker("FATAL"), "IASWebDataService asg service init failure", e);
}
}
@Override public String decorate(DataObject doc, String attributeName, String rule) {
try{
//tmp hack
List