Search in sources :

Example 1 with MultilingualManageDialog

use of org.alfresco.web.bean.ml.MultilingualManageDialog in project acs-community-packaging by Alfresco.

the class BrowseBean method setupMLContainerContentAction.

/**
 * Action event called by all actions that need to setup a <b>Multilingual</b> Content Document context on the
 * BrowseBean before an action page/wizard is called. The context will be a Node in
 * setDocument() which can be retrieved on the action page from BrowseBean.getDocument().
 */
public void setupMLContainerContentAction(ActionEvent event) {
    UIActionLink link = (UIActionLink) event.getComponent();
    Map<String, String> params = link.getParameterMap();
    String id = params.get("id");
    NodeRef translation = new NodeRef(Repository.getStoreRef(), id);
    // remember the bean from which the action comes
    FacesContext fc = FacesContext.getCurrentInstance();
    DocumentDetailsDialog docDetails = (DocumentDetailsDialog) FacesHelper.getManagedBean(fc, "DocumentDetailsDialog");
    docDetails.setTranslationDocument(new MapNode(translation));
    MultilingualManageDialog mmDialog = (MultilingualManageDialog) FacesHelper.getManagedBean(fc, "MultilingualManageDialog");
    mmDialog.setTranslationDocument(docDetails.getTranslationDocument());
    // set the ml container as the current document
    NodeRef mlContainer = getMultilingualContentService().getTranslationContainer(translation);
    setupContentAction(mlContainer.getId(), true);
}
Also used : NodeRef(org.alfresco.service.cmr.repository.NodeRef) FacesContext(javax.faces.context.FacesContext) MultilingualManageDialog(org.alfresco.web.bean.ml.MultilingualManageDialog) UIActionLink(org.alfresco.web.ui.common.component.UIActionLink) DocumentDetailsDialog(org.alfresco.web.bean.content.DocumentDetailsDialog) MapNode(org.alfresco.web.bean.repository.MapNode)

Aggregations

FacesContext (javax.faces.context.FacesContext)1 NodeRef (org.alfresco.service.cmr.repository.NodeRef)1 DocumentDetailsDialog (org.alfresco.web.bean.content.DocumentDetailsDialog)1 MultilingualManageDialog (org.alfresco.web.bean.ml.MultilingualManageDialog)1 MapNode (org.alfresco.web.bean.repository.MapNode)1 UIActionLink (org.alfresco.web.ui.common.component.UIActionLink)1