net.sourceforge.cvsgrab.web
Class Chora2_0Interface

java.lang.Object
  extended by net.sourceforge.cvsgrab.CvsWebInterface
      extended by net.sourceforge.cvsgrab.web.ViewCvsInterface
          extended by net.sourceforge.cvsgrab.web.Chora2_0Interface

public class Chora2_0Interface
extends ViewCvsInterface

Support for Chora 2.0 interfaces to a cvs repository

Author:
lclaude
Created:
30 mars 2004

Field Summary
 
Fields inherited from class net.sourceforge.cvsgrab.CvsWebInterface
DETECTED_WEB_INTERFACE
 
Constructor Summary
Chora2_0Interface(CVSGrab grabber)
           
 
Method Summary
protected  void adjustFile(RemoteFile file, org.apache.commons.jxpath.JXPathContext nodeContext)
           
 void detect(Document htmlPage)
          Detects if the web page is compatible with this web interface, and if yes initialize it.
protected  String getBrowsePath()
           
 String[] getDirectories(Document htmlPage)
          
 String getDirectoryUrl(String rootUrl, String directoryName)
          
 String getDownloadUrl(RemoteFile file)
          
 RemoteFile[] getFiles(Document htmlPage)
          
protected  String getVersionMarker()
          
 Properties guessWebProperties(String url)
          Guess the web properties frmo the full url
 boolean presetMatch(String rootUrl, String packagePath)
          Returns true if there is a rule that matches this web interface to the given url
protected  String quote(String original)
          Python-style of URIUtil.encodePath
protected  void setBrowsePath(String browsePath)
           
 
Methods inherited from class net.sourceforge.cvsgrab.web.ViewCvsInterface
getBaseUrl, getCheckoutPath, getCvsrootParam, getDirectoriesXpath, getDirectoryXpath, getFileNameXpath, getFilesXpath, getFileVersionXpath, getId, getProjectRoot, getTagParam, getType, getWebInterfaceType, init, setCheckoutPath, setCvsrootParam, setDirectoriesXpath, setDirectoryXpath, setFileNameXpath, setFilesXpath, setFileVersionXpath, setTagParam, setType, setWebInterfaceType
 
Methods inherited from class net.sourceforge.cvsgrab.CvsWebInterface
findInterface, getAltBaseUrl, getBaseUrls, getGrabber, getInterface, getInterfaceIds, getQueryParams, getVersionTag, getWebProperties, registerDocument, setQueryParams, setVersionTag, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Chora2_0Interface

public Chora2_0Interface(CVSGrab grabber)
Method Detail

getBrowsePath

protected String getBrowsePath()

setBrowsePath

protected void setBrowsePath(String browsePath)

detect

public void detect(Document htmlPage)
            throws MarkerNotFoundException,
                   InvalidVersionException
Detects if the web page is compatible with this web interface, and if yes initialize it.

Overrides:
detect in class ViewCvsInterface
Parameters:
htmlPage - The web page
Throws:
MarkerNotFoundException - if the version marker for the web interface was not found
InvalidVersionException - if the version detected is incompatible with the version supported by this web interface.

getDirectoryUrl

public String getDirectoryUrl(String rootUrl,
                              String directoryName)

Overrides:
getDirectoryUrl in class ViewCvsInterface
Returns:
the url to use to access the contents of the repository

getDirectories

public String[] getDirectories(Document htmlPage)

Overrides:
getDirectories in class ViewCvsInterface
Returns:

getFiles

public RemoteFile[] getFiles(Document htmlPage)

Overrides:
getFiles in class ViewCvsInterface
Returns:

getDownloadUrl

public String getDownloadUrl(RemoteFile file)

Overrides:
getDownloadUrl in class ViewCvsInterface
Returns:

quote

protected String quote(String original)
                throws org.apache.commons.httpclient.URIException
Python-style of URIUtil.encodePath

Overrides:
quote in class ViewCvsInterface
Parameters:
original - The string to quote
Returns:
the quoted string
Throws:
org.apache.commons.httpclient.URIException

getVersionMarker

protected String getVersionMarker()

Specified by:
getVersionMarker in class ViewCvsInterface

adjustFile

protected void adjustFile(RemoteFile file,
                          org.apache.commons.jxpath.JXPathContext nodeContext)
Overrides:
adjustFile in class ViewCvsInterface

presetMatch

public boolean presetMatch(String rootUrl,
                           String packagePath)
Description copied from class: CvsWebInterface
Returns true if there is a rule that matches this web interface to the given url

Overrides:
presetMatch in class CvsWebInterface
Parameters:
rootUrl - The root url
packagePath - The package path

guessWebProperties

public Properties guessWebProperties(String url)
Description copied from class: CvsWebInterface
Guess the web properties frmo the full url

Overrides:
guessWebProperties in class ViewCvsInterface
Parameters:
url - the full url
Returns:
a list of Properties guessed from the full url, or an empty property list if no match was possible


Copyright © 2002-2005 Ludovic Claude. All Rights Reserved.