1 23 24 package org.infoglue.cms.applications.contenttool.actions; 25 26 import java.util.List ; 27 28 import org.infoglue.cms.applications.common.actions.InfoGlueAbstractAction; 29 import org.infoglue.cms.controllers.kernel.impl.simple.ComponentPropertyDefinitionController; 30 import org.infoglue.cms.controllers.kernel.impl.simple.ContentTypeDefinitionController; 31 import org.infoglue.cms.controllers.kernel.impl.simple.ContentVersionController; 32 import org.infoglue.cms.entities.management.ContentTypeDefinitionVO; 33 34 35 38 39 public class ViewComponentPropertiesEditorAction extends InfoGlueAbstractAction 40 { 41 private static final long serialVersionUID = 1L; 42 43 private Integer contentVersionId; 44 private Integer contentId; 45 private String attributeName; 46 private String propertiesXML; 47 private List componentPropertyDefinitions; 48 private List contentTypeDefinitions; 49 50 private String closeOnLoad = "false"; 51 52 private void initialize() throws Exception 53 { 54 this.contentId = ContentVersionController.getContentVersionController().getContentVersionVOWithId(this.contentVersionId).getContentId(); 55 String componentPropertiesXML = ContentVersionController.getContentVersionController().getAttributeValue(contentVersionId, attributeName, false); 56 this.componentPropertyDefinitions = ComponentPropertyDefinitionController.getController().parseComponentPropertyDefinitions(componentPropertiesXML); 57 this.contentTypeDefinitions = ContentTypeDefinitionController.getController().getContentTypeDefinitionVOList(ContentTypeDefinitionVO.CONTENT); 58 } 59 60 public String doExecute() throws Exception 61 { 62 initialize(); 63 64 return SUCCESS; 65 } 66 67 public String doUpdate() throws Exception 68 { 69 ContentVersionController.getContentVersionController().updateAttributeValue(this.contentVersionId, this.attributeName, this.propertiesXML, this.getInfoGluePrincipal()); 70 71 return "update"; 72 } 73 74 75 public String getAttributeName() 76 { 77 return attributeName; 78 } 79 80 public void setAttributeName(String attributeName) 81 { 82 this.attributeName = attributeName; 83 } 84 85 public Integer getContentVersionId() 86 { 87 return contentVersionId; 88 } 89 90 public void setContentVersionId(Integer contentVersionId) 91 { 92 this.contentVersionId = contentVersionId; 93 } 94 95 public List getComponentPropertyDefinitions() 96 { 97 return componentPropertyDefinitions; 98 } 99 100 public void setPropertiesXML(String propertiesXML) 101 { 102 this.propertiesXML = propertiesXML; 103 } 104 105 public List getContentTypeDefinitions() 106 { 107 return contentTypeDefinitions; 108 } 109 110 public Integer getContentId() 111 { 112 return contentId; 113 } 114 115 public void setContentId(Integer contentId) 116 { 117 this.contentId = contentId; 118 } 119 120 public String getCloseOnLoad() 121 { 122 return closeOnLoad; 123 } 124 125 public void setCloseOnLoad(String closeOnLoad) 126 { 127 this.closeOnLoad = closeOnLoad; 128 } 129 130 } 131 | Popular Tags |