1 23 package org.infoglue.cms.applications.workflowtool.function; 24 25 import org.infoglue.cms.controllers.kernel.impl.simple.ContentController; 26 import org.infoglue.cms.entities.content.ContentVO; 27 28 import com.opensymphony.workflow.WorkflowException; 29 30 34 public class ContentMover extends ContentFunction 35 { 36 39 public static final String DESTINATION_PARAMETER = "move_newParentFolder"; 40 41 44 private ContentVO destinationContentVO; 45 46 49 public ContentMover() 50 { 51 super(); 52 } 53 54 57 protected void execute() throws WorkflowException 58 { 59 if(getContentVO() != null) 60 { 61 try 62 { 63 if(!getContentVO().getParentContentId().equals(destinationContentVO.getContentId())) 64 { 65 ContentController.getContentController().moveContent(getContentVO(), destinationContentVO.getId(), getDatabase()); 66 } 67 } 68 catch(Exception e) 69 { 70 throwException(e); 71 } 72 } 73 } 74 75 81 protected void initialize() throws WorkflowException 82 { 83 super.initialize(); 84 this.destinationContentVO = (ContentVO) getParameter(DESTINATION_PARAMETER, (getContentVO() != null)); 85 } 86 } 87 | Popular Tags |