org.xiruss.xirussrepository.server.jetty.viewer
Class XirussHtmlResource

java.lang.Object
  extended by org.mortbay.util.Resource
      extended by org.xiruss.xirussrepository.server.jetty.viewer.XirussResourceBase
          extended by org.xiruss.xirussrepository.server.jetty.viewer.XirussHtmlResource
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
BranchHtmlResource, BranchListHtmlResource, OrganizerHtmlResource, RepositoryHtmlResource, RepositoryReportResource, SnapshotHtmlResource

public class XirussHtmlResource
extends XirussResourceBase

Maps the HTTP Resource API to Xiruss repository objects. NOTE: The code right now is very scripty as I figure out the business logic for handling the URLs. Once I get that worked out it will need to be refactored to make the code cleaner and more abstract. Right now I'm in the "make it work" stage. WEK

See Also:
Serialized Form

Field Summary
(package private) static org.apache.log4j.Logger logger
           
 
Fields inherited from class org.xiruss.xirussrepository.server.jetty.viewer.XirussResourceBase
_associate, _context, mimeType, pathTokens, pathToMe, rep, repositoryObject, request, resourceType, url
 
Constructor Summary
XirussHtmlResource(XirussRepository rep, org.mortbay.http.HttpRequest request)
           
XirussHtmlResource(XirussRepository rep, org.mortbay.http.HttpRequest request, int resourceType, java.util.Vector pathTokens)
           
XirussHtmlResource(XirussRepository rep, org.mortbay.http.HttpRequest request, RepositoryObject repositoryObj)
           
 
Method Summary
protected  void addObjectList(java.lang.String parentUriStr, java.util.Map objects, java.lang.StringBuffer buf)
           
 java.io.InputStream getInputStream()
           
 java.lang.String getListHTML(java.lang.String base, boolean parent, java.lang.String middleListPart)
          Get the resource list as a HTML directory listing.
 boolean isDirectory()
           
 long length()
          Return the length of the resource
 
Methods inherited from class org.xiruss.xirussrepository.server.jetty.viewer.XirussResourceBase
addPath, delete, exists, getAssociate, getCharacterEncoding, getFile, getHttpContext, getMimeType, getName, getOutputStream, getPathToMe, getRepositoryObject, getResourceType, getURL, lastModified, list, release, renameTo, setAssociate, writeTo
 
Methods inherited from class org.mortbay.util.Resource
cache, encode, finalize, getAlias, getListHTML, newResource, newResource, newSystemResource
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

static org.apache.log4j.Logger logger
Constructor Detail

XirussHtmlResource

public XirussHtmlResource(XirussRepository rep,
                          org.mortbay.http.HttpRequest request,
                          RepositoryObject repositoryObj)
                   throws java.io.IOException
Throws:
java.io.IOException

XirussHtmlResource

public XirussHtmlResource(XirussRepository rep,
                          org.mortbay.http.HttpRequest request,
                          int resourceType,
                          java.util.Vector pathTokens)
                   throws java.io.IOException
Throws:
java.io.IOException

XirussHtmlResource

public XirussHtmlResource(XirussRepository rep,
                          org.mortbay.http.HttpRequest request)
Method Detail

isDirectory

public boolean isDirectory()
Specified by:
isDirectory in class XirussResourceBase

getListHTML

public java.lang.String getListHTML(java.lang.String base,
                                    boolean parent,
                                    java.lang.String middleListPart)
                             throws java.io.IOException
Get the resource list as a HTML directory listing.

Parameters:
base - The base URL
parent - True if the parent directory should be included
Returns:
String of HTML
Throws:
SnapCMException
java.io.IOException

addObjectList

protected void addObjectList(java.lang.String parentUriStr,
                             java.util.Map objects,
                             java.lang.StringBuffer buf)

getInputStream

public java.io.InputStream getInputStream()
                                   throws java.io.IOException
Specified by:
getInputStream in class XirussResourceBase
Throws:
java.io.IOException

length

public long length()
Return the length of the resource

Specified by:
length in class XirussResourceBase