Interface WebParsedModel
-
- All Superinterfaces:
WebParsedObject
public interface WebParsedModel extends WebParsedObject
This interface represents a model resulted from parsing by backend. The interface is designed to support parsing the filters, facts, attribute forms etc.Object Context Support
Suppose that we have created some Tables and these Tables have not been persisted to the metadata, and now we are going to create a Fact by defining a new fact expression for a Table. The Parser will be called to parse the formula of the expression, and when the Parser tries to resolve the name of the Table the Object Server / Metadata Server will report that the Table object with the given name cannot be found. This problem can be solved by forcing the Parser to search in an Object Context which holds the unsaved objects.Most of the time, the Parser only needs the DssSourceBrowser and DssSourceSecurity parts of an object when resolving a token. When searching for a symbol, it removes any objects which are folders or for which the user doesn't have Browse access rights, and to check if the user has Browse access rights, the object's DssSourceSecurity part has to be loaded.
However sometimes it does need to look deeper into the object, and in that case it needs the DssSourceDefn part of the object as well. It is possible that it needs more parts of the object in some circumstances.
As the modeling service thinks and talks in JSON, to pass the object definition to the I-Server in the parse_metric XML API, we will have to use the JSON representation.
We will send the JSON representation of the objects in an XML node with the XML tag Tag_AvailableObjects ("availableObjects") in the XML command parse_model. This XML node will only be processed when the XML attribute Att_TargetType ("ttp") is present.
The JSON consists of two arrays: one array ("data") for whole or partial objects, and the other array ("idtypes") for reference of objects. Basically the first array is primarily used to represent objects that have never been persisted to the MD, although it could also be utilized to pass in objects that have been modified by the Modeling Service in some way even if they have been persisted to the MD before, and the second array is used to represent objects that exist in the MD.
I-Server would act as follows when it sees the the XML tag Tag_AvailableObjects ("availableObjects"): * Create an object context * Deserialize the objects from JSON from the first array, and insert them into the object context * Bulk load the objects from MD with the object references in the second array, and insert them into the object context * Set the object context to the Parser such that the Parser would search within the object context when resolving tokens
Target Object Support
The DSS Type of the TargetObject would be set to what is specified in the XML attribute Att_TargetType ("ttp") when the XML attribute Att_DSSType ("dst") doesn't exist, otherwise it would be set to what is specified by the XML attribute Att_DSSType ("dst")If the action flag DssXmlParserActionNewObject is specified * If the XML attribute Att_ObjectID ("oid") exists, backend would create an object instance with the given ID and TargetObject type reject the request - suppose that there is an object context which contains the definition of an object with the same ID, should we use the object instance in the object context or create an object instance with the given ID and TargetObject type and insert it into the object context? It would be cleaner to just not support this case. * If the XML attribute Att_ObjectID ("oid") do not exist, backend would create an object instance with a new ID and TargetObject type * If there is an object context, the object instance would be inserted into the object context
If the action flag DssXmlParserActionNewObject is NOT specified * If there is no object context, backend would search for the object with the given ID from the object source * If there is an object context, backend would search for the object with the given ID from the object context
In the WebParsedModel, the getType() is getting the Att_TargetType("ttp") when the messageID is not present, or it will be Att_ObjectType("ot").
Report Instance Support
By specifying the messageID, the WebParsedModel could run toward a report instance. In this case the setType() will be for the Att_ObjectType("ot"), whereas in other cases will be for Att_TargetType("ttp").When using WebParsedModel toward a report instance, in the response, Tag_Embedded_Uses("embedded_uses") and Tag_Dependents("dependents") may be returned if there parsed result contains references to any embedded objects of the report definition in the instance or dependents in the instance.
- Since:
- MicroStrategy Web 11.2
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description WebParsedModelAvailableObjects
getAvailableObjects()
Get the available objects which supports the object context for parser.java.util.List<java.lang.String>
getDependents()
Get a list of lean JSONs representing the Tag_Dependents("dependents") in an instance of the response from<pm>
XML command.java.util.OptionalInt
getDssType()
The DSS Type of the TargetObject would be set to what is specified in the XML attribute Att_TargetType ("ttp") when the XML attribute Att_DSSType ("dst") doesn't exist, otherwise it would be set to what is specified by the XML attribute Att_DSSType ("dst") As the DSS Type may not exist, so we use OptionalInt instead of the primitive intjava.util.List<java.lang.String>
getEmbeddedUses()
Get a list of lean JSONs representing the Tag_Embedded_Uses("embedded_uses") in an instance of the response from<pm>
XML command.java.lang.String
getObjectJson()
java.lang.String
getXmlResponse()
Returns the whole xml string generated by backend parservoid
setAvailableObjects(WebParsedModelAvailableObjects availableObjects)
Set the available objects which supports the object context for parser.void
setDependents(java.util.List<java.lang.String> dependents)
Set the list of lean JSONs representing the Tag_Dependents("dependents") in an instance of the response from<pm>
XML command.void
setDSSType(java.util.OptionalInt dssType)
Set the value of the dssType for this objectvoid
setEmbeddedUses(java.util.List<java.lang.String> embeddedUses)
Set the list of lean JSONs representing the Tag_Embedded_Uses("embedded_uses") in an instance of the response from<pm>
XML command.-
Methods inherited from interface com.microstrategy.web.objects.WebParsedObject
getDescription, getID, getLocalSymbolFolder, getMessageID, getName, getRejectErrorCode, getRejectErrorDescription, getSearchResultsFolder, getSubType, getTokenStream, getType, load, save, saveAs, setDescription, setMessageID, setName, setNew, setType, validate
-
-
-
-
Method Detail
-
getDssType
java.util.OptionalInt getDssType()
The DSS Type of the TargetObject would be set to what is specified in the XML attribute Att_TargetType ("ttp") when the XML attribute Att_DSSType ("dst") doesn't exist, otherwise it would be set to what is specified by the XML attribute Att_DSSType ("dst") As the DSS Type may not exist, so we use OptionalInt instead of the primitive int- Returns:
- the DSS Type of the TargetObject in
EnumDSSXMLObjectTypes
-
setDSSType
void setDSSType(java.util.OptionalInt dssType)
Set the value of the dssType for this object- Parameters:
dssType
- inEnumDSSXMLObjectTypes
-
getObjectJson
java.lang.String getObjectJson()
- Returns:
- a json returned from IServer with parserOutFlags including DssXmlParserOutTotalObjectInJSON in
EnumDSSXMLParserOutFlags
-
getXmlResponse
java.lang.String getXmlResponse()
Returns the whole xml string generated by backend parser- Returns:
-
getAvailableObjects
WebParsedModelAvailableObjects getAvailableObjects()
Get the available objects which supports the object context for parser. Please refer to the class comments for more detail.- Returns:
-
setAvailableObjects
void setAvailableObjects(WebParsedModelAvailableObjects availableObjects)
Set the available objects which supports the object context for parser. Please refer to the class comments for more detail.
-
getDependents
java.util.List<java.lang.String> getDependents()
Get a list of lean JSONs representing the Tag_Dependents("dependents") in an instance of the response from<pm>
XML command. You will get it only when it's a call toward a report instance.- Returns:
- a list of lean JSONs representing the Tag_Dependents("dependents") of the response from
<pm>
XML command.
-
setDependents
void setDependents(java.util.List<java.lang.String> dependents)
Set the list of lean JSONs representing the Tag_Dependents("dependents") in an instance of the response from<pm>
XML command.- Parameters:
dependents
- the list of lean JSONs representing the Tag_Dependents("dependents")
-
getEmbeddedUses
java.util.List<java.lang.String> getEmbeddedUses()
Get a list of lean JSONs representing the Tag_Embedded_Uses("embedded_uses") in an instance of the response from<pm>
XML command. You will get it only when it's a call toward a report instance.- Returns:
- a list of lean JSONs representing the Tag_Embedded_Uses("embedded_uses") of the response from
<pm>
XML command.
-
setEmbeddedUses
void setEmbeddedUses(java.util.List<java.lang.String> embeddedUses)
Set the list of lean JSONs representing the Tag_Embedded_Uses("embedded_uses") in an instance of the response from<pm>
XML command.- Parameters:
embeddedUses
- the list of lean JSONs representing the Tag_Embedded_Uses("embedded_uses")
-
-