public class InfoHtml extends InfoURL
InformationService
to store and parse a remote html file.
The content can also be stored locally if the action element declares it to be stored
locally through AiConst
.LOADCONTENT
. The default for an html resource is to
link to the html file, where the content is dynamically retrieved and parsed when the
info is requested. An alternative to this would be the InfoStreamXml
resource.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
REFERENCES |
static java.lang.String |
TEXTONLY
InfoHtml types
|
dataType, INFOANYTYPE, INFOBINARYTYPE, INFOHTMLTYPE, INFOSTREAMXMLTYPE, INFOSTRINGTYPE, INFOTEXTTYPE, INFOURLTYPE, INFOXMLTYPE, LISTCONTAINERTYPE, QUERYCONTAINERTYPE, RANDOMCONTAINERTYPE, uuid
Constructor and Description |
---|
InfoHtml(java.lang.String theDataType,
org.licas_xml.abs.Element dataXml)
Create a new instance of InfoHtml.
|
Modifier and Type | Method and Description |
---|---|
org.licas_xml.abs.Element |
getInfo(org.licas_xml.abs.Element infoDescr)
Get the currently loaded source information wrapped in an XML element.
|
org.licas_xml.abs.Element |
getInfoFor(java.lang.String thisPart)
Get the currently loaded source information wrapped in an XML element,
but return only the part of it that is relevant to the specified variable.
|
java.lang.Object |
getValue(org.licas_xml.abs.Element infoDescr)
Get the value itself and not a wrapped description.
|
boolean |
parseInfo(org.licas_xml.abs.Element dataXml)
Parse the data description in the document to create the data object.
|
createResource, dataFromResourceType, getDataType, getUUID, parseValueElem, resourceTypeForDataType, setUUID, setUUID
public static final java.lang.String TEXTONLY
public static final java.lang.String REFERENCES
public InfoHtml(java.lang.String theDataType, org.licas_xml.abs.Element dataXml) throws java.lang.Exception
theDataType
- the resource data type.dataXml
- a description of the initialisation parameters. Can be null,
or it can specify a list of specific parts to return.java.lang.Exception
- any error.public boolean parseInfo(org.licas_xml.abs.Element dataXml) throws java.lang.Exception
parseInfo
in class InfoURL
dataXml
- this must include a VALUE
element that stores a String-based
URL path description. The data is then retrieved from this location upon request.
The Value
element can be in one of two forms. It can store directly a String-based
URL file path description, or it can store child elements that include a URL path
as well as HTML parts that should be retrieved only. It can therefore look
like either: <Value>url address</Value>
or
<Value><URL>url address</URL><Include>part 1</Include><Include>part 2</Include></Value>
.
The include parts are in this case: TEXTONLY
, REFERENCES
.
'Text only' removes all of the html formatting, while 'references' should parse
the html document and return a hyperlinks list only.
java.lang.Exception
- any error.public org.licas_xml.abs.Element getInfo(org.licas_xml.abs.Element infoDescr) throws java.lang.Exception
getInfo
in class InfoURL
infoDescr
- a description of the info resource value that should be retrieved.
Can be null as not used in this version.Data
element through an admin document.
HTML description is coded, so probably need to use XmlHandler.removeStringSpec(...)
after retrieving the XML Data
element's text content on the client side.java.lang.Exception
- any error.public org.licas_xml.abs.Element getInfoFor(java.lang.String thisPart) throws java.lang.Exception
TEXTONLY
) or a list of
HTTP references (REFERENCES
). So the info part can specify this and it can
be different or separate from the resource initialisation script.thisPart
- a description of the info part to return.Data
through an admin document.java.lang.Exception
- any error.public java.lang.Object getValue(org.licas_xml.abs.Element infoDescr) throws java.lang.Exception