Search in sources :

Example 1 with TransientNode

use of org.alfresco.web.bean.repository.TransientNode in project acs-community-packaging by Alfresco.

the class WorkflowBean method setupTaskDialog.

public void setupTaskDialog(String id, String type) {
    ParameterCheck.mandatoryString("Task ID", id);
    ParameterCheck.mandatoryString("Task Type", 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
    Map<String, String> params = new HashMap<String, String>(2, 1.0f);
    params.put("id", id);
    params.put("type", type);
    Application.getDialogManager().setupParameters(params);
}
Also used : HashMap(java.util.HashMap) TransientNode(org.alfresco.web.bean.repository.TransientNode)

Example 2 with TransientNode

use of org.alfresco.web.bean.repository.TransientNode 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 3 with TransientNode

use of org.alfresco.web.bean.repository.TransientNode in project acs-community-packaging by Alfresco.

the class ManageTaskDialog method init.

// ------------------------------------------------------------------------------
// Dialog implementation
@Override
public void init(Map<String, String> parameters) {
    super.init(parameters);
    // reset variables
    this.task = null;
    this.taskNode = null;
    this.workflowInstance = null;
    this.transitions = null;
    this.workflowPackage = null;
    this.resources = null;
    this.itemsToAdd = null;
    this.packageItemsToAdd = null;
    this.packageItemsToRemove = null;
    this.isItemBeingAdded = false;
    if (this.packageItemsRichList != null) {
        this.packageItemsRichList.setValue(null);
        this.packageItemsRichList = null;
    }
    // get the task details
    String taskId = this.parameters.get("id");
    this.task = this.getWorkflowService().getTaskById(taskId);
    if (this.task != null) {
        // setup a transient node to represent the task we're managing
        WorkflowTaskDefinition taskDef = this.task.definition;
        this.taskNode = new TransientNode(taskDef.metadata.getName(), "task_" + System.currentTimeMillis(), this.task.properties);
        // get access to the workflow instance for the task
        this.workflowInstance = this.task.path.instance;
        // setup the workflow package for the task
        this.workflowPackage = (NodeRef) this.task.properties.get(WorkflowModel.ASSOC_PACKAGE);
        if (LOGGER.isDebugEnabled()) {
            LOGGER.debug("Task: " + this.task);
            LOGGER.debug("Trasient node: " + this.taskNode);
            Boolean isSystemPackage = (Boolean) this.getNodeService().getProperty(this.workflowPackage, WorkflowModel.PROP_IS_SYSTEM_PACKAGE);
            LOGGER.debug("Workflow package: " + this.workflowPackage + " system package: " + isSystemPackage);
        }
    }
}
Also used : TransientNode(org.alfresco.web.bean.repository.TransientNode) WorkflowTaskDefinition(org.alfresco.service.cmr.workflow.WorkflowTaskDefinition)

Aggregations

TransientNode (org.alfresco.web.bean.repository.TransientNode)3 HashMap (java.util.HashMap)1 WorkflowTaskDefinition (org.alfresco.service.cmr.workflow.WorkflowTaskDefinition)1 UIActionLink (org.alfresco.web.ui.common.component.UIActionLink)1