Class WeblinkHandler
java.lang.Object
com.saperion.ngc.portal.builder.weblink.WeblinkHandler
- All Implemented Interfaces:
ElementBuilder,LinkBuilder,NamedBuilder,OptionsBuilder,WithBuilder
public class WeblinkHandler
extends Object
implements WithBuilder, ElementBuilder, NamedBuilder, OptionsBuilder
The Class WeblinkHandler. Fluent API to create Weblink URL.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionall()All.voidCopy.external()External.static WithBuilderStatic Weblink constructor.latest()Latest.static voidThe main method.Mandant.Named.only(int element) Only.voidOpen.Published.timeout(long timeout) Timeout.To link.static ElementBuilderwith(DocumentId documentId, jakarta.servlet.http.HttpServletRequest request) Static Weblink constructor used by SAP Viewer.static ElementBuilderwith(ResultProperties document) Static Weblink constructor.With.
-
Constructor Details
-
WeblinkHandler
public WeblinkHandler()
-
-
Method Details
-
from
Static Weblink constructor.- Parameters:
archive- the archive / DDC of document- Returns:
- the with builder
-
with
public static ElementBuilder with(ResultProperties document) throws com.saperion.util.LinkCreationException Static Weblink constructor. Uses the given ResultProperties to set the parameters filename, archive, id and field. Field is set to SYSROWID.- Parameters:
document- the document properties seeResultProperties.- Returns:
- the element builder to add options see
ElementBuilder - Throws:
com.saperion.util.LinkCreationException- the link creation exception if link creation fails
-
with
public static ElementBuilder with(DocumentId documentId, jakarta.servlet.http.HttpServletRequest request) throws com.saperion.util.LinkCreationException Static Weblink constructor used by SAP Viewer. Field is set to SYSROWID.- Parameters:
documentId- the id of the document to sendrequest- current request to get session- Returns:
- the element builder to add options see
ElementBuilder - Throws:
com.saperion.util.LinkCreationException- the link creation exception if link creation fails
-
with
With. Option to add value of field.- Specified by:
within interfaceWithBuilder- Parameters:
field- the fieldvalue- the value- Returns:
- the element builder
- See Also:
-
only
Only. Option to add if only one specific element of document should be downloaded.- Specified by:
onlyin interfaceElementBuilder- Parameters:
element- the element- Returns:
- the named builder
- See Also:
-
all
All. Option to add if all elements of document should be downloaded as a zip file.- Specified by:
allin interfaceElementBuilder- Returns:
- the named builder
- See Also:
-
named
Named. To add if Weblink download should have a filename.- Specified by:
namedin interfaceNamedBuilder- Parameters:
filename- the filename of downloaded file- Returns:
- the options builder
- See Also:
-
mandant
Mandant.- Specified by:
mandantin interfaceOptionsBuilder- Parameters:
mandant- the mandant- Returns:
- the options builder
-
published
Published. Option to add if last released document should be shown.- Specified by:
publishedin interfaceOptionsBuilder- Returns:
- the options builder
- See Also:
-
latest
Latest. Option to add current revision of document should be shown.- Specified by:
latestin interfaceOptionsBuilder- Returns:
- the options builder
- See Also:
-
external
External. Option to add if link should be usable for extern users.- Specified by:
externalin interfaceOptionsBuilder- Returns:
- the options builder
- See Also:
-
timeout
Timeout. Option to add if link should have a timeout. After timeout milliseconds the link is no more valid.- Specified by:
timeoutin interfaceOptionsBuilder- Parameters:
timeout- the timeout in milliseconds after the link is invalid- Returns:
- the options builder
- See Also:
-
toLink
To link. Builds the weblink url with given baseURL.- Specified by:
toLinkin interfaceLinkBuilder- Parameters:
baseURL- the base url- Returns:
- the string
- Throws:
com.saperion.util.LinkCreationException- the link creation exception- See Also:
-
open
Open.- Specified by:
openin interfaceLinkBuilder- Parameters:
baseURL- the base url- See Also:
-
copy
Copy.- Specified by:
copyin interfaceLinkBuilder- Parameters:
baseURL- the base url- See Also:
-
main
The main method.- Parameters:
args- the arguments- Throws:
com.saperion.util.LinkCreationException- the link creation exception
-