Update of /var/cvs/applications/taglib/src/org/mmbase/bridge/jsp/taglib
In directory james.mmbase.org:/tmp/cvs-serv3514

Modified Files:
        ImageTag.java mmbase-taglib.xml 
Log Message:
  MMB-1750. Made some method protected (no reason for them not to)


See also: 
http://cvs.mmbase.org/viewcvs/applications/taglib/src/org/mmbase/bridge/jsp/taglib
See also: http://www.mmbase.org/jira/browse/MMB-1750


Index: ImageTag.java
===================================================================
RCS file: 
/var/cvs/applications/taglib/src/org/mmbase/bridge/jsp/taglib/ImageTag.java,v
retrieving revision 1.80
retrieving revision 1.81
diff -u -b -r1.80 -r1.81
--- ImageTag.java       5 Dec 2008 13:59:27 -0000       1.80
+++ ImageTag.java       9 Dec 2008 15:30:58 -0000       1.81
@@ -31,7 +31,7 @@
  * sensitive for future changes in how the image servlet works.
  *
  * @author Michiel Meeuwissen
- * @version $Id: ImageTag.java,v 1.80 2008/12/05 13:59:27 michiel Exp $
+ * @version $Id: ImageTag.java,v 1.81 2008/12/09 15:30:58 michiel Exp $
  */
 
 public class ImageTag extends FieldTag {
@@ -66,6 +66,7 @@
     private Attribute altAttribute = Attribute.NULL;
 
     private Attribute absolute     = Attribute.NULL;
+    private Attribute disposition  = Attribute.NULL;
 
 
     private Object prevDimension;
@@ -134,6 +135,13 @@
         absolute = getAttribute(a, true);
     }
 
