Constructor and Description |
---|
PathInfo(String host,
String domain,
String currentSite,
String servletPath,
String guiPath,
String servicePath,
List<String> blobDirectories,
List<String> documentDirectories,
String repositoryPath,
String extension)
Creates a new
PathInfo |
Modifier and Type | Method and Description |
---|---|
void |
checkPathLength(int minLength)
Checks whether this
Path has the given minimum number of elements and throws an IOException
otherwise |
String |
getActionName()
Returns the name of the currently selected action, if present
|
String |
getActionValue()
Returns the value of the currently selected action, if present
|
int |
getApplicationIndex()
Return the index of the element representing the
Application name |
String |
getApplicationName()
Returns the name of the
Application which is being addressed by this Path |
List<String> |
getApplicationUrlParameters()
|
List<String> |
getBlobDirectories()
|
String |
getCurrentPath()
Returns the current path to the application, e.g.
|
List<String> |
getDocumentDirectories()
Returns a
List of all document directories, which contain the JSP-files |
String |
getDomain()
Returns the domain of the currently selected
Site , if present |
String |
getElementAt(int idx)
Returns the element at index
idx , if present |
int |
getElementCount()
Returns the number of elements of this
Path |
String |
getExtension()
Returns the file-extension for JSP-files
|
String |
getForwardPath(String wwwRootPath,
File wwwRootFile)
Builds the the path to which a
HttpServletRequest has to be forwarded to in order the retrieve a file
from a document directory. |
String |
getGuiPath()
Returns the path to the appNG webapplication.
|
String |
getHost()
Returns the host of the currently selected
Site , if present |
List<String> |
getJspUrlParameters()
Returns a
List containing the values of the JSP-Paramters of a JSP-call. |
String |
getLastElement()
Returns the last element of this
Path . |
String |
getOutputFormat()
Returns the ID of
OutputFormat .An OutputFormat may be defined by adding _<format> after the gui-path, e.g. |
String |
getOutputPrefix()
Returns the path prefix that contains the
OutputFormat and OutputType , if those are set. |
String |
getOutputType()
Returns the ID of
OutputType .An OutputType may be defined by adding _<type> after the output-format, e.g. |
String |
getPage()
Returns the name of the currently selected page, if present
|
String |
getPlatformUrl()
Returns the complete absolute URL this
Path represents, which is the Site s domain plus the
servlet-path |
String |
getRootPath()
Returns the root-path of this
Path , which is the first element, or / if there is no first element |
String |
getService()
Return the name of the service addressed by this
Path |
String |
getServicePath()
Returns the path element that addresses a service
|
String |
getServletPath()
Returns the complete servlet-path this
Path was built from |
String |
getSiteName()
Returns the name of the
Site which is being addressed by this Path |
boolean |
hasAction()
Checks whether this
Path has an action selected |
boolean |
hasApplication()
Checks whether this
Path contains an element determining the current Application |
boolean |
hasElementAt(int idx)
Returns
true if this Path has an elements at index idx . |
boolean |
hasOutputFormat()
Checks whether this
Path has an OutputFormat set. |
boolean |
hasOutputType()
Checks whether this
Path has an OutputType set. |
boolean |
hasSite()
Checks whether this
Path contains an element determining the current Site |
boolean |
isDocument()
Checks whether this
Path represents a document from a document-folder. |
boolean |
isGui()
Checks whether this
Path represents a call to the appNG webapplication GUI |
boolean |
isJsp()
Checks whether this
Path represents the call of a JSP file. |
boolean |
isPathSelected(String path)
Checks whether the given
servletPath is being addressed by this Path , which basically means the
servlet-path represented by this Path must start with the given servletPath . |
boolean |
isRepository()
Checks whether this
Path represents the repository-folder of appNG |
boolean |
isRoot()
Checks whether this
Path represents the root-path |
boolean |
isRootIgnoreTrailingSlash() |
boolean |
isService()
Checks whether this
Path represents a call to a service (Webservice /AttachmentWebservice ,
SoapService or an XML/JSON call of an ActionProvider or DataProvider . |
boolean |
isStaticContent()
Checks whether this
Path represents a static resource from a blob-directory |
void |
setAction(String actionName,
String actionValue)
Manually sets the name and value for an action within a
Application |
void |
setApplicationName(String application)
Manually sets the name of the selected
Application |
void |
setPage(String page)
Manually sets the page within a
Application |
public PathInfo(String host, String domain, String currentSite, String servletPath, String guiPath, String servicePath, List<String> blobDirectories, List<String> documentDirectories, String repositoryPath, String extension)
PathInfo
host
- the host of the current Site
domain
- the domain of the current Site
currentSite
- the name of the current Site
servletPath
- the current servletPath, as returned by HttpServletRequest.getServletPath()
guiPath
- value of the property "manager-path" of the current
Site
servicePath
- value of the property "service-path" of the current
Site
blobDirectories
- a list parsed from the property "assetsDir" of the current
Site
documentDirectories
- a list parsed from the property "documentDir" of the current
Site
repositoryPath
- value of the platform property "repositoryPath"extension
- value of the platform property "jspFileType"public boolean hasElementAt(int idx)
Path
true
if this Path
has an elements at index idx
.hasElementAt
in interface Path
idx
- the zero-based index to checktrue
if there is such a path element,false
otherwisepublic String getLastElement()
Path
Path
.getLastElement
in interface Path
public String getElementAt(int idx)
Path
idx
, if presentgetElementAt
in interface Path
idx
- the zero-based indexnull
if no such element existspublic void checkPathLength(int minLength) throws IOException
Path
Path
has the given minimum number of elements and throws an IOException
otherwisecheckPathLength
in interface Path
minLength
- the minimum length to checkIOException
- if this Path
does not have the required minimum lengthpublic boolean isStaticContent()
Path
Path
represents a static resource from a blob-directoryisStaticContent
in interface Path
true
if this Path
represents a static resource, false
otherwisePath.getBlobDirectories()
public boolean isDocument()
Path
Path
represents a document from a document-folder.isDocument
in interface Path
true
if this Path
represents a JSP file from a document-folder, false
otherwisePath.getDocumentDirectories()
public boolean isGui()
Path
Path
represents a call to the appNG webapplication GUIisGui
in interface Path
true
if this Path
represents a call to the appNG webapplication GUI, false
otherwisePath.getGuiPath()
public boolean isService()
Path
Path
represents a call to a service (Webservice
/AttachmentWebservice
,
SoapService
or an XML/JSON call of an ActionProvider
or DataProvider
.public boolean isJsp()
Path
Path
represents the call of a JSP file.isJsp
in interface Path
true
if this Path
represents the call of a JSP file, false
otherwisePath.getExtension()
,
Path.isDocument()
public String getSiteName()
Path
Site
which is being addressed by this Path
getSiteName
in interface Path
Path.hasSite()
public boolean hasSite()
Path
Path
contains an element determining the current Site
public void setApplicationName(String application)
Application
application
- the name of the Application
public String getApplicationName()
Path
Application
which is being addressed by this Path
getApplicationName
in interface Path
Path.hasApplication()
public boolean hasApplication()
Path
Path
contains an element determining the current Application
hasApplication
in interface Path
true
if this Path
contains an element determining the current Application
,
false
otherwisepublic void setPage(String page)
Application
page
- the page to setpublic String getPage()
Path
getPage
in interface Path
null
if no page is selectedPath.isGui()
public void setAction(String actionName, String actionValue)
Application
actionName
- the name of the actionactionValue
- the value for the actionpublic String getActionName()
Path
getActionName
in interface Path
null
if no action is selectedPath.isGui()
,
Path.getActionValue()
public String getActionValue()
Path
getActionValue
in interface Path
null
if no action is selectedPath.isGui()
,
Path.getActionName()
public boolean hasAction()
Path
Path
has an action selectedhasAction
in interface Path
true
if this Path
, false
otherwisePath.getActionName()
,
Path.getActionValue()
public List<String> getApplicationUrlParameters()
Path
getApplicationUrlParameters
in interface Path
List
of parameter valuesPath.isGui()
,
Path.isService()
public List<String> getJspUrlParameters()
Path
List
containing the values of the JSP-Paramters of a JSP-call. Every parameter after the JSPs
name is a JSP-Parameter. For example, if the current servletpath is /en/index/foo/bar
, with en
being a document folder and index
the JSP name, the list will contain "foo"
and "bar"
.getJspUrlParameters
in interface Path
List
of parameter valuesPath.isJsp()
public String getRootPath()
Path
Path
, which is the first element, or /
if there is no first elementgetRootPath
in interface Path
public String getHost()
Path
Site
, if presentgetHost
in interface Path
Site
Path.hasSite()
,
Site.getHost()
public String getDomain()
Path
Site
, if presentgetDomain
in interface Path
Site
Path.hasSite()
,
Site.getDomain()
public String getServletPath()
Path
Path
was built fromgetServletPath
in interface Path
public String getCurrentPath()
Path
/manager/mysite/myapp
getCurrentPath
in interface Path
public boolean isRoot()
Path
Path
represents the root-pathisRoot
in interface Path
true
if this Path
represents the root-path, false
otherwisePath.getRootPath()
public boolean isRootIgnoreTrailingSlash()
public boolean isRepository()
Path
Path
represents the repository-folder of appNGisRepository
in interface Path
true
if this Path
represents the repository-folder of appNG, false
otherwisepublic String getGuiPath()
Path
getGuiPath
in interface Path
Path.isGui()
public List<String> getBlobDirectories()
Path
getBlobDirectories
in interface Path
List
of all blob directoriespublic List<String> getDocumentDirectories()
Path
List
of all document directories, which contain the JSP-filesgetDocumentDirectories
in interface Path
List
of all document directoriesPath.isDocument()
,
Path.isJsp()
public String getPlatformUrl()
Path
Path
represents, which is the Site
s domain plus the
servlet-pathgetPlatformUrl
in interface Path
Path.getDomain()
,
Path.getServletPath()
public String getOutputFormat()
Path
OutputFormat
.OutputFormat
may be defined by adding _<format>
after the gui-path, e.g.
/ws/_html/site/application/page
.getOutputFormat
in interface Path
OutputFormat
, if presentPath.isGui()
public String getOutputType()
Path
OutputType
.OutputType
may be defined by adding _<type>
after the output-format, e.g.
/ws/_html/_minimal/site/application/page
.getOutputType
in interface Path
OutputType
, if presentPath.isGui()
,
Path.getOutputFormat()
public boolean hasOutputFormat()
Path
Path
has an OutputFormat
set.hasOutputFormat
in interface Path
true
if this Path
has an OutputFormat
set, false
otherwisePath.getOutputFormat()
public boolean hasOutputType()
Path
Path
has an OutputType
set.hasOutputType
in interface Path
true
if this Path
has an OutputType
set, false
otherwisePath.getOutputType()
public String getService()
Path
Path
getService
in interface Path
Path.isService()
,
Path.getServicePath()
public String getServicePath()
Path
getServicePath
in interface Path
Path.isService()
,
Path.getService()
public boolean isPathSelected(String path)
Path
servletPath
is being addressed by this Path
, which basically means the
servlet-path represented by this Path
must start with the given servletPath
.isPathSelected
in interface Path
path
- the servlet-path to checktrue
if this Path
, false
otherwisePath.getServletPath()
public String getOutputPrefix()
Path
OutputFormat
and OutputType
, if those are set.getOutputPrefix
in interface Path
Path.getOutputFormat()
,
Path.getOutputType()
public String getExtension()
Path
getExtension
in interface Path
Path.isJsp()
public String getForwardPath(String wwwRootPath, File wwwRootFile)
HttpServletRequest
has to be forwarded to in order the retrieve a file
from a document directory. If the requested fiel is a JSP, the JSP Url-Parameters are being initialized.wwwRootPath
- the relative path to a Site
s web-folder, under which the document-folders residewwwRootFile
- a file representing the very same relative pathisDocument()
,
getDocumentDirectories()
,
isJsp()
public int getApplicationIndex()
Path
Application
namegetApplicationIndex
in interface Path
Application
namePath.getApplicationName()
,
Path.hasApplication()
,
Path.getElementAt(int)
public int getElementCount()
Path
Path
getElementCount
in interface Path
Copyright © 2011–2018 aiticon GmbH. All rights reserved.