Package com.saperion.util
Class WeblinkUtil
- java.lang.Object
- 
- com.saperion.util.WeblinkUtil
 
- 
 public class WeblinkUtil extends java.lang.ObjectThe Class WeblinkUtil.
- 
- 
Field SummaryFields Modifier and Type Field Description static intALL_ELEMENTstatic java.lang.StringREQ_PARAM_ARCHIVEThe Constant REQ_PARAM_ARCHIVE.static java.lang.StringREQ_PARAM_CURRENTREVISIONThe Constant REQ_PARAM_CURRENTREVISION.static java.lang.StringREQ_PARAM_ELEMENTThe Constant REQ_PARAM_ELEMENT.static java.lang.StringREQ_PARAM_EXTERNThe Constant REQ_PARAM_EXTERN.static java.lang.StringREQ_PARAM_FIELDThe Constant REQ_PARAM_FIELD.static java.lang.StringREQ_PARAM_FILENAMEThe Constant REQ_PARAM_FILENAME.static java.lang.StringREQ_PARAM_IDThe Constant REQ_PARAM_ID.static java.lang.StringREQ_PARAM_LINKstatic java.lang.StringREQ_PARAM_MANDANTThe Constant REQ_PARAM_MANDANT.static java.lang.StringREQ_PARAM_RELEASEDThe Constant REQ_PARAM_RELEASED.static java.lang.StringREQ_PARAM_SECUREThe Constant REQ_PARAM_SECURE.static java.lang.StringREQ_PARAM_TIMEOUTThe Constant REQ_PARAM_TIMEOUT.static java.lang.StringREQ_PARAM_ZIP_LINK
 - 
Constructor SummaryConstructors Constructor Description WeblinkUtil()
 - 
Method SummaryAll Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.Stringbookmark(java.util.List<java.lang.String> pathSegments, java.util.Map<java.lang.String,java.lang.String> queryParameter)Creates the Bookmark for the given pathSegments and queryParameters.static java.lang.Stringhash(java.lang.String url)Generates Hash.static java.lang.StringsecureBookmark(java.util.List<java.lang.String> pathSegments, java.util.Map<java.lang.String,java.lang.String> queryParameter)Generates a secure Bookmark.static java.lang.StringsecureURL(java.util.List<java.lang.String> pathSegments, java.util.Map<java.lang.String,java.lang.String> queryParameter)Generates a secure URL.static java.lang.StringsecureWeblink(java.lang.String archive, java.lang.String field, java.lang.String id, int element, java.lang.String filename, boolean published)Generates Secure weblink.static java.lang.StringsecureWeblink(java.lang.String archive, java.lang.String field, java.lang.String id, int element, java.lang.String filename, boolean published, boolean currentRevision, java.lang.String mandant, boolean extern, java.lang.Long timeout)Generates Secure weblink.static java.lang.Stringurl(java.util.List<java.lang.String> pathSegments, java.util.Map<java.lang.String,java.lang.String> queryParameter)Creates the URL for the given pathSegments and queryParameters.static booleanvalidate(java.lang.String url, java.lang.String hash, long timestamp)Validates the given URL.static java.lang.Stringweblink(java.lang.String archive, java.lang.String field, java.lang.String id, int element, java.lang.String filename, boolean published)generates a Weblink with the given paramters.
 
- 
- 
- 
Field Detail- 
REQ_PARAM_LINKpublic static final java.lang.String REQ_PARAM_LINK - See Also:
- Constant Field Values
 
 - 
REQ_PARAM_ZIP_LINKpublic static final java.lang.String REQ_PARAM_ZIP_LINK - See Also:
- Constant Field Values
 
 - 
REQ_PARAM_ARCHIVEpublic static final java.lang.String REQ_PARAM_ARCHIVE The Constant REQ_PARAM_ARCHIVE.- See Also:
- Constant Field Values
 
 - 
REQ_PARAM_FIELDpublic static final java.lang.String REQ_PARAM_FIELD The Constant REQ_PARAM_FIELD.- See Also:
- Constant Field Values
 
 - 
REQ_PARAM_IDpublic static final java.lang.String REQ_PARAM_ID The Constant REQ_PARAM_ID.- See Also:
- Constant Field Values
 
 - 
REQ_PARAM_ELEMENTpublic static final java.lang.String REQ_PARAM_ELEMENT The Constant REQ_PARAM_ELEMENT.- See Also:
- Constant Field Values
 
 - 
REQ_PARAM_FILENAMEpublic static final java.lang.String REQ_PARAM_FILENAME The Constant REQ_PARAM_FILENAME.- See Also:
- Constant Field Values
 
 - 
REQ_PARAM_RELEASEDpublic static final java.lang.String REQ_PARAM_RELEASED The Constant REQ_PARAM_RELEASED.- See Also:
- Constant Field Values
 
 - 
REQ_PARAM_SECUREpublic static final java.lang.String REQ_PARAM_SECURE The Constant REQ_PARAM_SECURE.- See Also:
- Constant Field Values
 
 - 
