POMSession session = pomMgr.getSession();
WorkspaceObject workspaceObject = session.findObjectById(workspaceObjectId);
if (workspaceObject instanceof UIComponent) {
Site site = ((UIComponent) workspaceObject).getPage().getSite();
ObjectType<? extends Site> siteType = site.getObjectType();
String[] siteInfo = new String[2];
// Put the siteType on returned map
if (siteType == ObjectType.PORTAL_SITE) {
siteInfo[0] = PortalConfig.PORTAL_TYPE;
} else if (siteType == ObjectType.GROUP_SITE) {
siteInfo[0] = PortalConfig.GROUP_TYPE;
} else if (siteType == ObjectType.USER_SITE) {
siteInfo[0] = PortalConfig.USER_TYPE;
}
// Put the siteOwner on returned map
siteInfo[1] = site.getName();
return siteInfo;
}
throw new Exception("The provided ID is not associated with an application");