Class WeblinkHandler
- java.lang.Object
-
- com.saperion.ngc.portal.builder.weblink.WeblinkHandler
-
- All Implemented Interfaces:
ElementBuilder,LinkBuilder,NamedBuilder,OptionsBuilder,WithBuilder
public class WeblinkHandler extends java.lang.Object implements WithBuilder, ElementBuilder, NamedBuilder, OptionsBuilder
The Class WeblinkHandler. Fluent API to create Weblink URL.
-
-
Constructor Summary
Constructors Constructor Description WeblinkHandler()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description OptionsBuilderall()All.voidcopy(java.lang.String baseURL)Copy.OptionsBuilderexternal()External.static WithBuilderfrom(java.lang.String archive)Static Weblink constructor.OptionsBuilderlatest()Latest.static voidmain(java.lang.String[] args)The main method.OptionsBuildermandant(java.lang.String mandant)Mandant.ElementBuildernamed(java.lang.String filename)Named.OptionsBuilderonly(int element)Only.voidopen(java.lang.String baseURL)Open.OptionsBuilderpublished()Published.OptionsBuildertimeout(long timeout)Timeout.java.lang.StringtoLink(java.lang.String baseURL)To link.static ElementBuilderwith(DocumentId documentId, javax.servlet.http.HttpServletRequest request)Static Weblink constructor used by SAP Viewer.static ElementBuilderwith(ResultProperties document)Static Weblink constructor.NamedBuilderwith(java.lang.String field, java.lang.String value)With.
-
-
-
Method Detail
-
from
public static WithBuilder from(java.lang.String archive)
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, javax.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
public NamedBuilder with(java.lang.String field, java.lang.String value)
With. Option to add value of field.- Specified by:
within interfaceWithBuilder- Parameters:
field- the fieldvalue- the value- Returns:
- the element builder
- See Also:
WithBuilder.with(java.lang.String, java.lang.String)
-
only
public OptionsBuilder only(int element)
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:
ElementBuilder.only(int)
-
all
public OptionsBuilder 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:
ElementBuilder.all()
-
named
public ElementBuilder named(java.lang.String filename)
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:
NamedBuilder.named(java.lang.String)
-
mandant
public OptionsBuilder mandant(java.lang.String mandant)
Mandant.- Specified by:
mandantin interfaceOptionsBuilder- Parameters:
mandant- the mandant- Returns:
- the options builder
-
published
public OptionsBuilder published()
Published. Option to add if last released document should be shown.- Specified by:
publishedin interfaceOptionsBuilder- Returns:
- the options builder
- See Also:
OptionsBuilder.published()
-
latest
public OptionsBuilder latest()
Latest. Option to add current revision of document should be shown.- Specified by:
latestin interfaceOptionsBuilder- Returns:
- the options builder
- See Also:
OptionsBuilder.latest()
-
external
public OptionsBuilder external()
External. Option to add if link should be usable for extern users.- Specified by:
externalin interfaceOptionsBuilder- Returns:
- the options builder
- See Also:
OptionsBuilder.external()
-
timeout
public OptionsBuilder timeout(long 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:
OptionsBuilder.timeout(long)
-
toLink
public java.lang.String toLink(java.lang.String baseURL) throws com.saperion.util.LinkCreationExceptionTo 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:
LinkBuilder.toLink(java.lang.String)
-
open
public void open(java.lang.String baseURL)
Open.- Specified by:
openin interfaceLinkBuilder- Parameters:
baseURL- the base url- See Also:
LinkBuilder.open(java.lang.String)
-
copy
public void copy(java.lang.String baseURL)
Copy.- Specified by:
copyin interfaceLinkBuilder- Parameters:
baseURL- the base url- See Also:
LinkBuilder.copy(java.lang.String)
-
main
public static void main(java.lang.String[] args) throws com.saperion.util.LinkCreationExceptionThe main method.- Parameters:
args- the arguments- Throws:
com.saperion.util.LinkCreationException- the link creation exception
-
-