+    /**
+     * @since MMBase-1.9.1
+     */
+    public void setDisposition(String d) throws JspTagException {
+        disposition = getAttribute(d, true);
+    }
+
     private int getMode() throws JspTagException {
         String m = mode.getString(this).toLowerCase();
         if (m.length() == 0 || m.equals("url")) {
@@ -255,11 +263,11 @@
         return servletArgument;
     }
 
-    public String getServletPath(Node node, String servletArgument) throws 
JspTagException {
+    protected String getServletPath(Node node, String servletArgument) throws 
JspTagException {
         Function servletPathFunction = getServletFunction(node);
         Parameters args = getServletArguments(servletArgument, 
servletPathFunction);
         fillStandardParameters(args);
-        String url = servletPathFunction.getFunctionValue( args).toString();
+        String url = servletPathFunction.getFunctionValue(args).toString();
         if (absolute != Attribute.NULL) {
             String a = absolute.getString(this);
             HttpServletRequest req = (HttpServletRequest) 
getPageContext().getRequest();
@@ -285,20 +293,23 @@
         return url;
     }
 
-    public Function getServletFunction(Node node) {
+    protected Function getServletFunction(Node node) {
         Function servletPathFunction = node.getFunction("servletpath");
         return servletPathFunction;
     }
 
-    public Parameters getServletArguments(String servletArgument, Function 
servletPathFunction) {
+    protected Parameters getServletArguments(String servletArgument, Function 
servletPathFunction) throws JspTagException {
         HttpServletRequest req = (HttpServletRequest) pageContext.getRequest();
         Parameters args = servletPathFunction.createParameters();
         args.set("context",  makeRelative() ? UriParser.makeRelative(new 
File(req.getServletPath()).getParent(), "/") : req.getContextPath())
             .set("argument", servletArgument);
+        if (disposition != Attribute.NULL) {
+            args.set("disposition", disposition.getString(this));
+        }
         return args;
     }
 
-    public String getOutputValue(int mode, Node node, String servletPath, 
Dimension dim) throws JspTagException {
+    protected String getOutputValue(int mode, Node node, String servletPath, 
Dimension dim) throws JspTagException {
         String outputValue = null;
         switch(mode) {
         case MODE_URL:
@@ -327,15 +338,15 @@
         return outputValue;
     }
 
-    public String getSrcAttribute(String url) throws JspTagException {
+    protected String getSrcAttribute(String url) throws JspTagException {
         return " src=\"" + url + "\"";
     }
 
-    public String getBaseAttributes(String url, Dimension dim) throws 
JspTagException {
+    protected String getBaseAttributes(String url, Dimension dim) throws 
JspTagException {
         return getSrcAttribute(url) + " height=\"" + dim.getHeight() + "\" 
width=\"" + dim.getWidth() + "\"";
     }
 
-    public String getAltAttribute(Node node) throws JspTagException {
+    protected String getAltAttribute(Node node) throws JspTagException {
         String alt = null;
         if (altAttribute != Attribute.NULL) {
             alt = altAttribute.getString(this);
@@ -368,7 +379,7 @@
         return attributes.toString();
     }
 
-    public Dimension getDimension(Node node, String template) {
+    protected Dimension getDimension(Node node, String template) {
         return new LazyDimension(node, template);
     }
 
@@ -381,7 +392,7 @@
      * @param cropTemplate - crop the image. values are 'begin', 'middle' and 
'end'.
      * @return template for image
      */
-    public String getTemplate(Node node, String t, int widthTemplate, int 
heightTemplate, String cropTemplate) {
+    protected String getTemplate(Node node, String t, int widthTemplate, int 
heightTemplate, String cropTemplate) {
         if (t == null || t.length() == 0) {
             if ((widthTemplate <= 0) && (heightTemplate <= 0)) {
                 t = "";
@@ -411,7 +422,7 @@
      * @param height - template height
      * @return the crop template
      */
-    public String getCropTemplate(Node node, int width, int height, String 
cropTemplate) {
+    protected String getCropTemplate(Node node, int width, int height, String 
cropTemplate) {
         Dimension imageDimension = getDimension(node, null);
         int imageWidth = imageDimension.getWidth();
         int imageHeight = imageDimension.getHeight();
@@ -474,7 +485,7 @@
      * @param height - template height
      * @return the resize template
      */
-    public String getResizeTemplate(Node node, int width, int height) {
+    protected String getResizeTemplate(Node node, int width, int height) {
         Dimension imageDimension = getDimension(node, null);
         int imageWidth = imageDimension.getWidth();
         int imageHeight = imageDimension.getHeight();


Index: mmbase-taglib.xml
===================================================================
RCS file: 
/var/cvs/applications/taglib/src/org/mmbase/bridge/jsp/taglib/mmbase-taglib.xml,v
retrieving revision 1.446
retrieving revision 1.447
diff -u -b -r1.446 -r1.447
--- mmbase-taglib.xml   9 Dec 2008 14:29:11 -0000       1.446
+++ mmbase-taglib.xml   9 Dec 2008 15:30:59 -0000       1.447
@@ -39,7 +39,7 @@
 Use one or more possiblevalue tags if you want to list all possible values. Use
 one or more examplevalue tags is you want to give some example values.
 
-version: $Id: mmbase-taglib.xml,v 1.446 2008/12/09 14:29:11 bert Exp $
+version: $Id: mmbase-taglib.xml,v 1.447 2008/12/09 15:30:59 michiel Exp $
 
 -->
 <taglib author="MMBase community">
@@ -4695,6 +4695,26 @@
       <since>MMBase-1.9.1</since>
     </attribute>
     <attribute>
+      <name>disposition</name>
+      <required>false</required>
+      <rtexprvalue>true</rtexprvalue>
+      <refercontext>true</refercontext>
+      <info>
+        <p>
+        </p>
+      </info>
+
+      <since>MMBase-1.9.1</since>
+      <possiblevalue>
+        <value>attachment</value>
+        <info>The image will be served out as an attachment.</info>
+      </possiblevalue>
+      <possiblevalue>
+        <value>inline</value>
+        <info>The image will be served out inline.</info>
+      </possiblevalue>
+    </attribute>
+    <attribute>
       <name>element</name>
       <required>false</required>
       <rtexprvalue>true</rtexprvalue>
@@ -8943,6 +8963,12 @@
       <name>nodemanager</name>
       <required>true</required>
     </attribute>
+    <attribute>
+      <name>descendants</name>
+      <required>false</required>
+      <rtexprvalue>true</rtexprvalue>
+      <see tag="typeconstraint" attribute="descendants" />
+    </attribute>
   </tag>
 
   <!--
_______________________________________________
Cvs mailing list
Cvs@lists.mmbase.org
http://lists.mmbase.org/mailman/listinfo/cvs

Reply via email to