SiteNodeVO newSiteNode = SiteNodeControllerProxy.getSiteNodeControllerProxy().acCreate(principal, newParentSiteNode.getId(), siteNode.getSiteNodeTypeDefinitionId(), newParentSiteNode.getRepositoryId(), newSiteNodeVO, db).getValueObject();
RequestAnalyser.getRequestAnalyser().registerComponentStatistics("acCreate", t.getElapsedTime());
SiteNodeVersionVO siteNodeVersionVO = SiteNodeVersionController.getController().getLatestActiveSiteNodeVersionVO(db, oldSiteNodeVO.getId());
RequestAnalyser.getRequestAnalyser().registerComponentStatistics("getLatestActiveSiteNodeVersionVO", t.getElapsedTime());
if(siteNodeVersionVO != null)
{
Integer oldSiteNodeVersionId = siteNodeVersionVO.getId();
SiteNodeVersionVO newSiteNodeVersionVO = new SiteNodeVersionVO();
newSiteNodeVersionVO.setContentType(siteNodeVersionVO.getContentType());
newSiteNodeVersionVO.setPageCacheKey(siteNodeVersionVO.getPageCacheKey());
newSiteNodeVersionVO.setPageCacheTimeout(siteNodeVersionVO.getPageCacheTimeout());
newSiteNodeVersionVO.setDisableEditOnSight(siteNodeVersionVO.getDisableEditOnSight());
newSiteNodeVersionVO.setDisableLanguages(siteNodeVersionVO.getDisableLanguages());
newSiteNodeVersionVO.setDisablePageCache(siteNodeVersionVO.getDisablePageCache());
newSiteNodeVersionVO.setDisableForceIdentityCheck(siteNodeVersionVO.getDisableForceIdentityCheck());
newSiteNodeVersionVO.setForceProtocolChange(siteNodeVersionVO.getForceProtocolChange());
newSiteNodeVersionVO.setIsProtected(siteNodeVersionVO.getIsProtected());
newSiteNodeVersionVO.setVersionModifier(principal.getName());
newSiteNodeVersionVO.setStateId(0);
newSiteNodeVersionVO.setIsActive(true);
newSiteNodeVersionVO.setModifiedDateTime(siteNodeVersionVO.getModifiedDateTime());
SiteNodeVersionVO siteNodeVersion = SiteNodeVersionController.getController().createSmall(newSiteNode.getId(), principal, newSiteNodeVersionVO, db).getValueObject();
RequestAnalyser.getRequestAnalyser().registerComponentStatistics("createSmall", t.getElapsedTime());
Map args = new HashMap();
args.put("globalKey", "infoglue");
PropertySet ps = PropertySetManager.getInstance("jdbc", args);
String disabledLanguagesString = ps.getString("siteNode_" + oldSiteNodeVO.getId() + "_disabledLanguages");
String enabledLanguagesString = ps.getString("siteNode_" + oldSiteNodeVO.getId() + "_enabledLanguages");
logger.info("disabledLanguagesString:" + disabledLanguagesString);
logger.info("enabledLanguagesString:" + enabledLanguagesString);
if(disabledLanguagesString != null && !disabledLanguagesString.equals(""))
ps.setString("siteNode_" + newSiteNode.getId() + "_disabledLanguages", disabledLanguagesString);
if(enabledLanguagesString != null && !enabledLanguagesString.equals(""))
ps.setString("siteNode_" + newSiteNode.getId() + "_enabledLanguages", enabledLanguagesString);
RequestAnalyser.getRequestAnalyser().registerComponentStatistics("ps", t.getElapsedTime());
//Copy all access rights...
SiteNodeStateController.getController().copyAccessRights("SiteNodeVersion", oldSiteNodeVersionId, siteNodeVersion.getId(), db);
RequestAnalyser.getRequestAnalyser().registerComponentStatistics("copyAccessRights", t.getElapsedTime());
/*
copyAccessRights(db, oldSiteNodeVersionId.toString(), siteNodeVersion.getId().toString(), "SiteNodeVersion.Read");
copyAccessRights(db, oldSiteNodeVersionId.toString(), siteNodeVersion.getId().toString(), "SiteNodeVersion.Write");
copyAccessRights(db, oldSiteNodeVersionId.toString(), siteNodeVersion.getId().toString(), "SiteNodeVersion.CreateSiteNode");