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.void
Copy.external()
External.static WithBuilder
Static Weblink constructor.latest()
Latest.static void
The main method.Mandant.Named.only
(int element) Only.void
Open.Published.timeout
(long timeout) Timeout.To link.static ElementBuilder
with
(DocumentId documentId, jakarta.servlet.http.HttpServletRequest request) Static Weblink constructor used by SAP Viewer.static ElementBuilder
with
(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:
with
in 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:
only
in 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:
all
in interfaceElementBuilder
- Returns:
- the named builder
- See Also:
-
named
Named. To add if Weblink download should have a filename.- Specified by:
named
in interfaceNamedBuilder
- Parameters:
filename
- the filename of downloaded file- Returns:
- the options builder
- See Also:
-
mandant
Mandant.- Specified by:
mandant
in interfaceOptionsBuilder
- Parameters:
mandant
- the mandant- Returns:
- the options builder
-
published
Published. Option to add if last released document should be shown.- Specified by:
published
in interfaceOptionsBuilder
- Returns:
- the options builder
- See Also:
-
latest
Latest. Option to add current revision of document should be shown.- Specified by:
latest
in interfaceOptionsBuilder
- Returns:
- the options builder
- See Also:
-
external
External. Option to add if link should be usable for extern users.- Specified by:
external
in 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:
timeout
in 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:
toLink
in interfaceLinkBuilder
- Parameters:
baseURL
- the base url- Returns:
- the string
- Throws:
com.saperion.util.LinkCreationException
- the link creation exception- See Also:
-
open
Open.- Specified by:
open
in interfaceLinkBuilder
- Parameters:
baseURL
- the base url- See Also:
-
copy
Copy.- Specified by:
copy
in 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
-