Search in sources :

Example 11 with NodePropertyComparator

use of org.alfresco.web.ui.common.NodePropertyComparator in project acs-community-packaging by Alfresco.

the class ForumDetailsDialog 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);
        }
    }
}
Also used : NodeRef(org.alfresco.service.cmr.repository.NodeRef) UIActionLink(org.alfresco.web.ui.common.component.UIActionLink) Node(org.alfresco.web.bean.repository.Node) NodePropertyComparator(org.alfresco.web.ui.common.NodePropertyComparator)

Example 12 with NodePropertyComparator

use of org.alfresco.web.ui.common.NodePropertyComparator in project acs-community-packaging by Alfresco.

the class DocumentDetailsDialog method nextItem.

/**
 * Navigates to next item in the list of content for the current Space
 */
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) {
        List<Node> nodes = this.browseBean.getContent();
        if (nodes.size() > 1) {
            String currentSortColumn = this.browseBean.getContentRichList().getCurrentSortColumn();
            if (currentSortColumn != null) {
                boolean currentSortDescending = this.browseBean.getContentRichList().isCurrentSortDescending();
                Collections.sort(nodes, new NodePropertyComparator(currentSortColumn, !currentSortDescending));
            }
            Node next = NodeListUtils.nextItem(nodes, id);
            getRecentNodeRefsStack().clear();
            this.browseBean.setupContentAction(next.getId(), false);
        }
    }
}
Also used : UIActionLink(org.alfresco.web.ui.common.component.UIActionLink) Node(org.alfresco.web.bean.repository.Node) MapNode(org.alfresco.web.bean.repository.MapNode) NodePropertyComparator(org.alfresco.web.ui.common.NodePropertyComparator)

Example 13 with NodePropertyComparator

use of org.alfresco.web.ui.common.NodePropertyComparator in project acs-community-packaging by Alfresco.

the class DocumentDetailsDialog method previousItem.

/**
 * Navigates to the previous item in the list of content for the current Space
 */
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) {
        List<Node> nodes = this.browseBean.getContent();
        if (nodes.size() > 1) {
            String currentSortColumn = this.browseBean.getContentRichList().getCurrentSortColumn();
            if (currentSortColumn != null) {
                boolean currentSortDescending = this.browseBean.getContentRichList().isCurrentSortDescending();
                Collections.sort(nodes, new NodePropertyComparator(currentSortColumn, !currentSortDescending));
            }
            Node previous = NodeListUtils.previousItem(nodes, id);
            getRecentNodeRefsStack().clear();
            this.browseBean.setupContentAction(previous.getId(), false);
        }
    }
}
Also used : UIActionLink(org.alfresco.web.ui.common.component.UIActionLink) Node(org.alfresco.web.bean.repository.Node) MapNode(org.alfresco.web.bean.repository.MapNode) NodePropertyComparator(org.alfresco.web.ui.common.NodePropertyComparator)

Example 14 with NodePropertyComparator

use of org.alfresco.web.ui.common.NodePropertyComparator in project acs-community-packaging by Alfresco.

the class SpaceDetailsDialog method previousItem.

/**
 * Navigates to the previous item in the list Spaces
 */
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();
            if (currentSortColumn != null) {
                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);
        }
    }
}
Also used : NodeRef(org.alfresco.service.cmr.repository.NodeRef) UIActionLink(org.alfresco.web.ui.common.component.UIActionLink) Node(org.alfresco.web.bean.repository.Node) NodePropertyComparator(org.alfresco.web.ui.common.NodePropertyComparator)

Example 15 with NodePropertyComparator

use of org.alfresco.web.ui.common.NodePropertyComparator in project acs-community-packaging by Alfresco.

the class ForumsDetailsDialog 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);
        }
    }
}
Also used : NodeRef(org.alfresco.service.cmr.repository.NodeRef) UIActionLink(org.alfresco.web.ui.common.component.UIActionLink) Node(org.alfresco.web.bean.repository.Node) NodePropertyComparator(org.alfresco.web.ui.common.NodePropertyComparator)

Aggregations

Node (org.alfresco.web.bean.repository.Node)18 NodePropertyComparator (org.alfresco.web.ui.common.NodePropertyComparator)18 UIActionLink (org.alfresco.web.ui.common.component.UIActionLink)18 NodeRef (org.alfresco.service.cmr.repository.NodeRef)12 MapNode (org.alfresco.web.bean.repository.MapNode)2