public class WGContentKey
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
TOKEN_DIVIDER |
Constructor and Description |
---|
WGContentKey(java.lang.Object structKey,
java.lang.String strLanguage,
int iVersion)
Constructor for content key object.
|
Modifier and Type | Method and Description |
---|---|
static WGContentKey |
create(WGContent content)
Creates a new content key object, representing the unique content key of the parameter content.
|
static WGContentKey |
create(WGContent content,
boolean unique)
Creates a new content key object, representing the content key of the parameter content.
|
static WGContentKey |
create(WGDocumentCore doc)
Creates a new content key object, representing the unique content key of the parameter content core.
|
static WGContentKey |
create(WGDocumentCore doc,
boolean unique)
Creates a new content key object, representing the content key of the parameter content core.
|
boolean |
equals(java.lang.Object arg0) |
java.lang.String |
getLanguage()
Returns the language name part of this content key.
|
java.lang.Object |
getStructKey()
Returns the struct key part of this key.
|
int |
getVersion()
Returns the version number part of the key.
|
int |
hashCode() |
boolean |
isValid()
Tests, if this is structurally a valid content key
|
static WGContentKey |
parse(java.lang.String key,
WGDatabase db)
Parses a content key string and returns the according unique content key object.
|
static WGContentKey |
parse(java.lang.String key,
WGDatabase db,
boolean unique)
Parses a content key string and returns the according content key object.
|
WGDocumentKey |
toDocumentKey()
Creates a document key pendant for this content key
|
java.lang.String |
toString()
Returns a string representation for this content key, as used in URLs and parsed by the parse methods on this object.
|
public static final java.lang.String TOKEN_DIVIDER
public WGContentKey(java.lang.Object structKey, java.lang.String strLanguage, int iVersion)
structKey
- The struct keystrLanguage
- The language nameiVersion
- The content versionpublic boolean isValid()
public static WGContentKey parse(java.lang.String key, WGDatabase db, boolean unique) throws WGAPIException
key
- Content key string representationdb
- Content database, whose content is adressed by the content key. Omit to keep struct key in its string representation.unique
- When true, creates unique content key (always use real version), else creates url mode key (if content is released, 0 is taken for version)WGAPIException
public static WGContentKey parse(java.lang.String key, WGDatabase db) throws WGAPIException
key
- Content key string representationdb
- Content database, whose content is adressed by the content key. Omit to keep struct key in its string representation.WGAPIException
public static WGContentKey create(WGContent content, boolean unique) throws WGAPIException
content
- The content, whose content key should be builtunique
- When true, creates unique content key (always use real version), else creates url mode key (if content is released, 0 is taken for version)WGAPIException
public static WGContentKey create(WGContent content) throws WGAPIException
content
- The content, whose content key should be builtWGAPIException
public static WGContentKey create(WGDocumentCore doc, boolean unique) throws WGAPIException
doc
- The content core, whose content key should be builtunique
- When true, creates unique content key (always use real version), else creates url mode key (if content is released, 0 is taken for version)WGAPIException
public static WGContentKey create(WGDocumentCore doc) throws WGAPIException
doc
- content document core, whose content key should be built.WGAPIException
public int getVersion()
public java.lang.String getLanguage()
public java.lang.Object getStructKey()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object arg0)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public WGDocumentKey toDocumentKey()