Search in sources :

Example 26 with UIActionLink

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

the class CheckinCheckoutDialog method setupWorkflowContentAction.

public void setupWorkflowContentAction(ActionEvent event) {
    // do the common processing
    setupContentAction(event);
    // retrieve the id of the task
    UIActionLink link = (UIActionLink) event.getComponent();
    Map<String, String> params = link.getParameterMap();
    property.setWorkflowTaskId(params.get("taskId"));
    property.setWorkflowAction(true);
    if (logger.isDebugEnabled())
        logger.debug("Setup for workflow package action for task id: " + property.getWorkflowTaskId());
}
Also used : UIActionLink(org.alfresco.web.ui.common.component.UIActionLink)

Example 27 with UIActionLink

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

the class CheckinCheckoutDialog method setupContentAction.

// ------------------------------------------------------------------------------
// Navigation action event handlers
/**
 * Action event called by all actions that need to setup a Content Document context on the
 * CheckinCheckoutDialog before an action page/wizard is called. The context will be a Node in
 * setDocument() which can be retrieved on action pages via getDocument().
 *
 * @param event   ActionEvent
 */
public void setupContentAction(ActionEvent event) {
    UIActionLink link = (UIActionLink) event.getComponent();
    Map<String, String> params = link.getParameterMap();
    String id = params.get("id");
    if (id != null && id.length() != 0) {
        setupContentDocument(id);
    } else {
        property.setDocument(null);
    }
    resetState();
}
Also used : UIActionLink(org.alfresco.web.ui.common.component.UIActionLink)

Example 28 with UIActionLink

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

the class ManageTaskDialog method removePackageItem.

/**
 * Removes an item from the workflow package
 *
 * @param event The event containing a reference to the item to remove
 */
public void removePackageItem(ActionEvent event) {
    UIActionLink link = (UIActionLink) event.getComponent();
    Map<String, String> params = link.getParameterMap();
    String nodeRef = new NodeRef(Repository.getStoreRef(), params.get("id")).toString();
    if (this.packageItemsToAdd != null && this.packageItemsToAdd.contains(nodeRef)) {
        // remove the item from the added list if it was added in this
        // dialog session
        this.packageItemsToAdd.remove(nodeRef);
        if (LOGGER.isDebugEnabled())
            LOGGER.debug("Removed item from the added list: " + nodeRef);
    } else {
        // add the node to the list of items to remove
        if (this.packageItemsToRemove == null) {
            this.packageItemsToRemove = new ArrayList<String>(1);
        }
        this.packageItemsToRemove.add(nodeRef);
        if (LOGGER.isDebugEnabled())
            LOGGER.debug("Added item to the removed list: " + nodeRef);
    }
    // reset the rich list so it re-renders
    this.packageItemsRichList.setValue(null);
}
Also used : NodeRef(org.alfresco.service.cmr.repository.NodeRef) UIActionLink(org.alfresco.web.ui.common.component.UIActionLink)

Example 29 with UIActionLink

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

the class WorkflowBean method setupTaskDialog.

// ------------------------------------------------------------------------------
// Navigation handlers
public void setupTaskDialog(ActionEvent event) {
    UIActionLink link = (UIActionLink) event.getComponent();
    Map<String, String> params = link.getParameterMap();
    String id = params.get("id");
    String type = params.get("type");
    // setup the dispatch context with the task we're opening a dialog for
    TransientNode node = new TransientNode(QName.createQName(type), id, null);
    this.navigationBean.setupDispatchContext(node);
    // pass on parameters for the dialog
    Application.getDialogManager().setupParameters(event);
}
Also used : UIActionLink(org.alfresco.web.ui.common.component.UIActionLink) TransientNode(org.alfresco.web.bean.repository.TransientNode)

Example 30 with UIActionLink

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

the class EditOnlineDialog method handleCifsEditing.

/**
 * Action listener for handle cifs online editing action. E.g "edit_doc_online_cifs" action
 *
 * @param event ActionEvent
 */
public void handleCifsEditing(ActionEvent event) {
    handle(event);
    Node workingCopyNode = property.getDocument();
    if (workingCopyNode != null) {
        UIActionLink link = (UIActionLink) event.getComponent();
        Map<String, String> params = link.getParameterMap();
        String cifsPath = params.get("cifsPath");
        if (cifsPath != null) {
            // modify cifsPath for editing working copy
            property.setCifsPath(cifsPath.substring(0, cifsPath.lastIndexOf('\\') + 1) + workingCopyNode.getName());
        }
        FacesContext fc = FacesContext.getCurrentInstance();
        fc.getApplication().getNavigationHandler().handleNavigation(fc, null, "dialog:close:browse");
    }
}
Also used : FacesContext(javax.faces.context.FacesContext) UIActionLink(org.alfresco.web.ui.common.component.UIActionLink) Node(org.alfresco.web.bean.repository.Node)

Aggregations

UIActionLink (org.alfresco.web.ui.common.component.UIActionLink)56 NodeRef (org.alfresco.service.cmr.repository.NodeRef)31 Node (org.alfresco.web.bean.repository.Node)28 NodePropertyComparator (org.alfresco.web.ui.common.NodePropertyComparator)18 FacesContext (javax.faces.context.FacesContext)11 InvalidNodeRefException (org.alfresco.service.cmr.repository.InvalidNodeRefException)9 MapNode (org.alfresco.web.bean.repository.MapNode)7 AlfrescoRuntimeException (org.alfresco.error.AlfrescoRuntimeException)4 ArrayList (java.util.ArrayList)3 UserTransaction (javax.transaction.UserTransaction)3 UIComponent (javax.faces.component.UIComponent)2 RetryingTransactionHelper (org.alfresco.repo.transaction.RetryingTransactionHelper)2 RetryingTransactionCallback (org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback)2 ChildAssociationRef (org.alfresco.service.cmr.repository.ChildAssociationRef)2 Version (org.alfresco.service.cmr.version.Version)2 Writer (java.io.Writer)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1 ResourceBundle (java.util.ResourceBundle)1 FacesMessage (javax.faces.application.FacesMessage)1