net.anotheria.anosite.decorator.PageCMS2Decorator 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 links to pages.
* @author another
*
*/
public class PageCMS2Decorator implements IAttributeDecorator{
/**
* AsWebDataService instance for pagex looup
*/
private static IASWebDataService service;
/**
* Init.
*/
static {
try {
service = MetaFactory.get(IASWebDataService.class);
} catch (MetaFactoryException e) {
LoggerFactory.getLogger(PageCMS2Decorator.class).error(MarkerFactory.getMarker("FATAL"), "IASSiteDataService init failure", e);
}
}
@Override public String decorate(DataObject doc, String attributeName, String rule) {
try{
//tmp hack
List