net.sf.scmwebgui
Class CtxURI

java.lang.Object
  extended by net.sf.scmwebgui.CtxURI

public class CtxURI
extends java.lang.Object

Context URI wrapper. The URI syntax is: //project//categoryPath//contentUri//roles,locale,index,template

contentUri and index parts are optional.

Author:
mballesteros

Nested Class Summary
(package private) static class CtxURI.CtxURITokenizer
           
 
Field Summary
static java.lang.String SEPARATOR
          The URI parts separator
 
Constructor Summary
CtxURI(java.lang.String uri)
          Builds a CtxURIgiven its String representation
 
Method Summary
 java.lang.String getCategoryPath()
           
 java.lang.String getCategoryUri(java.lang.String categoryPath, java.lang.String locale, java.lang.String index, java.lang.String template)
          Builds a category URI keeping the current context
 java.lang.String getCategoryUri(java.lang.String categoryPath, java.lang.String locale, java.lang.String index, java.lang.String template, java.lang.String roles)
          Builds a category URI keeping the current context with roles
 java.lang.String getContentUri()
           
 java.lang.String getContentUri(net.sourceforge.sconman.Content content, java.lang.String template)
          Builds a template URI to show the content.
 java.lang.String getContentUri(net.sourceforge.sconman.Content content, java.lang.String template, java.lang.String roles)
          Builds a template URI to show the content with roles.
 java.lang.String getContentUri(java.lang.String categoryPath, net.sourceforge.sconman.Content content, java.lang.String template)
          Builds a template URI to show the content.
 java.lang.String getContentUri(java.lang.String categoryPath, net.sourceforge.sconman.Content content, java.lang.String index, java.lang.String template)
          Builds a template URI to show the content.
 java.lang.String getDownloadUri(java.lang.String uri, net.sourceforge.sconman.Content content)
          Builds a URI to download a content's File/Thumbnail.
 java.lang.String getGuestDownloadUri(java.lang.String uri, net.sourceforge.sconman.Content content)
          Builds a guest URI to download a content's File/Thumbnail.
 java.lang.String getIndex()
           
 java.lang.Integer getIndexAsInteger()
           
 java.lang.String getLocale()
           
 java.lang.String getLocaleUri(java.lang.String locale)
          Returns an URI that changes the locale
 java.lang.String getProject()
           
 java.lang.String getRoles()
           
 java.lang.String getTemplate()
           
 boolean isGuestDownloadUri()
           
 void parseUri(java.lang.String uri)
          Parses a String, extracting all the context info on it
 void setCategoryPath(java.lang.String categoryPath)
           
 void setContentUri(java.lang.String contentUri)
           
 void setIndex(java.lang.String index)
           
 void setLocale(java.lang.String locale)
           
 void setProject(java.lang.String project)
           
 void setRoles(java.lang.String roles)
           
 void setTemplate(java.lang.String template)
           
 java.lang.String toString()
          Returns a String representation of this Request context
 java.lang.String toString(java.lang.String project, java.lang.String categoryPath, java.lang.String contentUri, java.lang.String roles, java.lang.String locale, java.lang.String index, java.lang.String template)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SEPARATOR

public static java.lang.String SEPARATOR
The URI parts separator

Constructor Detail

CtxURI

public CtxURI(java.lang.String uri)
Builds a CtxURIgiven its String representation

Parameters:
uri -
Method Detail

parseUri

public void parseUri(java.lang.String uri)
Parses a String, extracting all the context info on it

Parameters:
uri - The context, represented as a String

isGuestDownloadUri

public boolean isGuestDownloadUri()

toString

public java.lang.String toString()
Returns a String representation of this Request context

Overrides:
toString in class java.lang.Object
Returns:

getCategoryUri

public java.lang.String getCategoryUri(java.lang.String categoryPath,
                                       java.lang.String locale,
                                       java.lang.String index,
                                       java.lang.String template)
Builds a category URI keeping the current context

Parameters:
categoryPath -
locale -
index -
template -
Returns:

getCategoryUri

public java.lang.String getCategoryUri(java.lang.String categoryPath,
                                       java.lang.String locale,
                                       java.lang.String index,
                                       java.lang.String template,
                                       java.lang.String roles)
