1 23 24 package org.infoglue.cms.applications.contenttool.actions; 25 26 import org.infoglue.cms.applications.common.actions.InfoGlueAbstractAction; 27 import org.infoglue.cms.controllers.kernel.impl.simple.ContentControllerProxy; 28 import org.infoglue.cms.entities.content.ContentVO; 29 import org.infoglue.cms.util.ConstraintExceptionBuffer; 30 31 34 35 public class MoveContentAction extends InfoGlueAbstractAction 36 { 37 private static final long serialVersionUID = 1L; 38 39 private Integer contentId; 40 private Integer parentContentId; 41 private Integer newParentContentId; 42 private Integer changeTypeId; 43 private Integer repositoryId; 44 private ConstraintExceptionBuffer ceb; 45 private ContentVO contentVO; 46 47 48 public MoveContentAction() 49 { 50 this(new ContentVO()); 51 } 52 53 public MoveContentAction(ContentVO contentVO) 54 { 55 this.contentVO = contentVO; 56 this.ceb = new ConstraintExceptionBuffer(); 57 } 58 59 public void setContentId(Integer contentId) 60 { 61 this.contentVO.setContentId(contentId); 62 } 63 64 public void setNewParentContentId(Integer newParentContentId) 65 { 66 this.newParentContentId = newParentContentId; 67 } 68 69 public void setParentContentId(Integer parentContentId) 70 { 71 this.parentContentId = parentContentId; 72 } 73 74 public void setChangeTypeId(Integer changeTypeId) 75 { 76 this.changeTypeId = changeTypeId; 77 } 78 79 public void setRepositoryId(Integer repositoryId) 80 { 81 this.repositoryId = repositoryId; 82 } 83 84 public Integer getRepositoryId() 85 { 86 return this.repositoryId; 87 } 88 89 public Integer getParentContentId() 90 { 91 return this.parentContentId; 92 } 93 94 public Integer getContentId() 95 { 96 return contentVO.getContentId(); 97 } 98 99 public Integer getNewParentContentId() 100 { 101 return this.newParentContentId; 102 } 103 104 public Integer getUnrefreshedContentId() 105 { 106 return this.newParentContentId; 107 } 108 109 public Integer getChangeTypeId() 110 { 111 return this.changeTypeId; 112 } 113 114 public String doExecute() throws Exception 115 { 116 ceb.throwIfNotEmpty(); 117 118 ContentControllerProxy.getController().acMoveContent(this.getInfoGluePrincipal(), this.contentVO, this.newParentContentId); 120 121 return "success"; 122 } 123 124 125 public String getErrorKey() 126 { 127 return "Content.parentContentId"; 128 } 129 130 public String getReturnAddress() 131 { 132 return "ViewContent.action?contentId=" + this.contentVO.getId() + "&repositoryId=" + this.repositoryId; 133 } 134 } 135 | Popular Tags |