05-01-2007 11:31 AM
<action id="portal_enable"> <evaluator>com.somedomain.web.action.evaluator.PortalEnableEvaluator</evaluator>
<label-id>enablePortal</label-id>
<image>/images/icons/shortcut.gif</image>
<action-listener>#{PortalSettingsBean.setActive}</action-listener>
<params>
<param name="id">#{actionContext.id}</param>
<param name="active">true</param>
</params>
</action>
FacesContext context = FacesContext.getCurrentInstance();
tx = Repository.getUserTransaction(context);
tx.begin();
Map<QName, Serializable> properties = nodeService.getProperties(ref);
properties.put(SomeModel.PROP_ACTIVE, activeFlag);
if (activeFlag) {
properties.put(SomeModel.PROP_PUBLISH_DATE, new Date());
}
// if the aspect has already been added, set the properties
if (node.hasAspect(SomeModel.ASPECT_PORTAL)) {
nodeService.setProperties(ref, properties);
} else {
// otherwise, add the aspect and set the properties
nodeService.addAspect(ref, SomeModel.ASPECT_PORTAL, properties);
}
String msg = Application.getMessage(fc, MSG_SUCCESS_PORTAL_SET_ACTIVE);
FacesMessage facesMsg = new FacesMessage(FacesMessage.SEVERITY_INFO, msg, msg);
String formId = Utils.getParentForm(fc, event.getComponent()).getClientId(fc);
fc.addMessage(formId + ':' + getPropertiesPanelId(), facesMsg);
// commit the transaction
tx.commit();
this.browseBean.getActionSpace().reset();
if (logger.isDebugEnabled()) logger.debug("Ran portal enable/disable action");
05-03-2007 05:40 AM
this.browseBean.getActionSpace().reset();
should work and your code looks find to me. This is the same method we call when anything is modified in the properties screen - such as categories or versioning settings.05-04-2007 02:20 PM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.