Package de.xima.fc.e2e.environment.impl
Class FormcycleUriManager
- java.lang.Object
-
- de.xima.fc.e2e.environment.impl.FormcycleUriManager
-
- All Implemented Interfaces:
IFormcycleUriManager
public final class FormcycleUriManager extends Object implements IFormcycleUriManager
Manages URLs as used by the FORMCYCLE app.- Author:
- XIMA MEDIA GmbH
-
-
Constructor Summary
Constructors Constructor Description FormcycleUriManager(URI baseUrl, FormcycleSetupResult setupResult)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description URI
formProvide(long projectId, boolean replaceEntityReferences)
URI
getBaseUrl()
boolean
isFormContext(URI url)
boolean
isFormPreview(URI url)
boolean
isFormProcess(URI url)
boolean
isFormProvide(URI url)
boolean
isFormReview(URI url)
boolean
isFormVerify(URI url)
URI
replaceBaseUrl(URI url, URI oldBaseUrl, URI newBaseUrl)
If the URL starts with the base URL, replaces the base URL with the new base URL.URI
replaceEntityReferences(URI url)
Replaces all entity references in the given URL.URI
setFormProvideLangIfMissing(URI uri, String newLanguage)
Sets the language parameter on a form provide URL.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.xima.fc.e2e.environment.api.IFormcycleUriManager
formProvide, formProvideUrl, formProvideUrl, removeBaseUrl, replaceBaseUrl
-
-
-
-
Constructor Detail
-
FormcycleUriManager
public FormcycleUriManager(URI baseUrl, FormcycleSetupResult setupResult)
- Parameters:
baseUrl
- Base URL of the FORMCYCLE app.setupResult
- Result of running the test setup.
-
-
Method Detail
-
formProvide
public URI formProvide(long projectId, boolean replaceEntityReferences)
- Specified by:
formProvide
in interfaceIFormcycleUriManager
- Parameters:
projectId
- ID of a project.replaceEntityReferences
- Iftrue
, process newly created URL viaIFormcycleUriManager.replaceEntityReferences(URI)
.- Returns:
- The form provide URL for the given project, which uses the current FORMCYCLE base URL.
-
getBaseUrl
public URI getBaseUrl()
- Specified by:
getBaseUrl
in interfaceIFormcycleUriManager
- Returns:
- The base URL to the running FORMCYCLE system.
-
isFormPreview
public boolean isFormPreview(URI url)
- Specified by:
isFormPreview
in interfaceIFormcycleUriManager
- Parameters:
url
- URL to check.- Returns:
- Whether the URL is a FORMCYCLE form preview URL (
/form/preview
).
-
isFormProcess
public boolean isFormProcess(URI url)
- Specified by:
isFormProcess
in interfaceIFormcycleUriManager
- Parameters:
url
- URL to check.- Returns:
- Whether the URL is a FORMCYCLE form process URL (
/form/process
).
-
isFormProvide
public boolean isFormProvide(URI url)
- Specified by:
isFormProvide
in interfaceIFormcycleUriManager
- Parameters:
url
- URL to check.- Returns:
- Whether the URL is a FORMCYCLE form provide URL (
/form/provide
).
-
isFormReview
public boolean isFormReview(URI url)
- Specified by:
isFormReview
in interfaceIFormcycleUriManager
- Parameters:
url
- URL to check.- Returns:
- Whether the URL is a FORMCYCLE form review URL (
/form/review
).
-
isFormContext
public boolean isFormContext(URI url)
- Specified by:
isFormContext
in interfaceIFormcycleUriManager
- Parameters:
url
- URL to check.- Returns:
- Whether the URL is a FORMCYCLE form URL such as
/form/provide
,/form/process
,/form/review
,/form/preview
etc.
-
isFormVerify
public boolean isFormVerify(URI url)
- Specified by:
isFormVerify
in interfaceIFormcycleUriManager
- Parameters:
url
- URL to check.- Returns:
- Whether the URL is a FORMCYCLE form verify URL (
/form/verify
).
-
replaceBaseUrl
public URI replaceBaseUrl(URI url, URI oldBaseUrl, URI newBaseUrl)
Description copied from interface:IFormcycleUriManager
If the URL starts with the base URL, replaces the base URL with the new base URL.- Specified by:
replaceBaseUrl
in interfaceIFormcycleUriManager
- Parameters:
url
- URL to process.oldBaseUrl
- Old expected base URL of the URL.newBaseUrl
- New base URL to use.- Returns:
- The given URL, with the base URL replaced with the new base URL.
-
replaceEntityReferences
public URI replaceEntityReferences(URI url)
Description copied from interface:IFormcycleUriManager
Replaces all entity references in the given URL. For example, the project ID [@code 431} inform/provide/431
is replaced with the new project ID (from when the client was created). This requires that a setup method was used that supports entity reference mapping.- Specified by:
replaceEntityReferences
in interfaceIFormcycleUriManager
- Parameters:
url
- URL to process.- Returns:
- The URL with all entity references replaced.
-
setFormProvideLangIfMissing
public URI setFormProvideLangIfMissing(URI uri, String newLanguage)
Description copied from interface:IFormcycleUriManager
Sets the language parameter on a form provide URL.- Specified by:
setFormProvideLangIfMissing
in interfaceIFormcycleUriManager
- Parameters:
uri
- URL to adjust.newLanguage
- New language.- Returns:
- The URL with the language parameter set, or the given URL without changes when the language parameter is set already.
-
-