use of org.alfresco.web.ui.common.component.UIActionLink in project acs-community-packaging by Alfresco.
the class TopicDetailsDialog 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);
}
}
}
use of org.alfresco.web.ui.common.component.UIActionLink in project acs-community-packaging by Alfresco.
the class GroupsDialog method removeUser.
/**
* Remove specified user from the current group
*/
public void removeUser(ActionEvent event) {
UIActionLink link = (UIActionLink) event.getComponent();
Map<String, String> params = link.getParameterMap();
String authority = params.get("id");
if (authority != null && authority.length() != 0) {
UserTransaction tx = null;
try {
FacesContext context = FacesContext.getCurrentInstance();
tx = Repository.getUserTransaction(context);
tx.begin();
this.getAuthorityService().removeAuthority(this.group, authority);
// commit the transaction
tx.commit();
// refresh UI after change
contextUpdated();
} catch (Throwable err) {
Utils.addErrorMessage(MessageFormat.format(Application.getMessage(FacesContext.getCurrentInstance(), Repository.ERROR_GENERIC), err.getMessage()), err);
try {
if (tx != null) {
tx.rollback();
}
} catch (Exception tex) {
}
}
}
}
use of org.alfresco.web.ui.common.component.UIActionLink in project acs-community-packaging by Alfresco.
the class GroupsDialog method clickGroup.
// ------------------------------------------------------------------------------
// Action handlers
/**
* Action called when a Group folder is clicked.
* Navigate into the Group and show child Groups and child Users.
*/
public void clickGroup(ActionEvent event) {
UIActionLink link = (UIActionLink) event.getComponent();
Map<String, String> params = link.getParameterMap();
String group = params.get("id");
if (group != null && group.length() != 0) {
// refresh UI based on node selection
updateUILocation(group);
setGroupsSearchCriteria(null);
}
}
use of org.alfresco.web.ui.common.component.UIActionLink in project acs-community-packaging by Alfresco.
the class NewEditionWizard method skipFirstStep.
/**
* Force the the lang of the new pivot translation for the new edition and skip the first step
*/
public void skipFirstStep(ActionEvent event) {
skipFirstStep = true;
// Get the lang of the new
UIActionLink link = (UIActionLink) event.getComponent();
Map<String, String> params = link.getParameterMap();
String lang = params.get("lang");
// test if the parameter is valid
ParameterCheck.mandatoryString("The lang of the node", lang);
// set the current mlContainer
setMLContainer();
setStartingItem(lang.toLowerCase());
}
use of org.alfresco.web.ui.common.component.UIActionLink in project acs-community-packaging by Alfresco.
the class SpacePreviewBean 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);
}
}
}
Aggregations