1 23 24 package org.infoglue.cms.applications.managementtool.actions; 25 26 import org.infoglue.cms.applications.common.actions.InfoGlueAbstractAction; 27 import org.infoglue.cms.controllers.kernel.impl.simple.AvailableServiceBindingController; 28 import org.infoglue.cms.entities.management.AvailableServiceBindingVO; 29 import org.infoglue.cms.exception.ConstraintException; 30 import org.infoglue.cms.util.ConstraintExceptionBuffer; 31 32 public class CreateAvailableServiceBindingAction extends InfoGlueAbstractAction 33 { 34 private static final long serialVersionUID = 1L; 35 36 private AvailableServiceBindingVO availableServiceBindingVO; 37 private ConstraintExceptionBuffer ceb; 38 private String name; 39 private String description; 40 private String visualizationAction; 41 private Boolean isMandatory; 42 private Boolean isUserEditable; 43 private Boolean isInheritable; 44 45 46 public CreateAvailableServiceBindingAction() 47 { 48 this(new AvailableServiceBindingVO()); 49 } 50 51 public CreateAvailableServiceBindingAction(AvailableServiceBindingVO availableServiceBindingVO) 52 { 53 this.availableServiceBindingVO = availableServiceBindingVO; 54 this.ceb = new ConstraintExceptionBuffer(); 55 56 } 57 public Integer getAvailableServiceBindingId() 58 { 59 return this.availableServiceBindingVO.getAvailableServiceBindingId(); 60 } 61 public java.lang.String getName() 62 { 63 if(this.name != null) 64 return this.name; 65 66 return this.availableServiceBindingVO.getName(); 67 } 68 69 public void setName(java.lang.String name) 70 { 71 try 72 { 73 this.availableServiceBindingVO.setName(name); 74 } 75 catch(ConstraintException ce) 76 { 77 this.name = name; 78 this.ceb.add(new ConstraintExceptionBuffer(ce)); 79 } 80 } 81 82 83 public String getDescription() 84 { 85 if(this.description != null) 86 return this.description; 87 88 return this.availableServiceBindingVO.getDescription(); 89 } 90 91 public void setDescription(String description) 92 { 93 try 94 { 95 this.availableServiceBindingVO.setDescription(description); 96 } 97 catch(ConstraintException ce) 98 { 99 this.description = description; 100 this.ceb.add(new ConstraintExceptionBuffer(ce)); 101 } 102 } 103 104 public String getVisualizationAction() 105 { 106 if(this.visualizationAction != null) 107 return this.visualizationAction; 108 109 return this.availableServiceBindingVO.getVisualizationAction(); 110 } 111 112 public void setVisualizationAction(String visualizationAction) 113 { 114 try 115 { 116 this.availableServiceBindingVO.setVisualizationAction(visualizationAction); 117 } 118 catch(ConstraintException ce) 119 { 120 this.visualizationAction = visualizationAction; 121 this.ceb.add(new ConstraintExceptionBuffer(ce)); 122 } 123 } 124 125 126 public Boolean getIsMandatory() 127 { 128 if(this.isMandatory != null) 129 return this.isMandatory; 130 131 return this.availableServiceBindingVO.getIsMandatory(); 132 } 133 134 public void setIsMandatory(Boolean isMandatory) 135 { 136 try 137 { 138 this.availableServiceBindingVO.setIsMandatory(isMandatory); 139 } 140 catch(ConstraintException ce) 141 { 142 this.isMandatory = isMandatory; 143 this.ceb.add(new ConstraintExceptionBuffer(ce)); 144 } 145 } 146 147 148 public Boolean getIsUserEditable() 149 { 150 if(this.isUserEditable != null) 151 return this.isUserEditable; 152 153 return this.availableServiceBindingVO.getIsUserEditable(); 154 } 155 156 public void setIsUserEditable(Boolean isUserEditable) 157 { 158 try 159 { 160 this.availableServiceBindingVO.setIsUserEditable(isUserEditable); 161 } 162 catch(ConstraintException ce) 163 { 164 this.isUserEditable = isUserEditable; 165 this.ceb.add(new ConstraintExceptionBuffer(ce)); 166 } 167 } 168 169 public Boolean getIsInheritable() 170 { 171 if(this.isInheritable != null) 172 return this.isInheritable; 173 174 return this.availableServiceBindingVO.getIsInheritable(); 175 } 176 177 public void setIsInheritable(Boolean isInheritable) 178 { 179 try 180 { 181 this.availableServiceBindingVO.setIsInheritable(isInheritable); 182 } 183 catch(ConstraintException ce) 184 { 185 this.isUserEditable = isInheritable; 186 this.ceb.add(new ConstraintExceptionBuffer(ce)); 187 } 188 } 189 190 191 public String doExecute() throws Exception 192 { 193 ceb.add(this.availableServiceBindingVO.validate()); 194 ceb.throwIfNotEmpty(); 195 196 this.availableServiceBindingVO = AvailableServiceBindingController.getController().create(this.availableServiceBindingVO); 197 return "success"; 198 } 199 200 public String doInput() throws Exception 201 { 202 return "input"; 203 } 204 } 205 | Popular Tags |