mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
125781 rmunteanu: Merged 5.1.N (5.1.2) to 5.2.N (5.2.1) 125603 rmunteanu: Merged 5.1.1 (5.1.1) to 5.1.N (5.1.2) 125484 slanglois: MNT-16155 Update source headers - remove old Copyrights from Java and JSP dource files git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@127808 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
62 lines
1.8 KiB
Java
62 lines
1.8 KiB
Java
package org.alfresco.web.bean.content;
|
|
|
|
import java.io.File;
|
|
import java.util.Map;
|
|
|
|
import javax.faces.context.FacesContext;
|
|
|
|
import org.alfresco.model.ContentModel;
|
|
import org.alfresco.repo.content.MimetypeMap;
|
|
import org.alfresco.service.cmr.repository.ContentWriter;
|
|
import org.alfresco.service.cmr.repository.NodeRef;
|
|
import org.alfresco.web.bean.repository.Node;
|
|
|
|
/**
|
|
* Bean implementation for the "Edit Content Wizard" dialog
|
|
*/
|
|
public class EditContentWizard extends CreateContentWizard
|
|
{
|
|
private static final long serialVersionUID = 1640754719164511019L;
|
|
|
|
private NodeRef nodeRef;
|
|
|
|
// ------------------------------------------------------------------------------
|
|
// Wizard implementation
|
|
|
|
@Override
|
|
public void init(final Map<String, String> parameters)
|
|
{
|
|
super.init(parameters);
|
|
Node node = this.navigator.getDispatchContextNode();
|
|
if (node == null)
|
|
{
|
|
throw new IllegalArgumentException("Edit Form wizard requires action node context.");
|
|
}
|
|
this.nodeRef = node.getNodeRef();
|
|
|
|
this.content = this.getContentService().getReader(nodeRef, ContentModel.PROP_CONTENT).getContentString();
|
|
|
|
this.fileName = (String)getNodeService().getProperty(nodeRef, ContentModel.PROP_NAME); // getName() ...
|
|
this.mimeType = MimetypeMap.MIMETYPE_XML;
|
|
}
|
|
|
|
@Override
|
|
public String back()
|
|
{
|
|
return super.back();
|
|
}
|
|
|
|
@Override
|
|
protected void saveContent(File fileContent, String strContent) throws Exception
|
|
{
|
|
ContentWriter writer = getContentService().getWriter(nodeRef, ContentModel.PROP_CONTENT, true);
|
|
writer.putContent(strContent);
|
|
}
|
|
|
|
@Override
|
|
protected String doPostCommitProcessing(FacesContext context, String outcome)
|
|
{
|
|
return outcome;
|
|
}
|
|
}
|