|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object info.magnolia.link.LinkFactory
public class LinkFactory
Factory processing various input into the Link objects and back.
For parsing html and converting multiple link instances on the fly use LinkUtil
.
Field Summary | |
---|---|
static java.util.regex.Pattern |
LINK_PATTERN
Pattern to find a link. |
static java.util.regex.Pattern |
UUID_PATTERN
Pattern to find a magnolia formatted uuid link. |
Constructor Summary | |
---|---|
LinkFactory()
|
Method Summary | |
---|---|
static Link |
createLink(Content node)
Creates new link from the content node. |
static Link |
createLink(NodeData nodeData)
Creates new link from the node data. |
static Link |
createLink(java.lang.String repository,
java.lang.String uuid)
Creates link to the content denoted by repository and uuid. |
static Link |
createLink(java.lang.String repository,
java.lang.String path,
java.lang.String extension,
java.lang.String anchor,
java.lang.String parameters)
Creates link to the content identified by the repository and path. |
static Link |
createLink(java.lang.String uuid,
java.lang.String repository,
java.lang.String fallbackHandle,
java.lang.String nodeDataName,
java.lang.String extension,
java.lang.String anchor,
java.lang.String parameters)
Creates link based on provided parameters. |
static Link |
parseLink(java.lang.String link)
Parses provided URI to the link. |
static Link |
parseUUIDLink(java.lang.String uuidLink)
Parses UUID link pattern string and converts it into a Link object. |
static java.lang.String |
toPattern(Link link)
Converts provided Link to an UUID link pattern. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static java.util.regex.Pattern UUID_PATTERN
public static final java.util.regex.Pattern LINK_PATTERN
Constructor Detail |
---|
public LinkFactory()
Method Detail |
---|
public static Link createLink(Content node)
node
- Target content for the link.
public static Link createLink(NodeData nodeData) throws LinkException
nodeData
- Target node data for the link.
LinkException
public static Link createLink(java.lang.String repository, java.lang.String uuid) throws LinkException
repository
- Parent repository of the content of interest.uuid
- UUID of the content to create link to.
LinkException
public static Link createLink(java.lang.String repository, java.lang.String path, java.lang.String extension, java.lang.String anchor, java.lang.String parameters) throws LinkException
repository
- Source repository for the content.path
- Path to the content of interest.extension
- Optional extension to be used in the linkanchor
- Optional link anchor.parameters
- Optional link parameters.
LinkException
public static Link createLink(java.lang.String uuid, java.lang.String repository, java.lang.String fallbackHandle, java.lang.String nodeDataName, java.lang.String extension, java.lang.String anchor, java.lang.String parameters) throws LinkException
Link
object,
pointing to the non existing uuid so that broken link detection tools can find it.
uuid
- UUID of the contentrepository
- Content repository name.fallbackHandle
- Optional fallback content handle.nodeDataName
- Content node data name for binary data.extension
- Optional link extension.anchor
- Optional link anchor.parameters
- Optional link parameters.
LinkException
public static Link parseUUIDLink(java.lang.String uuidLink) throws LinkException
uuidLink
- String containing reference to content as a UUID link pattern.
LinkException
public static Link parseLink(java.lang.String link) throws LinkException
link
- URI representing path to piece of content
LinkException
public static java.lang.String toPattern(Link link)
link
- Link to convert.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |