net.sourceforge.cvsgrab.web
Class ViewCvsInterface

java.lang.Object
  extended by net.sourceforge.cvsgrab.CvsWebInterface
      extended by net.sourceforge.cvsgrab.web.ViewCvsInterface
Direct Known Subclasses:
Chora2_0Interface, CvsWeb1_0Interface, CvsWeb2_0Interface, CvsWeb3_0Interface, FishEye1_0Interface, Sourcecast2_0Interface, Sourcecast3_0Interface, ViewCvs0_7Interface, ViewCvs0_8Interface, ViewCvs0_9Interface, ViewCvs1_0Interface

public abstract class ViewCvsInterface
extends CvsWebInterface

Support for ViewCvs-like interfaces to a cvs repository

Version:
$Revision: 1.17 $ $Date: 2005/06/24 00:04:34 $
Author:
Ludovic Claude
Created:
on 11 oct. 2003

Field Summary
 
Fields inherited from class net.sourceforge.cvsgrab.CvsWebInterface
DETECTED_WEB_INTERFACE
 
Constructor Summary
ViewCvsInterface(CVSGrab grabber)
          Constructor for ViewCvsInterface
 
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.
 String getBaseUrl()
           
protected  String getCheckoutPath()
           
 String getCvsrootParam()
           
 String[] getDirectories(Document htmlPage)
          
 String getDirectoriesXpath()
           
 String getDirectoryUrl(String rootUrl, String directoryName)
           
 String getDirectoryXpath()
           
 String getDownloadUrl(RemoteFile file)
           
 String getFileNameXpath()
           
 RemoteFile[] getFiles(Document htmlPage)
          
 String getFilesXpath()
           
 String getFileVersionXpath()
           
 String getId()
          
protected  String getProjectRoot()
           
 String getTagParam()
           
 String getType()
          
protected abstract  String getVersionMarker()
           
 String getWebInterfaceType()
           
 Properties guessWebProperties(String url)
          Guess the web properties frmo the full url
 void init()
          Initialize the web interface
protected  String quote(String original)
          Python-style of URIUtil.encodePath
protected  void setCheckoutPath(String checkoutPath)
           
 void setCvsrootParam(String cvsrootParam)
           
 void setDirectoriesXpath(String directoriesXpath)
           
 void setDirectoryXpath(String directoryXpath)
           
 void setFileNameXpath(String fileNameXpath)
           
 void setFilesXpath(String filesXpath)
           
 void setFileVersionXpath(String fileVersionXpath)
           
 void setTagParam(String param)
           
protected  void setType(String type)
           
protected  void setWebInterfaceType(String webInterfaceType)
           
 
Methods inherited from class net.sourceforge.cvsgrab.CvsWebInterface
findInterface, getAltBaseUrl, getBaseUrls, getGrabber, getInterface, getInterfaceIds, getQueryParams, getVersionTag, getWebProperties, presetMatch, registerDocument, setQueryParams, setVersionTag, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ViewCvsInterface

public ViewCvsInterface(CVSGrab grabber)
Constructor for ViewCvsInterface

Method Detail

init

public void init()
          throws Exception
Initialize the web interface

Specified by:
init in class CvsWebInterface
Throws:
Exception - if initialisation fails

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.

Specified by:
detect in class CvsWebInterface
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.

getId

public String getId()

Specified by:
getId in class CvsWebInterface
Returns:
the id identifying the web interface, and used for initialisation

getType

public String getType()

Specified by:
getType in class CvsWebInterface
Returns:
the type of the web interface as detected from the actual website

getBaseUrl

public String getBaseUrl()
Specified by:
getBaseUrl in class CvsWebInterface
Returns:
the base url to use when trying to auto-detect this type of web interface

getDirectoryUrl

public String getDirectoryUrl(String rootUrl,
                              String directoryName)
Specified by:
getDirectoryUrl in class CvsWebInterface
Parameters:
rootUrl -
directoryName -
Returns:
the url to use to access the contents of the repository

getFiles

public RemoteFile[] getFiles(Document htmlPage)

Specified by:
getFiles in class CvsWebInterface
Returns:

getDirectories

public String[] getDirectories(Document htmlPage)

Specified by:
getDirectories in class CvsWebInterface
Returns:

getDownloadUrl

public String getDownloadUrl(RemoteFile file)
Specified by:
getDownloadUrl in class CvsWebInterface
Returns:

guessWebProperties

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

Specified by:
guessWebProperties in class CvsWebInterface
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

getFilesXpath

public String getFilesXpath()

getFileNameXpath

public String getFileNameXpath()

getFileVersionXpath

public String getFileVersionXpath()

getDirectoriesXpath

public String getDirectoriesXpath()

getDirectoryXpath

public String getDirectoryXpath()

getCheckoutPath

protected String getCheckoutPath()

setCheckoutPath

protected void setCheckoutPath(String checkoutPath)

setDirectoryXpath

public void setDirectoryXpath(String directoryXpath)

setDirectoriesXpath

public void setDirectoriesXpath(String directoriesXpath)

setFileVersionXpath

public void setFileVersionXpath(String fileVersionXpath)

setFileNameXpath

public void setFileNameXpath(String fileNameXpath)

setFilesXpath

public void setFilesXpath(String filesXpath)

getTagParam

public String getTagParam()

setTagParam

public void setTagParam(String param)

getWebInterfaceType

public String getWebInterfaceType()

setWebInterfaceType

protected void setWebInterfaceType(String webInterfaceType)

getCvsrootParam

public String getCvsrootParam()

setCvsrootParam

public void setCvsrootParam(String cvsrootParam)

setType

protected void setType(String type)
Parameters:
type -

getVersionMarker

protected abstract String getVersionMarker()

adjustFile

protected void adjustFile(RemoteFile file,
                          org.apache.commons.jxpath.JXPathContext nodeContext)

quote

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

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

getProjectRoot

protected String getProjectRoot()


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