1 23 24 package org.infoglue.cms.applications.managementtool.actions; 25 26 import org.infoglue.cms.controllers.kernel.impl.simple.SiteNodeTypeDefinitionController; 27 import org.infoglue.cms.entities.management.SiteNodeTypeDefinitionVO; 28 import org.infoglue.cms.exception.ConstraintException; 29 import org.infoglue.cms.util.ConstraintExceptionBuffer; 30 31 32 37 public class UpdateSiteNodeTypeDefinitionAction extends ViewSiteNodeTypeDefinitionAction { 39 40 private SiteNodeTypeDefinitionVO siteNodeTypeDefinitionVO; 41 private Integer siteNodeTypeDefinitionId; 42 private String name; 43 private String description; 44 private String invokerClassName; 45 private ConstraintExceptionBuffer ceb; 46 47 public UpdateSiteNodeTypeDefinitionAction() 48 { 49 this(new SiteNodeTypeDefinitionVO()); 50 } 51 52 public UpdateSiteNodeTypeDefinitionAction(SiteNodeTypeDefinitionVO siteNodeTypeDefinitionVO) 53 { 54 this.siteNodeTypeDefinitionVO = siteNodeTypeDefinitionVO; 55 this.ceb = new ConstraintExceptionBuffer(); 56 } 57 58 public String doExecute() throws Exception 59 { 60 super.initialize(getSiteNodeTypeDefinitionId()); 61 62 ceb.add(this.siteNodeTypeDefinitionVO.validate()); 63 ceb.throwIfNotEmpty(); 64 65 String [] values = getRequest().getParameterValues("availableServiceBindingId"); 66 67 SiteNodeTypeDefinitionController.getController().update(this.siteNodeTypeDefinitionVO, values); 68 69 return "success"; 70 } 71 72 public String doSaveAndExit() throws Exception 73 { 74 doExecute(); 75 76 return "saveAndExit"; 77 } 78 79 public void setSiteNodeTypeDefinitionId(Integer siteNodeTypeDefinitionId) 80 { 81 this.siteNodeTypeDefinitionVO.setSiteNodeTypeDefinitionId(siteNodeTypeDefinitionId); 82 } 83 84 public java.lang.Integer getSiteNodeTypeDefinitionId() 85 { 86 return this.siteNodeTypeDefinitionVO.getSiteNodeTypeDefinitionId(); 87 } 88 89 public java.lang.String getName() 90 { 91 if(this.name != null) 92 return this.name; 93 94 return this.siteNodeTypeDefinitionVO.getName(); 95 } 96 97 public void setName(java.lang.String name) 98 { 99 try 100 { 101 this.siteNodeTypeDefinitionVO.setName(name); 102 } 103 catch(ConstraintException ce) 104 { 105 this.name = name; 106 this.ceb.add(new ConstraintExceptionBuffer(ce)); 107 } 108 } 109 110 public String getDescription() 111 { 112 if(this.description != null) 113 return this.description; 114 115 return this.siteNodeTypeDefinitionVO.getDescription(); 116 } 117 118 public void setDescription(String description) 119 { 120 try 121 { 122 this.siteNodeTypeDefinitionVO.setDescription(description); 123 } 124 catch(ConstraintException ce) 125 { 126 this.description = description; 127 this.ceb.add(new ConstraintExceptionBuffer(ce)); 128 } 129 } 130 131 public String getInvokerClassName() 132 { 133 if(this.invokerClassName != null) 134 return this.invokerClassName; 135 136 return this.siteNodeTypeDefinitionVO.getInvokerClassName(); 137 } 138 139 public void setInvokerClassName(String invokerClassName) 140 { 141 try 142 { 143 this.siteNodeTypeDefinitionVO.setInvokerClassName(invokerClassName); 144 } 145 catch(ConstraintException ce) 146 { 147 this.invokerClassName = invokerClassName; 148 this.ceb.add(new ConstraintExceptionBuffer(ce)); 149 } 150 } 151 } 152 | Popular Tags |