1 23 24 package org.infoglue.cms.applications.contenttool.wizards.actions; 25 26 import java.util.Iterator ; 27 import java.util.List ; 28 29 import org.infoglue.cms.applications.databeans.AssetKeyDefinition; 30 import org.infoglue.cms.controllers.kernel.impl.simple.ContentTypeDefinitionController; 31 import org.infoglue.cms.controllers.kernel.impl.simple.LanguageController; 32 import org.infoglue.cms.entities.content.ContentVersionVO; 33 import org.infoglue.cms.entities.management.ContentTypeDefinitionVO; 34 import org.infoglue.cms.entities.management.LanguageVO; 35 import org.infoglue.cms.util.CmsPropertyHandler; 36 import org.infoglue.cms.util.ConstraintExceptionBuffer; 37 38 41 42 public class CreateContentWizardInputContentVersionsAction extends CreateContentWizardAbstractAction 43 { 44 private ContentTypeDefinitionVO contentTypeDefinitionVO = null; 45 private List contentTypeAttributes = null; 46 private String returnAddress = null; 47 private ConstraintExceptionBuffer ceb = new ConstraintExceptionBuffer(); 48 49 private String versionValue = null; 50 private Integer currentEditorId = null; 51 private Integer languageId = null; 52 private ContentVersionVO contentVersionVO = new ContentVersionVO(); 53 54 public CreateContentWizardInputContentVersionsAction() 55 { 56 } 57 58 59 65 66 public String doInput() throws Exception 67 { 68 CreateContentWizardInfoBean createContentWizardInfoBean = getCreateContentWizardInfoBean(); 69 70 Integer contentTypeDefinitionId = createContentWizardInfoBean.getContentTypeDefinitionId(); 71 this.contentTypeDefinitionVO = ContentTypeDefinitionController.getController().getContentTypeDefinitionVOWithId(contentTypeDefinitionId); 72 73 this.contentTypeDefinitionVO = ContentTypeDefinitionController.getController().validateAndUpdateContentType(this.contentTypeDefinitionVO); 74 List assetKeys = ContentTypeDefinitionController.getController().getDefinedAssetKeys(this.contentTypeDefinitionVO.getSchemaValue()); 75 76 LanguageVO masterLanguageVO = LanguageController.getController().getMasterLanguage(createContentWizardInfoBean.getRepositoryId()); 77 if(this.languageId == null) 78 this.languageId = masterLanguageVO.getLanguageId(); 79 80 90 91 this.contentTypeAttributes = ContentTypeDefinitionController.getController().getContentTypeAttributes(this.contentTypeDefinitionVO.getSchemaValue()); 92 93 String wysiwygEditor = CmsPropertyHandler.getWysiwygEditor(); 94 if(wysiwygEditor == null || wysiwygEditor.equalsIgnoreCase("") || wysiwygEditor.equalsIgnoreCase("HTMLArea")) 95 return "inputContentVersions"; 96 else 97 return "inputContentVersionsForFCKEditor"; 98 } 99 100 106 107 public String doExecute() throws Exception 108 { 109 CreateContentWizardInfoBean createContentWizardInfoBean = getCreateContentWizardInfoBean(); 110 111 this.contentVersionVO.setVersionModifier(this.getInfoGluePrincipal().getName()); 112 113 createContentWizardInfoBean.getContentVersions().put(languageId, this.contentVersionVO); 114 115 118 120 123 125 return "success"; 126 } 127 128 public List getContentTypeAttributes() 129 { 130 return this.contentTypeAttributes; 131 } 132 133 public ContentTypeDefinitionVO getContentTypeDefinitionVO() 134 { 135 return this.contentTypeDefinitionVO; 136 } 137 138 public Integer getCurrentEditorId() 139 { 140 return this.currentEditorId; 141 } 142 143 public Integer getLanguageId() 144 { 145 return this.languageId; 146 } 147 148 public void setCurrentEditorId(Integer currentEditorId) 149 { 150 this.currentEditorId = currentEditorId; 151 } 152 153 public void setLanguageId(Integer languageId) 154 { 155 this.languageId = languageId; 156 this.contentVersionVO.setLanguageId(languageId); 157 } 158 159 public void setVersionValue(String versionValue) 160 { 161 this.contentVersionVO.setVersionValue(versionValue); 162 } 163 164 } 165 | Popular Tags |