REQ_PARAM_MANDANTpublic static final java.lang.String REQ_PARAM_MANDANT The Constant REQ_PARAM_MANDANT.- See Also:
- Constant Field Values
 
 - 
REQ_PARAM_CURRENTREVISIONpublic static final java.lang.String REQ_PARAM_CURRENTREVISION The Constant REQ_PARAM_CURRENTREVISION.- See Also:
- Constant Field Values
 
 - 
REQ_PARAM_TIMEOUTpublic static final java.lang.String REQ_PARAM_TIMEOUT The Constant REQ_PARAM_TIMEOUT.- See Also:
- Constant Field Values
 
 - 
REQ_PARAM_EXTERNpublic static final java.lang.String REQ_PARAM_EXTERN The Constant REQ_PARAM_EXTERN.- See Also:
- Constant Field Values
 
 - 
ALL_ELEMENTpublic static final int ALL_ELEMENT - See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
validatepublic static boolean validate(java.lang.String url, java.lang.String hash, long timestamp)Validates the given URL.- Parameters:
- url- the url for validation
- hash- the hash for validation
- timestamp- the timestamp for validation
- Returns:
- true, if validation was successful
 
 - 
weblinkpublic static java.lang.String weblink(java.lang.String archive, java.lang.String field, java.lang.String id, int element, java.lang.String filename, boolean published)generates a Weblink with the given paramters. Format is "/weblink/{archive}/{field}/{id}/{element}/{filename}?released={published}"- Parameters:
- archive- the archive
- field- the field
- id- the id
- element- the element
- filename- the filename
- published- the published
- Returns:
- the string
 
 - 
secureWeblinkpublic static java.lang.String secureWeblink(java.lang.String archive, java.lang.String field, java.lang.String id, int element, java.lang.String filename, boolean published) throws LinkCreationExceptionGenerates Secure weblink. Format is "/weblink/{archive}/{field}/{id}/{element}/{filename}?released={published}&secure=[hash]"- Parameters:
- archive- the archive
- field- the field
- id- the id
- element- the element
- filename- the filename
- published- the published
- Returns:
- the Weblink as string
- Throws:
- LinkCreationException- the link creation exception
 
 - 
secureWeblinkpublic static java.lang.String secureWeblink(java.lang.String archive, java.lang.String field, java.lang.String id, int element, java.lang.String filename, boolean published, boolean currentRevision, java.lang.String mandant, boolean extern, java.lang.Long timeout) throws LinkCreationExceptionGenerates Secure weblink. Format is "/weblink/{archive}/{field}/{id}/{element}/{filename}?released={published}&mandant={mandant}¤tRevision={currentRevision}&released={released}&extern={extern}&timeout={timeout}&secure=[hash]"
 Parameter mandant, currentRevision, released, extern, timeout or only set in the URL when parameter is set or true.- Parameters:
- archive- the archive/DDC
- field- the DDC field
- id- the searched id of DDC field
- element- the element of the document
- filename- the filename
- published- true if only released version should be provided
- currentRevision- set to true for current revision
- mandant- the mandant
- extern- link for external user
- timeout- the expiration time in milliseconds.
- Returns:
- the Weblink as string
- Throws:
- LinkCreationException- the link creation exception
 
 - 
secureURLpublic static java.lang.String secureURL(java.util.List<java.lang.String> pathSegments, java.util.Map<java.lang.String,java.lang.String> queryParameter) throws LinkCreationExceptionGenerates a secure URL. Adds secure hash as parameter at the end of the URL.- Parameters:
- pathSegments- the path segments
- queryParameter- the query parameter
- Returns:
- the URL as string
- Throws:
- LinkCreationException- if link creation failed
 
 - 
urlpublic static java.lang.String url(java.util.List<java.lang.String> pathSegments, java.util.Map<java.lang.String,java.lang.String> queryParameter)Creates the URL for the given pathSegments and queryParameters.- Parameters:
- pathSegments- the path segments
- queryParameter- the query parameter
- Returns:
- the created URL as string
 
 - 
secureBookmarkpublic static java.lang.String secureBookmark(java.util.List<java.lang.String> pathSegments, java.util.Map<java.lang.String,java.lang.String> queryParameter) throws LinkCreationExceptionGenerates a secure Bookmark. Adds secure hash as parameter at the end of the Bookmark.- Parameters:
- pathSegments- the path segments
- queryParameter- the query parameter
- Returns:
- the bookmark as string
- Throws:
- LinkCreationException- if link creation failed
 
 - 
bookmarkpublic static java.lang.String bookmark(java.util.List<java.lang.String> pathSegments, java.util.Map<java.lang.String,java.lang.String> queryParameter)Creates the Bookmark for the given pathSegments and queryParameters.- Parameters:
- pathSegments- the path segments
- queryParameter- the query parameter
- Returns:
- the created Bookmark as string
 
 - 
hashpublic static java.lang.String hash(java.lang.String url) throws LinkCreationExceptionGenerates Hash. Computes the crypted hash for given url with internal .- Parameters:
- url- the url to generate hash.
- Returns:
- the computed hash as string
- Throws:
- LinkCreationException- the link creation exception
 
 
- 
 
-