}
public PortalData load(Site src)
{
String type = Mapper.getOwnerType(src.getObjectType());
Attributes attrs = src.getAttributes();
//
Templatized templarized = src.getRootNavigation().getTemplatized();
org.gatein.mop.api.workspace.Page template = templarized.getTemplate();
UIContainer srcLayout = template.getRootComponent();
//
Map<String, String> properties = new HashMap<String, String>();
load(attrs, properties, portalPropertiesBlackList);
//
List<ComponentData> layoutChildren = loadChildren(srcLayout);
ContainerData layout = load(srcLayout, layoutChildren);
//
List<String> accessPermissions = Collections.emptyList();
String editPermission = null;
if (src.isAdapted(ProtectedResource.class)) {
ProtectedResource pr = src.adapt(ProtectedResource.class);
accessPermissions = pr.getAccessPermissions();
editPermission = pr.getEditPermission();
}
//
return new PortalData(
src.getObjectId(),
src.getName(),
type,
attrs.getValue(MappedAttributes.LOCALE),
accessPermissions,
editPermission,
Collections.unmodifiableMap(properties),
attrs.getValue(MappedAttributes.SKIN),
layout);
}