com.jalios.jcms.webdav.cat
Class CatWebdavUtil

java.lang.Object
  extended by com.jalios.jcms.webdav.cat.CatWebdavUtil

public class CatWebdavUtil
extends Object


Field Summary
static String REVISION
           
 
Constructor Summary
CatWebdavUtil()
           
 
Method Summary
static String getCustomProtocolScheme()
          Retrieve the custom protocol scheme (default is "jcmsoffice").
static String getDataName(Data data)
          Retrieve the name of the Data as it should be used in WebDav.
static int getMaxWebFolderLength()
          Retrieve the maximum length of webfolder URL as defined by property "channel.webdav.max-web-folder-length".
static String getParentPath(FileDocument doc)
          Retrieve the WebDav path of the first valid parent folder of the specified FileDocument.
static String getPath(Category cat, Workspace ws)
          Retrieve the WebDav path of the specified category in the specified workspace.
static String getPath(FileDocument doc)
          Retrieve the WebDav path of the specified FileDocument.
static String getPath(Workspace ws)
          Retrieve the WebDav path of the specified Workspace.
static String getPathShort(Category cat, Workspace ws)
          Retrieve the WebDav path of the specified category in the specified workspace use a short notation for IE compatibility.
static Category getRootCategory()
          Retrieve the global root category to be used for webdav
static boolean isCustomProtocolEnabled()
          Check if the use of the custom protocol for WebDav edition link is enabled
static boolean isWebdavEditable(FileDocument doc)
          Check if the specified document can be edited through WebDAV.
static boolean isWebdavEditable(FileDocument doc, Member mbr)
          Check if the specified document can be edited through WebDAV by the specified member.
static boolean useDigestAuthentication()
          Check if HTTP Digest authentification should be used in WebDav.
 
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
Constructor Detail

CatWebdavUtil

public CatWebdavUtil()
Method Detail

isCustomProtocolEnabled

public static boolean isCustomProtocolEnabled()
Check if the use of the custom protocol for WebDav edition link is enabled

Returns:
true if it is enabled, false otherwise
Since:
jcms-6.1

getCustomProtocolScheme

public static String getCustomProtocolScheme()
Retrieve the custom protocol scheme (default is "jcmsoffice").

Returns:
an URI scheme.
Since:
jcms-6.1

isWebdavEditable

public static boolean isWebdavEditable(FileDocument doc)
Check if the specified document can be edited through WebDAV.

Parameters:
doc - the FileDocument to check
Returns:
true if can be edited, false otherwise
Since:
jcms-6.1

isWebdavEditable

public static boolean isWebdavEditable(FileDocument doc,
                                       Member mbr)
Check if the specified document can be edited through WebDAV by the specified member.

Parameters:
doc - the FileDocument to check.
mbr - the Member to check
Returns:
true if ca be edited, false otherwise.
Since:
jcms-6.1.0

useDigestAuthentication

public static boolean useDigestAuthentication()
Check if HTTP Digest authentification should be used in WebDav.

Returns:
true if HTTP Digest authentification should be used, false otherwise.
Since:
jcms-6.1

getDataName

public static String getDataName(Data data)
Retrieve the name of the Data as it should be used in WebDav.

Parameters:
data - the Data for which url should be retrieved, must be a Workspace, Category or FileDocument (otherwise null is returned)
Returns:
a name suitable for use in WebDAV url (return null if data was not a Data browsable through WebDAV)
Since:
jcms-6.1

getPath

public static String getPath(Workspace ws)
Retrieve the WebDav path of the specified Workspace.

Parameters:
ws - the Workspace for which the path is retrieved, must not be null.
Returns:
a relative path suitable for use in WebDav url, with a trailing slash, e.g "Default Workspace/".
In order to be used as HREF attribute the returned path MUST be encoded using WebdavContext.encodePath(String).
Since:
jcms-6.1

getPath

public static String getPath(Category cat,
                             Workspace ws)
Retrieve the WebDav path of the specified category in the specified workspace.

Return null if the category cannot be displayed using WebDAV in this workspace.

Parameters:
cat - the category for which the path is retrieved, must not be null.
ws - the workspace in which the category is to be displayed.
Returns:
a relative path suitable for use in WebDav url, with a trailing slash, e.g "Default Workspace/Parent Category/Other Category/My Category/"
In order to be used as HREF attribute the returned path MUST be encoded using WebdavContext.encodePath(String).
Since:
jcms-6.1

getPath

public static String getPath(FileDocument doc)
Retrieve the WebDav path of the specified FileDocument.

Parameters:
doc - the FileDocument for which the path is retrieved, must not be null.
Returns:
a relative path suitable for use in WebDav url, e.g "Default Workspace/Parent Category/Other Category/My Category/My Document.doc"
In order to be used as HREF attribute the returned path MUST be encoded using WebdavContext.encodePath(String).
Since:
jcms-6.1

getParentPath

public static String getParentPath(FileDocument doc)
Retrieve the WebDav path of the first valid parent folder of the specified FileDocument.

Parameters:
doc - the FileDocument for which the path is retrieved, must not be null.
Returns:
a relative path suitable for use in WebDav url, e.g "Default Workspace/Parent Category/Other Category/My Category/"
In order to be used as HREF attribute the returned path MUST be encoded using WebdavContext.encodePath(String).
Since:
jcms-6.1

getRootCategory

public static Category getRootCategory()
Retrieve the global root category to be used for webdav

Returns:
as of current implement, always return the channel's root Category
Since:
jcms-6.1

getMaxWebFolderLength

public static int getMaxWebFolderLength()
Retrieve the maximum length of webfolder URL as defined by property "channel.webdav.max-web-folder-length".

- With IE 6 the maxwebfolder length was 90 !
- After patch http://support.microsoft.com/kb/325355/ it is 260 (==MAX_PATH)
- After patch http://support.microsoft.com/kb/329919 is is 2083 (==INTERNET_MAX_URL_LENGTH)
- With IE 7 and 8 it is probably also 2083

Returns:
a length
Since:
jcms-6.1.1

getPathShort

public static String getPathShort(Category cat,
                                  Workspace ws)
Retrieve the WebDav path of the specified category in the specified workspace use a short notation for IE compatibility.

Return null if the category cannot be displayed using WebDAV in this workspace.

Parameters:
cat - the category for which the path is retrieved, must not be null.
ws - the workspace in which the category is to be displayed.
Returns:
a relative path suitable for use in WebDav url, with a trailing slash, e.g "Default Workspace/Parent Category/{cat-id}/"
In order to be used as HREF attribute the returned path MUST be encoded using WebdavContext.encodePath(String).
Since:
jcms-6.1.1


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