1 package org.infoglue.deliver.taglib.content; 2 3 import java.util.HashMap ; 4 import java.util.Map ; 5 6 import javax.servlet.jsp.JspException ; 7 import javax.servlet.jsp.JspTagException ; 8 9 import org.infoglue.cms.security.InfoGluePrincipal; 10 11 14 15 public class DeleteDigitalAssetTag extends InfoGlueWebServiceTag 16 { 17 20 private static final long serialVersionUID = -1904980538720103871L; 21 22 25 private String operationName = "deleteDigitalAsset"; 26 27 30 31 private Map digitalAsset = new HashMap (); 32 33 private Integer contentVersionId; 34 private Integer languageId; 35 private Integer contentId; 36 private String assetKey; 37 38 41 private InfoGluePrincipal principal; 42 43 46 public DeleteDigitalAssetTag() 47 { 48 super(); 49 } 50 51 59 public int doStartTag() throws JspException 60 { 61 return EVAL_BODY_INCLUDE; 62 } 63 64 67 public int doEndTag() throws JspException 68 { 69 try 70 { 71 if(this.contentVersionId != null) 72 digitalAsset.put("contentVersionId", this.contentVersionId); 73 if(this.contentId != null) 74 digitalAsset.put("contentId", this.contentId); 75 if(this.languageId != null) 76 digitalAsset.put("languageId", this.languageId); 77 if(this.assetKey != null) 78 digitalAsset.put("assetKey", this.assetKey); 79 80 this.invokeOperation("digitalAsset", digitalAsset); 81 } 82 catch (Exception e) 83 { 84 e.printStackTrace(); 85 throw new JspTagException (e.getMessage()); 86 } 87 88 digitalAsset.clear(); 89 this.contentVersionId = null; 90 this.contentId = null; 91 this.languageId = null; 92 this.assetKey = null; 93 94 return EVAL_PAGE; 95 } 96 97 100 public void setOperationName(final String operationName) 101 { 102 this.operationName = operationName; 103 } 104 105 108 public void setPrincipal(final String principalString) throws JspException 109 { 110 this.principal = (InfoGluePrincipal) this.evaluate("remoteContentService", "principal", principalString, InfoGluePrincipal.class); 111 } 112 113 public void setContentVersionId(String contentVersionId) throws JspException 114 { 115 this.contentVersionId = evaluateInteger("deleteDigitalAsset", "contentVersionId", contentVersionId); 116 } 117 118 public void setContentId(String contentId) throws JspException 119 { 120 this.contentId = evaluateInteger("deleteDigitalAsset", "contentId", contentId); 121 } 122 123 public void setLanguageId(String languageId) throws JspException 124 { 125 this.languageId = evaluateInteger("deleteDigitalAsset", "languageId", languageId); 126 } 127 128 public void setAssetKey(String assetKey) throws JspException 129 { 130 this.assetKey = evaluateString("deleteDigitalAsset", "assetKey", assetKey); 131 } 132 133 134 public String getOperationName() 135 { 136 return this.operationName; 137 } 138 } | Popular Tags |