Package org.appng.api
Interface Path
-
- All Known Implementing Classes:
PathInfo
public interface Path
APath
provides informations about theSite
to which the currentHttpServletRequest
belongs to. Therefore, the servlet-path returned byHttpServletRequest.getServletPath()
is split into path-elements using/
as a separator.- Author:
- Matthias Müller
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description void
checkPathLength(int minLength)
Checks whether thisPath
has the given minimum number of elements and throws anIOException
otherwiseString
getActionName()
Returns the name of the currently selected action, if presentString
getActionValue()
Returns the value of the currently selected action, if presentint
getApplicationIndex()
Return the index of the element representing theApplication
nameString
getApplicationName()
Returns the name of theApplication
which is being addressed by thisPath
List<String>
getApplicationUrlParameters()
List<String>
getBlobDirectories()
String
getCurrentPath()
Returns the current path to the application, e.g.List<String>
getDocumentDirectories()
Returns aList
of all document directories, which contain the JSP-filesString
getDomain()
Returns the domain of the currently selectedSite
, if presentString
getElementAt(int idx)
Returns the element at indexidx
, if presentint
getElementCount()
Returns the number of elements of thisPath
String
getExtension()
Returns the file-extension for JSP-filesString
getGuiPath()
Returns the path to the appNG webapplication.String
getHost()
Returns the host of the currently selectedSite
, if presentList<String>
getJspUrlParameters()
Returns aList
containing the values of the JSP-Paramters of a JSP-call.String
getLastElement()
Returns the last element of thisPath
.String
getOutputFormat()
Returns the ID ofOutputFormat
.
AnOutputFormat
may be defined by adding_<format>
after the gui-path, e.g.String
getOutputPrefix()
Returns the path prefix that contains theOutputFormat
andOutputType
, if those are set.String
getOutputType()
Returns the ID ofOutputType
.
AnOutputType
may be defined by adding_<type>
after the output-format, e.g.String
getPage()
Returns the name of the currently selected page, if presentString
getPlatformUrl()
Returns the complete absolute URL thisPath
represents, which is theSite
s domain plus the servlet-pathString
getRootPath()
Returns the root-path of thisPath
, which is the first element, or/
if there is no first elementString
getService()
Return the name of the service addressed by thisPath
String
getServicePath()
Returns the path element that addresses a serviceString
getServletPath()
Returns the complete servlet-path thisPath
was built fromString
getSiteName()
Returns the name of theSite
which is being addressed by thisPath
boolean
hasAction()
Checks whether thisPath
has an action selectedboolean
hasApplication()
Checks whether thisPath
contains an element determining the currentApplication
boolean
hasElementAt(int idx)
Returnstrue
if thisPath
has an elements at indexidx
.boolean
hasOutputFormat()
Checks whether thisPath
has anOutputFormat
set.boolean
hasOutputType()
Checks whether thisPath
has anOutputType
set.boolean
hasSite()
Checks whether thisPath
contains an element determining the currentSite
boolean
isDocument()
Checks whether thisPath
represents a document from a document-folder.boolean
isGui()
Checks whether thisPath
represents a call to the appNG webapplication GUIboolean
isJsp()
Checks whether thisPath
represents the call of a JSP file.default boolean
isMonitoring()
Checks whether thisPath
represents a monitoring pathboolean
isPathSelected(String servletPath)
Checks whether the givenservletPath
is being addressed by thisPath
, which basically means the servlet-path represented by thisPath
must start with the givenservletPath
.boolean
isRepository()
Checks whether thisPath
represents the repository-folder of appNGboolean
isRoot()
Checks whether thisPath
represents the root-pathboolean
isService()
Checks whether thisPath
represents a call to a service (Webservice
/AttachmentWebservice
,SoapService
or an XML/JSON call of anActionProvider
orDataProvider
.boolean
isStaticContent()
Checks whether thisPath
represents a static resource from a blob-directory
-
-
-
Field Detail
-
SEPARATOR
static final String SEPARATOR
The separator for a path- See Also:
- Constant Field Values
-
-
Method Detail
-
hasElementAt
boolean hasElementAt(int idx)
Returnstrue
if thisPath
has an elements at indexidx
.- Parameters:
idx
- the zero-based index to check- Returns:
true
if there is such a path element,false
otherwise
-
getLastElement
String getLastElement()
Returns the last element of thisPath
.- Returns:
- the last element
-
getElementAt
String getElementAt(int idx)
Returns the element at indexidx
, if present- Parameters:
idx
- the zero-based index- Returns:
- the element at the given index, or
null
if no such element exists
-
checkPathLength
void checkPathLength(int minLength) throws IOException
Checks whether thisPath
has the given minimum number of elements and throws anIOException
otherwise- Parameters:
minLength
- the minimum length to check- Throws:
IOException
- if thisPath
does not have the required minimum length
-
isStaticContent
boolean isStaticContent()
Checks whether thisPath
represents a static resource from a blob-directory- Returns:
true
if thisPath
represents a static resource,false
otherwise- See Also:
getBlobDirectories()
-
isDocument
boolean isDocument()
Checks whether thisPath
represents a document from a document-folder.- Returns:
true
if thisPath
represents a JSP file from a document-folder,false
otherwise- See Also:
getDocumentDirectories()
-
isGui
boolean isGui()
Checks whether thisPath
represents a call to the appNG webapplication GUI- Returns:
true
if thisPath
represents a call to the appNG webapplication GUI,false
otherwise- See Also:
getGuiPath()
-
isService
boolean isService()
Checks whether thisPath
represents a call to a service (Webservice
/AttachmentWebservice
,SoapService
or an XML/JSON call of anActionProvider
orDataProvider
.- Returns:
true
if thisPath
represents a call to a service,false
otherwise
-
isJsp
boolean isJsp()
Checks whether thisPath
represents the call of a JSP file.- Returns:
true
if thisPath
represents the call of a JSP file,false
otherwise- See Also:
getExtension()
,isDocument()
-
getSiteName
String getSiteName()
Returns the name of theSite
which is being addressed by thisPath
- Returns:
- the site name, if present
- See Also:
hasSite()
-
hasSite
boolean hasSite()
Checks whether thisPath
contains an element determining the currentSite
- Returns:
true
if thisPath
contains an element determining the currentSite
,false
otherwise
-
getApplicationName
String getApplicationName()
Returns the name of theApplication
which is being addressed by thisPath
- Returns:
- the application name, if present
- See Also:
hasApplication()
-
hasApplication
boolean hasApplication()
Checks whether thisPath
contains an element determining the currentApplication
- Returns:
true
if thisPath
contains an element determining the currentApplication
,false
otherwise
-
getPage
String getPage()
Returns the name of the currently selected page, if present- Returns:
- the name of the page, or
null
if no page is selected - See Also:
isGui()
-
getActionName
String getActionName()
Returns the name of the currently selected action, if present- Returns:
- the name of the currently selected action, or
null
if no action is selected - See Also:
isGui()
,getActionValue()
-
getActionValue
String getActionValue()
Returns the value of the currently selected action, if present- Returns:
- the value of the currently selected action, or
null
if no action is selected - See Also:
isGui()
,getActionName()
-
hasAction
boolean hasAction()
Checks whether thisPath
has an action selected- Returns:
true
if thisPath
,false
otherwise- See Also:
getActionName()
,getActionValue()
-
getApplicationUrlParameters
List<String> getApplicationUrlParameters()
- Returns:
- a
List
of parameter values - See Also:
isGui()
,isService()
-
getJspUrlParameters
List<String> getJspUrlParameters()
Returns aList
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
, withen
being a document folder andindex
the JSP name, the list will contain"foo"
and"bar"
.
-
getRootPath
String getRootPath()
Returns the root-path of thisPath
, which is the first element, or/
if there is no first element- Returns:
- the root-path
-
getHost
String getHost()
Returns the host of the currently selectedSite
, if present- Returns:
- the host of the
Site
- See Also:
hasSite()
,Site.getHost()
-
getDomain
String getDomain()
Returns the domain of the currently selectedSite
, if present- Returns:
- the domain of the
Site
- See Also:
hasSite()
,Site.getDomain()
-
getServletPath
String getServletPath()
Returns the complete servlet-path thisPath
was built from- Returns:
- the servlet-path
-
getCurrentPath
String getCurrentPath()
Returns the current path to the application, e.g./manager/mysite/myapp
- Returns:
- the current path to the application
-
isRoot
boolean isRoot()
Checks whether thisPath
represents the root-path- Returns:
true
if thisPath
represents the root-path,false
otherwise- See Also:
getRootPath()
-
isRepository
boolean isRepository()
Checks whether thisPath
represents the repository-folder of appNG- Returns:
true
if thisPath
represents the repository-folder of appNG,false
otherwise
-
isMonitoring
default boolean isMonitoring()
Checks whether thisPath
represents a monitoring path- Returns:
true
if thisPath
represents a monitoring path,false
otherwise- Since:
- 1.21.0
-
getGuiPath
String getGuiPath()
Returns the path to the appNG webapplication.- Returns:
- the path to the appNG webapplication
- See Also:
isGui()
-
getDocumentDirectories
List<String> getDocumentDirectories()
Returns aList
of all document directories, which contain the JSP-files- Returns:
- a
List
of all document directories - See Also:
isDocument()
,isJsp()
-
getPlatformUrl
String getPlatformUrl()
Returns the complete absolute URL thisPath
represents, which is theSite
s domain plus the servlet-path- Returns:
- the complete URL
- See Also:
getDomain()
,getServletPath()
-
getOutputFormat
String getOutputFormat()
Returns the ID ofOutputFormat
.
AnOutputFormat
may be defined by adding_<format>
after the gui-path, e.g./ws/_html/site/application/page
.- Returns:
- the ID of the
OutputFormat
, if present - See Also:
isGui()
-
getOutputType
String getOutputType()
Returns the ID ofOutputType
.
AnOutputType
may be defined by adding_<type>
after the output-format, e.g./ws/_html/_minimal/site/application/page
.- Returns:
- the ID of the
OutputType
, if present - See Also:
isGui()
,getOutputFormat()
-
hasOutputFormat
boolean hasOutputFormat()
Checks whether thisPath
has anOutputFormat
set.- Returns:
true
if thisPath
has anOutputFormat
set,false
otherwise- See Also:
getOutputFormat()
-
hasOutputType
boolean hasOutputType()
Checks whether thisPath
has anOutputType
set.- Returns:
true
if thisPath
has anOutputType
set,false
otherwise- See Also:
getOutputType()
-
getService
String getService()
Return the name of the service addressed by thisPath
- Returns:
- the name of the service, if present
- See Also:
isService()
,getServicePath()
-
getServicePath
String getServicePath()
Returns the path element that addresses a service- Returns:
- the path element that addresses a service, if present
- See Also:
isService()
,getService()
-
isPathSelected
boolean isPathSelected(String servletPath)
Checks whether the givenservletPath
is being addressed by thisPath
, which basically means the servlet-path represented by thisPath
must start with the givenservletPath
.- Parameters:
servletPath
- the servlet-path to check- Returns:
true
if thisPath
,false
otherwise- See Also:
getServletPath()
-
getOutputPrefix
String getOutputPrefix()
Returns the path prefix that contains theOutputFormat
andOutputType
, if those are set.- Returns:
- the path prefix
- See Also:
getOutputFormat()
,getOutputType()
-
getExtension
String getExtension()
Returns the file-extension for JSP-files- Returns:
- the file-extension
- See Also:
isJsp()
-
getApplicationIndex
int getApplicationIndex()
Return the index of the element representing theApplication
name- Returns:
- The index of the element representing the
Application
name - See Also:
getApplicationName()
,hasApplication()
,getElementAt(int)
-
getElementCount
int getElementCount()
Returns the number of elements of thisPath
- Returns:
- the number of elements
-
-