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 DeleteContentVersionTag extends InfoGlueWebServiceTag 16 { 17 20 private static final long serialVersionUID = -1904980538720103871L; 21 22 25 private String operationName = "deleteContentVersion"; 26 27 30 31 private Map contentVersion = new HashMap (); 32 33 private Integer contentVersionId; 34 35 38 private InfoGluePrincipal principal; 39 40 43 public DeleteContentVersionTag() 44 { 45 super(); 46 } 47 48 56 public int doStartTag() throws JspException 57 { 58 return EVAL_BODY_INCLUDE; 59 } 60 61 64 public int doEndTag() throws JspException 65 { 66 try 67 { 68 if(this.contentVersionId != null) 69 contentVersion.put("contentVersionId", this.contentVersionId); 70 71 this.invokeOperation("contentVersion", contentVersion); 72 } 73 catch (Exception e) 74 { 75 e.printStackTrace(); 76 throw new JspTagException (e.getMessage()); 77 } 78 79 contentVersion.clear(); 80 this.contentVersionId = null; 81 82 return EVAL_PAGE; 83 } 84 85 88 public void setOperationName(final String operationName) 89 { 90 this.operationName = operationName; 91 } 92 93 96 public void setPrincipal(final String principalString) throws JspException 97 { 98 this.principal = (InfoGluePrincipal) this.evaluate("remoteContentService", "principal", principalString, InfoGluePrincipal.class); 99 } 100 101 public void setContentVersionId(String contentVersionId) throws JspException 102 { 103 this.contentVersionId = evaluateInteger("deleteContentVersion", "contentVersionId", contentVersionId); 104 } 105 106 public String getOperationName() 107 { 108 return this.operationName; 109 } 110 } | Popular Tags |