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 URIformProvide(long projectId, boolean replaceEntityReferences)URIgetBaseUrl()booleanisFormContext(URI url)booleanisFormPreview(URI url)booleanisFormProcess(URI url)booleanisFormProvide(URI url)booleanisFormReview(URI url)booleanisFormVerify(URI url)URIreplaceBaseUrl(URI url, URI oldBaseUrl, URI newBaseUrl)If the URL starts with the base URL, replaces the base URL with the new base URL.URIreplaceEntityReferences(URI url)Replaces all entity references in the given URL.URIsetFormProvideLangIfMissing(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:
formProvidein 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:
getBaseUrlin interfaceIFormcycleUriManager- Returns:
- The base URL to the running FORMCYCLE system.
-
isFormPreview
public boolean isFormPreview(URI url)
- Specified by:
isFormPreviewin 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:
isFormProcessin 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:
isFormProvidein 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:
isFormReviewin 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:
isFormContextin interfaceIFormcycleUriManager- Parameters:
url- URL to check.- Returns:
- Whether the URL is a FORMCYCLE form URL such as
/form/provide,/form/process,/form/review,/form/previewetc.
-
isFormVerify
public boolean isFormVerify(URI url)
- Specified by:
isFormVerifyin 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:IFormcycleUriManagerIf the URL starts with the base URL, replaces the base URL with the new base URL.- Specified by:
replaceBaseUrlin 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:IFormcycleUriManagerReplaces all entity references in the given URL. For example, the project ID [@code 431} inform/provide/431is 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:
replaceEntityReferencesin 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:IFormcycleUriManagerSets the language parameter on a form provide URL.- Specified by:
setFormProvideLangIfMissingin 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.
-
-