JCRSessionWrapper session = jcrTemplate.getSessionFactory().getCurrentUserSession();
final JCRNodeWrapper parentNode = session.getNode(path);
session.checkout(parentNode);
final String name = epInstance1.getResKeyName() != null ? epInstance1.getResKeyName() : appBean.getName().replaceAll(
"/", "___") + Math.round(Math.random() * 1000000l);
final JCRPortletNode wrapper = (JCRPortletNode) parentNode.addNode(name, "jnt:portlet");
final String scope = epInstance1.getCacheScope();
if (scope != null) {
wrapper.setProperty("j:cacheScope", scope);
}
wrapper.setApplication(appBean.getID(), epInstance1.getDefName());
wrapper.setProperty("j:expirationTime", epInstance1.getExpirationTime());
session.save();
epInstance1.setID(wrapper.getUUID());
return epInstance1;
} catch (RepositoryException e) {
logger.error(e.getMessage(), e);
}
entryPointCache.put(ENTRY_POINT_INSTANCE + epInstance.getID(), epInstance);