* @param cp
*/
public CPPage(String identifier, ContentPackage cp) {
this.log = Logger.getLogger(CPPage.class.getName());
this.identifier = identifier;
CPManagerImpl cpMgm = (CPManagerImpl) CPManager.getInstance();
DefaultElement ele = cpMgm.getElementByIdentifier(cp, identifier);
if (ele instanceof CPItem) {
CPItem pageItem = (CPItem) ele;
this.cpRoot = false;
this.idRef = pageItem.getIdentifierRef();
this.title = pageItem.getTitle();
this.rootDir = cp.getRootDir();
this.metadata = pageItem.getMetadata();
if (metadata != null) metadata.setTitle(title);
this.cp = cp;
String filePath = cpMgm.getPageByItemId(cp, identifier);
if (filePath != null && filePath != "") {
LocalFileImpl f = (LocalFileImpl) cp.getRootDir().resolve(filePath);
this.pageFile = f;
}
} else if(ele instanceof CPOrganization){