Package com.saperion.util
Class WeblinkUtil
java.lang.Object
com.saperion.util.WeblinkUtil
The Class WeblinkUtil.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final String
The Constant REQ_PARAM_ARCHIVE.static final String
The Constant REQ_PARAM_CURRENTREVISION.static final String
The Constant REQ_PARAM_ELEMENT.static final String
The Constant REQ_PARAM_EXTERN.static final String
The Constant REQ_PARAM_FIELD.static final String
The Constant REQ_PARAM_FILENAME.static final String
The Constant REQ_PARAM_ID.static final String
static final String
The Constant REQ_PARAM_MANDANT.static final String
The Constant REQ_PARAM_RELEASED.static final String
The Constant REQ_PARAM_SECURE.static final String
The Constant REQ_PARAM_TIMEOUT.static final String
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String
Creates the Bookmark for the given pathSegments and queryParameters.static String
Generates Hash.static String
Generates a secure Bookmark.static String
Generates a secure URL.static String
secureWeblink
(String archive, String field, String id, int element, String filename, boolean published) Generates Secure weblink.static String
secureWeblink
(String archive, String field, String id, int element, String filename, boolean published, boolean currentRevision, String mandant, boolean extern, Long timeout) Generates Secure weblink.static String
Creates the URL for the given pathSegments and queryParameters.static boolean
Validates the given URL.static String
generates a Weblink with the given paramters.
-
Field Details
-
REQ_PARAM_LINK
- See Also:
-
REQ_PARAM_ZIP_LINK
- See Also:
-
REQ_PARAM_ARCHIVE
The Constant REQ_PARAM_ARCHIVE.- See Also:
-
REQ_PARAM_FIELD
The Constant REQ_PARAM_FIELD.- See Also:
-
REQ_PARAM_ID
The Constant REQ_PARAM_ID.- See Also:
-
REQ_PARAM_ELEMENT
The Constant REQ_PARAM_ELEMENT.- See Also:
-
REQ_PARAM_FILENAME
The Constant REQ_PARAM_FILENAME.- See Also:
-
REQ_PARAM_RELEASED
The Constant REQ_PARAM_RELEASED.- See Also:
-
REQ_PARAM_SECURE
The Constant REQ_PARAM_SECURE.- See Also:
-
REQ_PARAM_MANDANT
The Constant REQ_PARAM_MANDANT.- See Also:
-
REQ_PARAM_CURRENTREVISION
The Constant REQ_PARAM_CURRENTREVISION.- See Also:
-
REQ_PARAM_TIMEOUT
The Constant REQ_PARAM_TIMEOUT.- See Also:
-
REQ_PARAM_EXTERN
The Constant REQ_PARAM_EXTERN.- See Also:
-
ALL_ELEMENT
public static final int ALL_ELEMENT- See Also:
-
-
Constructor Details
-
WeblinkUtil
public WeblinkUtil()
-
-
Method Details
-
validate
Validates the given URL.- Parameters:
url
- the url for validationhash
- the hash for validationtimestamp
- the timestamp for validation- Returns:
- true, if validation was successful
-
weblink
public static String weblink(String archive, String field, String id, int element, String filename, boolean published) generates a Weblink with the given paramters. Format is "/weblink/{archive}/{field}/{id}/{element}/{filename}?released={published}"- Parameters:
archive
- the archivefield
- the fieldid
- the idelement
- the elementfilename
- the filenamepublished
- the published- Returns:
- the string
-
secureWeblink
public static String secureWeblink(String archive, String field, String id, int element, String filename, boolean published) throws LinkCreationException Generates Secure weblink. Format is "/weblink/{archive}/{field}/{id}/{element}/{filename}?released={published}&secure=[hash]"- Parameters:
archive
- the archivefield
- the fieldid
- the idelement
- the elementfilename
- the filenamepublished
- the published- Returns:
- the Weblink as string
- Throws:
LinkCreationException
- the link creation exception
-
secureWeblink
public static String secureWeblink(String archive, String field, String id, int element, String filename, boolean published, boolean currentRevision, String mandant, boolean extern, Long timeout) throws LinkCreationException Generates 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/DDCfield
- the DDC fieldid
- the searched id of DDC fieldelement
- the element of the documentfilename
- the filenamepublished
- true if only released version should be providedcurrentRevision
- set to true for current revisionmandant
- the mandantextern
- link for external usertimeout
- the expiration time in milliseconds.- Returns:
- the Weblink as string
- Throws:
LinkCreationException
- the link creation exception
-
secureURL
public static String secureURL(List<String> pathSegments, Map<String, String> queryParameter) throws LinkCreationExceptionGenerates a secure URL. Adds secure hash as parameter at the end of the URL.- Parameters:
pathSegments
- the path segmentsqueryParameter
- the query parameter- Returns:
- the URL as string
- Throws:
LinkCreationException
- if link creation failed
-
url
Creates the URL for the given pathSegments and queryParameters.- Parameters:
pathSegments
- the path segmentsqueryParameter
- the query parameter- Returns:
- the created URL as string
-
secureBookmark
public static String secureBookmark(List<String> pathSegments, Map<String, String> queryParameter) throws LinkCreationExceptionGenerates a secure Bookmark. Adds secure hash as parameter at the end of the Bookmark.- Parameters:
pathSegments
- the path segmentsqueryParameter
- the query parameter- Returns:
- the bookmark as string
- Throws:
LinkCreationException
- if link creation failed
-
bookmark
Creates the Bookmark for the given pathSegments and queryParameters.- Parameters:
pathSegments
- the path segmentsqueryParameter
- the query parameter- Returns:
- the created Bookmark as string
-
hash
Generates 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
-