use of org.alfresco.web.ui.common.component.UIActionLink in project acs-community-packaging by Alfresco.
the class BaseDetailsBean method reject.
/**
* Event handler called to handle the approve step of the simple workflow
*
* @param event The event that was triggered
*/
public void reject(ActionEvent event) {
UIActionLink link = (UIActionLink) event.getComponent();
Map<String, String> params = link.getParameterMap();
String id = params.get("id");
if (id == null || id.length() == 0) {
throw new AlfrescoRuntimeException("reject called without an id");
}
final NodeRef docNodeRef = new NodeRef(Repository.getStoreRef(), id);
try {
RetryingTransactionHelper txnHelper = Repository.getRetryingTransactionHelper(FacesContext.getCurrentInstance());
RetryingTransactionCallback<Object> callback = new RetryingTransactionCallback<Object>() {
public Object execute() throws Throwable {
// call the service to perform the reject
WorkflowUtil.reject(docNodeRef, getNodeService(), getCopyService());
return null;
}
};
txnHelper.doInTransaction(callback);
// if this was called via the node details dialog we need to reset the node
if (getNode() != null) {
getNode().reset();
}
// also make sure the UI will get refreshed
UIContextService.getInstance(FacesContext.getCurrentInstance()).notifyBeans();
} catch (Throwable e) {
// rollback the transaction
Utils.addErrorMessage(MessageFormat.format(Application.getMessage(FacesContext.getCurrentInstance(), MSG_ERROR_WORKFLOW_REJECT), e.getMessage()), e);
ReportedException.throwIfNecessary(e);
}
}
use of org.alfresco.web.ui.common.component.UIActionLink in project acs-community-packaging by Alfresco.
the class BrowseBean method setupContentAction.
/**
* Action event called by all actions that need to setup a Content Document context on the
* BrowseBean before an action page/wizard is called. The context will be a Node in
* setDocument() which can be retrieved on the action page from BrowseBean.getDocument().
*/
public void setupContentAction(ActionEvent event) {
UIActionLink link = (UIActionLink) event.getComponent();
Map<String, String> params = link.getParameterMap();
setupContentAction(params.get("id"), true);
}
use of org.alfresco.web.ui.common.component.UIActionLink in project acs-community-packaging by Alfresco.
the class CategoriesDialog method clickCategory.
/**
* Action called when a category folder is clicked.
* Navigate into the category.
*/
public void clickCategory(ActionEvent event) {
UIActionLink link = (UIActionLink) event.getComponent();
Map<String, String> params = link.getParameterMap();
String id = params.get("id");
if (id != null && id.length() != 0) {
try {
NodeRef ref = new NodeRef(Repository.getStoreRef(), id);
// refresh UI based on node selection
updateUILocation(ref);
} catch (InvalidNodeRefException refErr) {
Utils.addErrorMessage(MessageFormat.format(Application.getMessage(FacesContext.getCurrentInstance(), Repository.ERROR_NODEREF), new Object[] { id }));
}
}
}
use of org.alfresco.web.ui.common.component.UIActionLink in project acs-community-packaging by Alfresco.
the class CategoriesDialog method setupCategoryAction.
/**
* Set the Category to be used for next action dialog
*/
public void setupCategoryAction(ActionEvent event) {
UIActionLink link = (UIActionLink) event.getComponent();
Map<String, String> params = link.getParameterMap();
String id = params.get("id");
if (id != null && id.length() != 0) {
if (logger.isDebugEnabled())
logger.debug("Setup for action, setting current Category to: " + id);
try {
// create the node ref, then our node representation
NodeRef ref = new NodeRef(Repository.getStoreRef(), id);
Node node = new Node(ref);
// prepare a node for the action context
setActionCategory(node);
// clear datalist cache ready from return from action dialog
contextUpdated();
} catch (InvalidNodeRefException refErr) {
Utils.addErrorMessage(MessageFormat.format(Application.getMessage(FacesContext.getCurrentInstance(), Repository.ERROR_NODEREF), new Object[] { id }));
}
}
}
use of org.alfresco.web.ui.common.component.UIActionLink in project acs-community-packaging by Alfresco.
the class SpaceLinkDetailsDialog method nextItem.
public void nextItem(ActionEvent event) {
UIActionLink link = (UIActionLink) event.getComponent();
Map<String, String> params = link.getParameterMap();
String id = params.get("id");
if (id != null && id.length() != 0) {
NodeRef currNodeRef = new NodeRef(Repository.getStoreRef(), id);
List<Node> nodes = this.browseBean.getParentNodes(currNodeRef);
Node next = null;
if (nodes.size() > 1) {
String currentSortColumn = this.browseBean.getSpacesRichList().getCurrentSortColumn();
boolean currentSortDescending = this.browseBean.getSpacesRichList().isCurrentSortDescending();
Collections.sort(nodes, new NodePropertyComparator(currentSortColumn, !currentSortDescending));
next = NodeListUtils.nextItem(nodes, id);
this.browseBean.setupSpaceAction(next.getId(), false);
}
if (next == null) {
Node currNode = new Node(currNodeRef);
this.navigator.setupDispatchContext(currNode);
}
}
}
Aggregations