Builds a category URI keeping the current context with roles

Parameters:
categoryPath -
locale -
index -
template -
roles -
Returns:

getDownloadUri

public java.lang.String getDownloadUri(java.lang.String uri,
                                       net.sourceforge.sconman.Content content)
Builds a URI to download a content's File/Thumbnail. This method obtains content's category automatically. Required to access a content with a unique URI in Sconman (Mandatory to use cache).

Parameters:
uri - Uri to content's File/Thumbnail
content - Content to contruct download uri.
Returns:

getGuestDownloadUri

public java.lang.String getGuestDownloadUri(java.lang.String uri,
                                            net.sourceforge.sconman.Content content)
Builds a guest URI to download a content's File/Thumbnail. This method obtains content's category automatically. Required to access a content with a unique URI in Sconman (Mandatory to use cache).

Parameters:
uri - Uri to content's File/Thumbnail
content - Content to contruct download uri.
Returns:

getContentUri

public java.lang.String getContentUri(net.sourceforge.sconman.Content content,
                                      java.lang.String template)
Builds a template URI to show the content. This method obtains content's category automatically. Required to access to template with a unique URI in Sconman (Mandatory to use cache).

Parameters:
content - Content to contruct view uri with passed template.
template - Velocity's Template to use
Returns:

getContentUri

public java.lang.String getContentUri(java.lang.String categoryPath,
                                      net.sourceforge.sconman.Content content,
                                      java.lang.String template)
Builds a template URI to show the content. This method obtains content's category automatically. Required to access to template with a unique URI in Sconman (Mandatory to use cache).

Parameters:
content - Content to contruct view uri with passed template.
template - Velocity's Template to use
Returns:

getContentUri

public java.lang.String getContentUri(java.lang.String categoryPath,
                                      net.sourceforge.sconman.Content content,
                                      java.lang.String index,
                                      java.lang.String template)
Builds a template URI to show the content. This method obtains content's category automatically. Required to access to template with a unique URI in Sconman (Mandatory to use cache).

Parameters:
content - Content to contruct view uri with passed template.
template - Velocity's Template to use
Returns:

getContentUri

public java.lang.String getContentUri(net.sourceforge.sconman.Content content,
                                      java.lang.String template,
                                      java.lang.String roles)
Builds a template URI to show the content with roles. This method obtains content's category automatically. Required to access to template with a unique URI in Sconman (Mandatory to use cache).

Parameters:
content - Content to contruct view uri with passed template and roles.
template - Velocity's Template to use
roles - User roles to construct URI.
Returns:

getLocaleUri

public java.lang.String getLocaleUri(java.lang.String locale)
Returns an URI that changes the locale

Parameters:
locale -
Returns:

toString

public java.lang.String toString(java.lang.String project,
                                 java.lang.String categoryPath,
                                 java.lang.String contentUri,
                                 java.lang.String roles,
                                 java.lang.String locale,
                                 java.lang.String index,
                                 java.lang.String template)

getIndexAsInteger

public java.lang.Integer getIndexAsInteger()

getCategoryPath

public java.lang.String getCategoryPath()
Returns:

setCategoryPath

public void setCategoryPath(java.lang.String categoryPath)
Parameters:
categoryPath -

getContentUri

public java.lang.String getContentUri()
Returns:

setContentUri

public void setContentUri(java.lang.String contentUri)
Parameters:
contentUri -

getIndex

public java.lang.String getIndex()
Returns:

setIndex

public void setIndex(java.lang.String index)
Parameters:
index -

getLocale

public java.lang.String getLocale()
Returns:

setLocale

public void setLocale(java.lang.String locale)
Parameters:
locale -

getProject

public java.lang.String getProject()
Returns:

setProject

public void setProject(java.lang.String project)
Parameters:
project -

getRoles

public java.lang.String getRoles()
Returns:

setRoles

public void setRoles(java.lang.String roles)
Parameters:
roles -

getTemplate

public java.lang.String getTemplate()
Returns:

setTemplate

public void setTemplate(java.lang.String template)
Parameters:
template -


Copyright null null. All Rights Reserved.