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 OptionsBuilder
all()
All.void
copy(java.lang.String baseURL)
Copy.OptionsBuilder
external()
External.static WithBuilder
from(java.lang.String archive)
Static Weblink constructor.OptionsBuilder
latest()
Latest.static void
main(java.lang.String[] args)
The main method.OptionsBuilder
mandant(java.lang.String mandant)
Mandant.ElementBuilder
named(java.lang.String filename)
Named.OptionsBuilder
only(int element)
Only.void
open(java.lang.String baseURL)
Open.OptionsBuilder
published()
Published.OptionsBuilder
timeout(long timeout)
Timeout.java.lang.String
toLink(java.lang.String baseURL)
To link.static ElementBuilder
with(DocumentId documentId, javax.servlet.http.HttpServletRequest request)
Static Weblink constructor used by SAP Viewer.static ElementBuilder
with(ResultProperties document)
Static Weblink constructor.NamedBuilder
with(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:
with
in 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:
only
in 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:
all
in 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:
named
in 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:
mandant
in 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:
published
in 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:
latest
in 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:
external
in 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:
timeout
in 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.LinkCreationException
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:
LinkBuilder.toLink(java.lang.String)
-
open
public void open(java.lang.String baseURL)
Open.- Specified by:
open
in interfaceLinkBuilder
- Parameters:
baseURL
- the base url- See Also:
LinkBuilder.open(java.lang.String)
-
copy
public void copy(java.lang.String baseURL)
Copy.- Specified by:
copy
in 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.LinkCreationException
The main method.- Parameters:
args
- the arguments- Throws:
com.saperion.util.LinkCreationException
- the link creation exception
-
-