1 23 24 package org.infoglue.cms.applications.structuretool.actions; 25 26 import org.infoglue.cms.applications.common.actions.InfoGlueAbstractAction; 27 import org.infoglue.cms.controllers.kernel.impl.simple.SiteNodeControllerProxy; 28 import org.infoglue.cms.entities.structure.SiteNodeVO; 29 import org.infoglue.cms.util.ConstraintExceptionBuffer; 30 31 34 35 public class MoveSiteNodeAction extends InfoGlueAbstractAction 36 { 37 38 private Integer siteNodeId; 39 private Integer parentSiteNodeId; 40 private Integer newParentSiteNodeId; 41 private Integer repositoryId; 42 private Integer changeTypeId; 43 private ConstraintExceptionBuffer ceb; 44 private SiteNodeVO siteNodeVO; 45 46 47 public MoveSiteNodeAction() 48 { 49 this(new SiteNodeVO()); 50 } 51 52 public MoveSiteNodeAction(SiteNodeVO siteNodeVO) 53 { 54 this.siteNodeVO = siteNodeVO; 55 this.ceb = new ConstraintExceptionBuffer(); 56 } 57 58 public void setSiteNodeId(Integer siteNodeId) 59 { 60 this.siteNodeVO.setSiteNodeId(siteNodeId); 61 } 62 63 public void setNewParentSiteNodeId(Integer newParentSiteNodeId) 64 { 65 this.newParentSiteNodeId = newParentSiteNodeId; 66 } 67 68 public void setParentSiteNodeId(Integer parentSiteNodeId) 69 { 70 this.parentSiteNodeId = parentSiteNodeId; 71 } 72 73 public void setChangeTypeId(Integer changeTypeId) 74 { 75 this.changeTypeId = changeTypeId; 76 } 77 78 public Integer getParentSiteNodeId() 79 { 80 return this.parentSiteNodeId; 81 } 82 83 public Integer getRepositoryId() 84 { 85 return this.repositoryId; 86 } 87 88 public void setRepositoryId(Integer repositoryId) 89 { 90 this.repositoryId = repositoryId; 91 } 92 93 public Integer getSiteNodeId() 94 { 95 return siteNodeVO.getSiteNodeId(); 96 } 97 98 public Integer getNewParentSiteNodeId() 99 { 100 return this.newParentSiteNodeId; 101 } 102 103 public Integer getUnrefreshedSiteNodeId() 104 { 105 return this.newParentSiteNodeId; 106 } 107 108 public Integer getChangeTypeId() 109 { 110 return this.changeTypeId; 111 } 112 113 public String doExecute() throws Exception 114 { 115 ceb.throwIfNotEmpty(); 116 117 SiteNodeControllerProxy.getSiteNodeControllerProxy().acMoveSiteNode(this.getInfoGluePrincipal(), this.siteNodeVO, this.newParentSiteNodeId); 119 120 return "success"; 121 } 122 123 public String getErrorKey() 124 { 125 return "SiteNode.parentSiteNodeId"; 126 } 127 128 public String getReturnAddress() 129 { 130 return "ViewSiteNode.action?siteNodeId=" + this.siteNodeVO.getId() + "&repositoryId=" + this.repositoryId; 131 } 132 133 134 } 135 | Popular Tags |