use of org.alfresco.web.ui.common.component.UIActionLink in project acs-community-packaging by Alfresco.
the class SpaceLinkDetailsDialog method previousItem.
public void previousItem(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 previous = null;
if (nodes.size() > 1) {
String currentSortColumn = this.browseBean.getSpacesRichList().getCurrentSortColumn();
boolean currentSortDescending = this.browseBean.getSpacesRichList().isCurrentSortDescending();
Collections.sort(nodes, new NodePropertyComparator(currentSortColumn, !currentSortDescending));
previous = NodeListUtils.previousItem(nodes, id);
this.browseBean.setupSpaceAction(previous.getId(), false);
}
if (previous == null) {
Node currNode = new Node(currNodeRef);
this.navigator.setupDispatchContext(currNode);
}
}
}
use of org.alfresco.web.ui.common.component.UIActionLink in project acs-community-packaging by Alfresco.
the class ClipboardBean method copyNode.
// ------------------------------------------------------------------------------
// Navigation action event handlers
/**
* Action handler called to add a node to the clipboard for a Copy operation
*/
public void copyNode(ActionEvent event) {
UIActionLink link = (UIActionLink) event.getComponent();
Map<String, String> params = link.getParameterMap();
String ref = params.get("ref");
if (ref != null && ref.length() != 0) {
addClipboardNode(new NodeRef(ref), null, ClipboardStatus.COPY);
}
}
use of org.alfresco.web.ui.common.component.UIActionLink in project acs-community-packaging by Alfresco.
the class ActionLinkRenderer method encodeEnd.
/**
* @see javax.faces.render.Renderer#encodeEnd(javax.faces.context.FacesContext, javax.faces.component.UIComponent)
*/
public void encodeEnd(FacesContext context, UIComponent component) throws IOException {
// always check for this flag - as per the spec
if (!component.isRendered()) {
return;
}
UIActionLink link = (UIActionLink) component;
// on the page so don't bother rendering anything
if (link.getValue() != null) {
Writer out = context.getResponseWriter();
UIComponent verticalContiner = getVerticalContainer(link);
if (verticalContiner != null) {
int padding = link.getPadding();
if (verticalContiner instanceof UIActions) {
padding = ((UIActions) verticalContiner).getVerticalSpacing();
}
// render as menu item style action link
renderMenuAction(context, out, link, padding);
} else {
// render as action link
renderActionLink(context, out, link);
}
}
}
use of org.alfresco.web.ui.common.component.UIActionLink in project acs-community-packaging by Alfresco.
the class ActionLinkRenderer method decode.
// ------------------------------------------------------------------------------
// Renderer implementation
/**
* @see javax.faces.render.Renderer#decode(javax.faces.context.FacesContext, javax.faces.component.UIComponent)
*/
public void decode(FacesContext context, UIComponent component) {
Map requestMap = context.getExternalContext().getRequestParameterMap();
String fieldId = Utils.getActionHiddenFieldName(context, component);
String value = (String) requestMap.get(fieldId);
// we are clicked if the hidden field contained our client id
if (value != null && value.equals(component.getClientId(context))) {
// get all the params for this actionlink, see if any values have been set
// on the request which match our params and set them into the component
UIActionLink link = (UIActionLink) component;
Map<String, String> destParams = link.getParameterMap();
Map<String, String> actionParams = getParameterComponents(link);
if (actionParams != null) {
for (String name : actionParams.keySet()) {
String paramValue = (String) requestMap.get(name);
destParams.put(name, paramValue);
}
}
ActionEvent event = new ActionEvent(component);
component.queueEvent(event);
}
}
use of org.alfresco.web.ui.common.component.UIActionLink in project acs-community-packaging by Alfresco.
the class DeleteUserDialog method setupUserAction.
public void setupUserAction(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 Person to: " + id);
try {
// create the node ref, then our node representation
NodeRef ref = new NodeRef(Repository.getStoreRef(), id);
Node node = new Node(ref);
// remember the Person node
setPerson(node);
} catch (InvalidNodeRefException refErr) {
Utils.addErrorMessage(MessageFormat.format(Application.getMessage(FacesContext.getCurrentInstance(), Repository.ERROR_NODEREF), new Object[] { id }));
}
} else {
setPerson(null);
}
}
Aggregations