1 23 24 package org.infoglue.cms.applications.managementtool.actions; 25 26 import org.infoglue.cms.controllers.kernel.impl.simple.RepositoryController; 27 import org.infoglue.cms.entities.management.RepositoryVO; 28 import org.infoglue.cms.util.ConstraintExceptionBuffer; 29 30 31 36 public class UpdateRepositoryAction extends ViewRepositoryAction { 38 39 private RepositoryVO repositoryVO; 40 private Integer repositoryId; 41 private String userAction = ""; 42 private ConstraintExceptionBuffer ceb; 43 44 public UpdateRepositoryAction() 45 { 46 this(new RepositoryVO()); 47 } 48 49 public UpdateRepositoryAction(RepositoryVO repositoryVO) 50 { 51 this.repositoryVO = repositoryVO; 52 this.ceb = new ConstraintExceptionBuffer(); 53 } 54 55 56 public String doExecute() throws Exception 57 { 58 super.initialize(getRepositoryId()); 59 60 ceb.add(this.repositoryVO.validate()); 61 ceb.throwIfNotEmpty(); 62 63 String [] values = getRequest().getParameterValues("languageId"); 64 65 RepositoryController.getController().update(this.repositoryVO, values); 66 67 return "success"; 68 } 69 70 public String doLocal() throws Exception 71 { 72 super.initialize(getRepositoryId()); 73 74 ceb.throwIfNotEmpty(); 75 76 RepositoryController.getController().update(this.repositoryVO); 77 78 return "successLocal"; 79 } 80 81 public String doSaveAndExit() throws Exception 82 { 83 doExecute(); 84 85 return "saveAndExit"; 86 } 87 88 public String doSaveAndExitLocal() throws Exception 89 { 90 doLocal(); 91 92 return "saveAndExitLocal"; 93 } 94 95 public void setRepositoryId(Integer repositoryId) throws Exception 96 { 97 this.repositoryVO.setRepositoryId(repositoryId); 98 } 99 100 public java.lang.Integer getRepositoryId() 101 { 102 return this.repositoryVO.getRepositoryId(); 103 } 104 105 public java.lang.String getName() 106 { 107 return this.repositoryVO.getName(); 108 } 109 110 public void setName(java.lang.String name) 111 { 112 this.repositoryVO.setName(name); 113 } 114 115 public String getDescription() 116 { 117 return this.repositoryVO.getDescription(); 118 } 119 120 public void setDescription(String description) 121 { 122 this.repositoryVO.setDescription(description); 123 } 124 125 public String getDnsName() 126 { 127 return this.repositoryVO.getDnsName(); 128 } 129 130 public void setDnsName(String dnsName) 131 { 132 this.repositoryVO.setDnsName(dnsName); 133 } 134 135 } 136 | Popular Tags |