use of org.apereo.portal.layout.IUserLayoutStore in project uPortal by Jasig.
the class GenerateEntityFileNameTask method perform.
/* (non-Javadoc)
* @see org.danann.cernunnos.Phrase#evaluate(org.danann.cernunnos.TaskRequest, org.danann.cernunnos.TaskResponse)
*/
@Override
public void perform(TaskRequest req, TaskResponse res) {
final Element rootElement = (Element) entityElement.evaluate(req, res);
final IUserLayoutStore rdbmdls = (IUserLayoutStore) layoutStore.evaluate(req, res);
SupportedFileTypes y = SupportedFileTypes.getApplicableFileType(rootElement, rdbmdls);
String entityFileName = y.getSafeFileNameWithExtension(rootElement);
ReturnValue rslt = (ReturnValue) req.getAttribute(Attributes.RETURN_VALUE);
rslt.setValue(entityFileName);
}
use of org.apereo.portal.layout.IUserLayoutStore in project uPortal by Jasig.
the class HandlerUtils method createILFCopy.
/**
* Creates a copy of an ilf node in the plf and sets up necessary storage attributes.
*/
private static Element createILFCopy(Element compViewNode, Element compViewParent, boolean includeChildNodes, Document plf, Element plfParent, IPerson person) throws PortalException {
Element plfNode = (Element) plf.importNode(compViewNode, includeChildNodes);
// make sure that we don't include ILF restriction params in the PLF if
// this ILF node contained any.
plfNode.removeAttributeNS(Constants.NS_URI, Constants.LCL_ADD_CHILD_ALLOWED);
plfNode.removeAttributeNS(Constants.NS_URI, Constants.LCL_DELETE_ALLOWED);
plfNode.removeAttributeNS(Constants.NS_URI, Constants.LCL_EDIT_ALLOWED);
plfNode.removeAttributeNS(Constants.NS_URI, Constants.LCL_MOVE_ALLOWED);
String ID = plfNode.getAttribute(Constants.ATT_ID);
plfNode.setIdAttribute(Constants.ATT_ID, true);
IUserLayoutStore uls = null;
uls = UserLayoutStoreLocator.getUserLayoutStore();
if (plfNode.getAttribute(Constants.ATT_PLF_ID).equals("")) {
String plfID = null;
try {
if (!plfNode.getAttribute(Constants.ATT_CHANNEL_ID).equals(// dealing with a channel
""))
plfID = uls.generateNewChannelSubscribeId(person);
else
plfID = uls.generateNewFolderId(person);
} catch (Exception e) {
throw new PortalException("Exception encountered while " + "generating new user layout node " + "Id for userId=" + person.getID(), e);
}
plfNode.setAttributeNS(Constants.NS_URI, Constants.ATT_PLF_ID, plfID);
plfNode.setAttributeNS(Constants.NS_URI, Constants.ATT_ORIGIN, ID);
}
plfParent.appendChild(plfNode);
PositionManager.updatePositionSet(compViewParent, plfParent, person);
return plfNode;
}
use of org.apereo.portal.layout.IUserLayoutStore in project uPortal by Jasig.
the class UserLayoutStoreLocator method getUserLayoutStore.
public static IUserLayoutStore getUserLayoutStore() {
AbstractBeanLocator<IUserLayoutStore> locator = locatorInstance;
if (locator == null) {
LOG.info("Looking up bean '" + BEAN_NAME + "' in ApplicationContext due to context not yet being initialized");
final ApplicationContext applicationContext = PortalApplicationContextLocator.getApplicationContext();
applicationContext.getBean(UserLayoutStoreLocator.class.getName());
locator = locatorInstance;
if (locator == null) {
LOG.warn("Instance of '" + BEAN_NAME + "' still null after portal application context has been initialized");
return applicationContext.getBean(BEAN_NAME, IUserLayoutStore.class);
}
}
return locator.getInstance();
}
Aggregations