1 23 24 package org.infoglue.cms.applications.structuretool.actions; 25 26 import java.util.ArrayList ; 27 import java.util.List ; 28 29 import org.apache.log4j.Logger; 30 import org.infoglue.cms.applications.common.actions.InfoGlueAbstractAction; 31 import org.infoglue.cms.controllers.kernel.impl.simple.AccessRightController; 32 import org.infoglue.cms.controllers.kernel.impl.simple.SiteNodeVersionController; 33 import org.infoglue.cms.controllers.kernel.impl.simple.SiteNodeVersionControllerProxy; 34 import org.infoglue.cms.entities.structure.SiteNodeVersionVO; 35 import org.infoglue.cms.exception.AccessConstraintException; 36 import org.infoglue.cms.util.AccessConstraintExceptionBuffer; 37 38 46 47 public class ViewListSiteNodeVersionAction extends InfoGlueAbstractAction 48 { 49 private final static Logger logger = Logger.getLogger(ViewListSiteNodeVersionAction.class.getName()); 50 51 private static final long serialVersionUID = 1L; 52 53 private List siteNodeVersionVOList = new ArrayList (); 54 private List contentVersionVOList = new ArrayList (); 55 private Integer siteNodeVersionId; 56 private Integer siteNodeId; 57 private Integer repositoryId; 58 private String returnAddress; 59 60 61 protected String doExecute() throws Exception 62 { 63 logger.info("siteNodeId:" + this.siteNodeId); 64 logger.info("siteNodeVersionId:" + this.siteNodeVersionId); 65 if(this.siteNodeVersionId == null) 66 { 67 SiteNodeVersionVO siteNodeVersionVO = SiteNodeVersionControllerProxy.getSiteNodeVersionControllerProxy().getACLatestActiveSiteNodeVersionVO(this.getInfoGluePrincipal(), siteNodeId); 68 if(siteNodeVersionVO != null) 69 this.siteNodeVersionId = siteNodeVersionVO.getId(); 70 } 71 72 if(this.siteNodeVersionId != null) 73 { 74 AccessConstraintExceptionBuffer ceb = new AccessConstraintExceptionBuffer(); 75 76 Integer protectedSiteNodeVersionId = SiteNodeVersionControllerProxy.getSiteNodeVersionControllerProxy().getProtectedSiteNodeVersionId(siteNodeVersionId); 77 if(protectedSiteNodeVersionId != null && !AccessRightController.getController().getIsPrincipalAuthorized(this.getInfoGluePrincipal(), "SiteNodeVersion.SubmitToPublish", protectedSiteNodeVersionId.toString())) 78 ceb.add(new AccessConstraintException("SiteNodeVersion.siteNodeVersionId", "1005")); 79 80 ceb.throwIfNotEmpty(); 81 82 SiteNodeVersionController.getController().getSiteNodeAndAffectedItemsRecursive(this.siteNodeId, SiteNodeVersionVO.WORKING_STATE, this.siteNodeVersionVOList, this.contentVersionVOList, false); 83 } 84 85 return "success"; 86 } 87 88 89 public List getSiteNodeVersions() 90 { 91 return this.siteNodeVersionVOList; 92 } 93 94 95 public Integer getSiteNodeId() 96 { 97 return siteNodeId; 98 } 99 100 public void setSiteNodeId(Integer siteNodeId) 101 { 102 this.siteNodeId = siteNodeId; 103 } 104 105 public Integer getSiteNodeVersionId() 106 { 107 return siteNodeVersionId; 108 } 109 110 public void setSiteNodeVersionId(Integer siteNodeVersionId) 111 { 112 this.siteNodeVersionId = siteNodeVersionId; 113 } 114 115 public Integer getRepositoryId() 116 { 117 return repositoryId; 118 } 119 120 public void setRepositoryId(Integer repositoryId) 121 { 122 this.repositoryId = repositoryId; 123 } 124 125 public List getContentVersionVOList() 126 { 127 return contentVersionVOList; 128 } 129 130 public List getSiteNodeVersionVOList() 131 { 132 return siteNodeVersionVOList; 133 } 134 135 136 public String getReturnAddress() { 137 return returnAddress; 138 } 139 140 141 public void setReturnAddress(String returnAddress) { 142 this.returnAddress = returnAddress; 143 } 144 } 145 | Popular Tags |