LinkBuilder Class
DEPRECATED
- public class LinkBuilder
extends Object
A utility class to help building the URLs in the Content Management
admin screen.
This will look for all entries in p13n-content-admin.properties in the
current directory (override via the "p13n-content-admin.properties" system
property) of the form:
content.admin.links.<name>.link.url=...
From that, it will take the <name> and look for entries like:
content.admin.links.<name>.link.text=...
content.admin.links.<name>.link.target=...
content.admin.links.<name>.image.url=...
content.admin.links.<name>.image.text=...
content.admin.links.<name>.image.width=...
content.admin.links.<name>.image.height=...
content.admin.links.<name>.link.url
will be the URL of
the link to place in the content admin screen.
content.admin.links.<name>.link.text
will be the text of
the link. If this is not specified, it defaults to <name>.
content.admin.links.<name>.link.target
will be the target
window/frame name of the link. If not specified, none will be used (i.e.
will appear in same frame/window as the link).
content.admin.links.<name>.image.url
is the URL of an
image to place to the left of the link. If this is not specified, no image
will placed on the admin screen and the other image properties will be
ignored.
content.admin.links.<name>.image.text
is the alternate
text for the image. The default is the text of the link.
content.admin.links.<name>.image.width
is the preferred
display width of the image.
content.admin.links.<name>.image.height
is the preferred
display height of the image.
All URLs from the properties file should be at least absolute paths.
All values from the properties file may contain variable references of
the form ${varname}
. These variable references will be
replaced, at runtime, with the appropriate information from the server.
The valid varnames
are:
scheme
: the schema of the server (http, https).
host
: the hostname (IP address if hostname unknown) of
the server.
port
: the port address of the server.
remoteUser
: the user name of the remote user, if known.
remoteHost
: the hostname (IP address if hostname unknown)
of the remote client.
remoteIp
: the IP address of the remote client.
charSet
: the character encoding of the client, if known.
A varname
which is not recognized will not be replaced in the
value.
The link names will always be returned in alphabetical order (according to
VM's default ordering).
Related Topics
Variables
-
Hierarchy
-
Object
LinkBuilder
Methods from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LinkBuilder
public LinkBuilder()
getLinkInfo(String) Method
public static LinkBuilder.LinkInfo
getLinkInfo(String
name)
Get the link info for a given name.
Parameters
-
name
- the link name.
Returns
- the LinkInfo, null for unknown name.
getLinkInfo(String, HttpServletRequest) Method
public static LinkBuilder.LinkInfo
getLinkInfo(String
name,
HttpServletRequest
req)
Get the link info for a given name, with the ${varname}'s replaced by
the information in the request.
Parameters
-
name
- the link name.
-
req
- the servlet request object
Returns
- the LinkInfo, null for unknown name.
getLinkNames() Method
public static Iterator
getLinkNames()
Get a sorted iterator of the link names.
hasLinks() Method
public static boolean hasLinks()
Tell if there are links configured in this appliation.
Returns
- true if there are links.