com.jalios.jcms.taglib
Class FileWebdavTag

java.lang.Object
  extended by javax.servlet.jsp.tagext.TagSupport
      extended by com.jalios.jcms.taglib.FileWebdavTag
All Implemented Interfaces:
Serializable, javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.Tag

public class FileWebdavTag
extends javax.servlet.jsp.tagext.TagSupport

This tag prints icons for webfolders: - Download a File - Edit with WebDav a File - Open a WebFolder

Version:
$Revision: 21024 $
Author:
Jean-Philippe Encausse
See Also:
Serialized Form

Nested Class Summary
static class FileWebdavTag.Webdav
           
 
Field Summary
protected  Category cat
           
protected  FileDocument doc
           
protected static Set mimetypes
           
protected  boolean openByBrowser
           
protected  boolean openByWebdav
           
static String REVISION
           
protected  boolean showRoot
           
protected  String title
           
 
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContext
 
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
 
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
 
Constructor Summary
FileWebdavTag()
           
 
Method Summary
 void clean()
          Clean tags parameters
 int doEndTag()
           
 int doStartTag()
           
static String encodeWebdavURL(String str)
          Convenient method to encode a WebDav URL.
static String encodeWebdavURL2(String s)
          Convenient method to encode a WebDav URL using webdav encoding.
 void setDoc(FileDocument doc)
          This method set the FileDocument to open with webdav
 void setFolder(Category cat)
          This method set the category to use to open webfolder
 void setOpenByBrowser(boolean openByBrowser)
          Display download icon
 void setOpenByWebdav(boolean openByWebdav)
          Display webdav edit icon
 void setShowRoot(boolean showRoot)
          Display root, do not open workspace
 void setTitle(String title)
          This method set a custom title for the given icon
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, findAncestorWithClass, getId, getParent, getValue, getValues, release, removeValue, resetCustomAttributes, setId, setPageContext, setParent, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REVISION

public static final String REVISION
See Also:
Constant Field Values

mimetypes

protected static final Set mimetypes

doc

protected FileDocument doc

cat

protected Category cat

openByWebdav

protected boolean openByWebdav

openByBrowser

protected boolean openByBrowser

title

protected String title

showRoot

protected boolean showRoot
Constructor Detail

FileWebdavTag

public FileWebdavTag()
Method Detail

setFolder

public void setFolder(Category cat)
This method set the category to use to open webfolder

Parameters:
cat - the opening folder

setDoc

public void setDoc(FileDocument doc)
This method set the FileDocument to open with webdav

Parameters:
doc - the FileDocument to work with

setTitle

public void setTitle(String title)
This method set a custom title for the given icon

Parameters:
title - a title for the given icon

setOpenByBrowser

public void setOpenByBrowser(boolean openByBrowser)
Display download icon

Parameters:
openByBrowser -

setOpenByWebdav

public void setOpenByWebdav(boolean openByWebdav)
Display webdav edit icon

Parameters:
openByWebdav -

setShowRoot

public void setShowRoot(boolean showRoot)
Display root, do not open workspace

Parameters:
showRoot -

clean

public void clean()
Clean tags parameters


doStartTag

public int doStartTag()
               throws javax.servlet.jsp.JspException
Specified by:
doStartTag in interface javax.servlet.jsp.tagext.Tag
Overrides:
doStartTag in class javax.servlet.jsp.tagext.TagSupport
Throws:
javax.servlet.jsp.JspException

doEndTag

public int doEndTag()
Specified by:
doEndTag in interface javax.servlet.jsp.tagext.Tag
Overrides:
doEndTag in class javax.servlet.jsp.tagext.TagSupport

encodeWebdavURL

public static String encodeWebdavURL(String str)
Convenient method to encode a WebDav URL.

Remove the need to : - directly use URLEncode.encode - specify each time Channel.getWebdavEncoding() as encoding - catch various exceptions thrown by URLEncoder.encode(String, String).

Parameters:
str - the string to url encode
Returns:
the encoded URL
See Also:
URLEncoder.encode(String, String)

encodeWebdavURL2

public static String encodeWebdavURL2(String s)
Convenient method to encode a WebDav URL using webdav encoding.
Same implementation as URLEncoder.encode(String, String), but space is encoded with %20 and '/' is not encoded.

Parameters:
s - String to be translated.
Returns:
the translated String.
See Also:
Util.encodeUrl(String, String)


Copyright © 2001-2007 Jalios SA. All Rights Reserved.