URLs for AccuRev Elements
These URLs will show the content of AccuRev elements.
URL format
The URL format is:
http://<server:port>/accurev/webgui/browse/<depot>/<stream>/<path>?<parameters>
Examples:
-
http://localhost:8080/accurev/webgui/browse/accurev/mars/java/doc/MainApp.html?
view=content(displays the contents of the most recent version of MainApp.html as text)
-
http://localhost:8080/accurev/webgui/browse/accurev/mars?view=content&eid=23
(if '23' is the element ID of MainApp.html, displays the contents of the most recent version of MainApp.html as text)
-
http://localhost:8080/accurev/webgui/browse/accurev/mars?view=render&eid=2
(displays the most recent version of MainApp.html in an OS-associated browser)
-
http://localhost:8080/accurev/webgui/browse/*render*/accurev/mars?eid=23
(alternative URL format to display the most recent version of MainApp.html in an OS-associated browser)
URL Format Definition
The parts of the URL are described below:
root
The URL used to access AccuRev objects from the Web UI:
http://<server:port>/accurev/webgui/browse
depot
The name or numerical ID of a depot.
stream
The name or numerical ID of a stream.
path
(optional) The path to an AccuRev element within a stream.
separator
(required if there are parameters) The question mark (?) character is used to separate the parameters from the rest of the URL.
parameters
Parameters identify what element versions will be acted on and how. They are shown as name=value pairs. Multiple parameters are separated by the ampersand (&) character.
-
(optional) view: The action to be taken on the specified element
- content: Opens the element in the Web UI. If no view parameter is specified, the view defaults to content.
- render: Renders the contents of the given element in the browser window if possible; otherwise calls the appropriate program to display the element based on operating system file type associations.
- eid: The element ID.
- v: The element’s virtual version, which must be specified in the proper AccuRev format (<stream#>\<version#>, for example, 148\2). If it is not present, the URL retrieves most recent version of the element in the given stream
Rendering Web Pages That Contain Relative Links
The view=render parameter suffices for many types of content that require external programs to display. Web pages, which contain references to images, stylesheets, and other embedded content, require a different approach. For best results when rendering web pages with embedded content referenced using relative links, remove the view=render parameter and construct the URL starting with
http://<server:port>/accurev/webgui/browse/*render*/.
Example:
http://localhost:8080/accurev/webgui/browse/*render*/devplans/OurProduct-2.0/plans/DevPlan20.html
(renders the contents of the most recent version of DevPlan20.html in a Web browser, including images in the Web page that are stored in the plans\images subdirectory)
URL Permanence
Some absolute URLs that reference an AccuRev element or element comparison are constructed so that they always display the same content. These permanent URLs, which contain references to both the element ID and version, will always return the same element version regardless of any further work done on the element. To construct a permanent URL, both the depot and stream must be specified with numerical IDs (not names), and the URL must include both element ID (eid) and version parameters. The sole exception to this is in the case of an URL referencing a snapshot stream. Since snapshots are immutable, all URLs that specify a snapshot are permanent.