HOPAGetView4Object
Retrieve document (of type/class set in Hopa settings) connected to chosen Object matched by parameters given in hopa url.
Parameters
Parameter | Abbr. | Required | Default value | Description | viewport suffix? |
ClassId | CID | ✓ | - | Object class | ✓ |
ObjectId | ID | ✓ | - | Object Id | ✓ |
GUID | GUID | ✓ | - | MasterGUID Note: this identifier can be used as a replacement for ClassId/ObjectId | |
DocumentForSpot | DFS |
| 0 | Choose if Document for spot mode is a preferable or not. If cannot find spot link then Document for Object (DFS=0) is used instead. | ✓ |
SpotMarginPercent | SMP |
| 110 | Define minimum margin around spot to be included in the returned image (use with DFS=1 only) | ✓ |
Width | W |
| 800 | Result image width | - |
Height | H |
| 600 | Result image height | - |
MaskMode | MM | 0 | MM=1 requires DFS=1, all area on returned image outside spot is cleared - margin parameter is ignored in this case. | ✓ | |
TemplateID | TID |
| - | Template ID to be used for printouts. | - |
TemplateName | TN |
| - | Template Name to be used for printout. | - |
OutFormat | OF |
| png | Output format:
| - |
Download | - | - | 0 | If set to Download=1 then sends file for download in your browser. | |
PresentationID | PID | - | - | ID of the presentation (filter) to be applied to the result. Use of template with filter legend window is recommended. | - |
Domain | DN | * | - | External domain in which search for object will be done. | - |
ClassName | CN | * | - | If used with Domain it checks external domain class, without it search for Internal class. | - |
FieldName | FN | * | - | If used with Domain then it checks for external domain field name, without it search for internal class field name. | - |
FieldValue | FV | * | - | If used with Domain it searched for external class field value, without it searches for provided internal class field value. | - |
PerspectiveSetID | PSetID | - | - | Perspective Set used to find indirect objects. Indirect objects are those that do not have any spots connected directly to them, but rather group some other objects, e.g. Rental Units → Space → Spot | - |
ScaleMode | SM | - | per Template | Scale Mode used to control the way an image is fit into the view-port. For available options refer to Template Editor and Scale modes section. | ✓ |
Scale | S | - | per Template | Requires SM=4 or 5 (Scale drawing or Scale View) | ✓ |
FitMode | FM | - | 0 |
When output is wrapped in print template, FitMode parameter has no effect. | - |
MultiView | MV | - | 0 | If set to 1 then result will produce multi-page PDF output, containing drawings with all spots linked to called object. | - |
LayerName | LN | - | - | Return drawing with spots only from selected layer based on name only (case sensitive)! Other layers will be "hidden". Parameter accepts more then one layer name, separated using comma. | - |
DefObjectClassId | DOC | - | - | In DFS=0 mode HOPA will return document of specified class if such exists. Use class ID as value for this parameter. | ✓ |
HQL | HQL | - | - | Additional locator, allows to locate objects via HQL statements.See description below. | - |
Highlight | HLI | - | 1 | Turns Off (0) / On (1) highlight of HOPA call object's. | ✓ |
contextObjects | cobjs | - | - | additional pair or pairs of classId and objectID for macro resolving and presentation purposes (see below) | - |
toolsetid | TSI | - | - | toolset ID that will be used for spot highlight. If not specified, a global HOPA highlight tool is used. (since v 4.0.0) | ✓ |
changeRequestId | crId | - | - | ID of single Change Request that existing on printed drawing, if given then the CR vectors will be put into a printout (since v 4.0.0) | - |
labelingId | LID | - | - | Applies Dynamic Label to the printout. Only one ID can be given. | - |
showPresentationLabels | SPL | - | 0 | Requires PresentationID given in call. When SPL=1 then labels of tools will added to a drawing hovering overs appropriate spots. | - |
WithNotes | WN | - | 0 | If set to 1 than the printout will also mark all Notes (visible to hopa user) on a drawing and will create additional pages (for PDF output only) with a detailed report of each note. | - |
template4dfs0 | dfs0tid | - | - | Used to apply alternative print template to HOPA printout if it turns out that there is no spot link for requested object (DFS=0). | - |
Explanation:
ClassId and ObjectID - pair of Object's class ID and Object ID field used in HDC internaly. Both parameters are required.
ClassId can be retrieved from Object Classes configuration and Object ID is a value of Class Field marked as ID Field.DocumentForSpot - when set to 1, image contains document, on which spot is linked to this object.
SpotMarginPercent - percent of area surrounding spot (e.g. “100” – spot only; “110” – add 10% margins around spot boundaries).
Width and Height - width and height ot returned spot.
ClassName(or ClassId), FieldName, FieldValue - searching for object based on internal HDC metadata.
Domain - external domain name or ID. Matching object is searched using External Domain ID's. Can be used in two ways:
with CID or CN and ID which in this case (DN present in url) will represent External domain object class id and object id,
with ClassName, FieldName, FieldValue - than CID and ID is not needed
contextObjects - in case there is a need to resolve macros or presentations in context of different object then added in HOPA locator, here they can be added.
When printing from HDC viewer, this is added automatically based what object is being selected in Tree. This is common for proper resolving macros, for instance when one document is linked to many floors. In case of presentations, you can simulate option "Only for selected object".
The value of this parameter should consists of pair or pairs of classID and objectID. With additional S letter when object is to be used for presentation. Examples:&contextobjects=528503,105;528505,107,S &contextobjects=528503,107 &contextobjects=528505,107,S &contextobjects=528505,107;528505,107,S
Samples
Basic URL structure
http://<server_name>/HopaGetView4Object?Domain=<domain_id_or_name>&ClassName=<external_class_name_defined_in_EID>&ObjectId=<external_ID>
Multiple FieldVales
When using ClassName/ClassId locators (with or without external domain), multiple Field values can be given to HOPA call, separated with comma.
ObjectID or HQL locator does not support multiple values yet.
If provided objects are on same drawing, all will be highlighted on single page.
If used with MV=1 additional pages will appear if objects are on different drawings and/or if objects have multiple links to different drawings as usual.
Example:
HopaGetView4Object?CID=124&FN=rentobj_name&FV=1201-11016,1201-11012,1201-11013,1201-11015&DocumentForSpot=0&OF=PDF&psetId=14&TID=113&PID=6
Data for macros will show data only for first given object.
Handling multiple viewports
For detailed description of view-port options, please refer to Print Templates section.
In HOPA scenarios specific view-ports can be handled by using template view-port pre configuration or by explicit parameters provided for a given view-ports (url params are most important).
Parameters for a specific viewport require viewport ID suffix as follows:
ViewportID = without suffix - such parameters will apply to all viewports on printout (unless this parameter is used again but with viewport number)
ViewportID = 1 parameters with suffix "1", e.g ScaleMode1 - influnces only viewport 1
ViewportID = 2 parameters with suffix "2", e.g ScaleMode2 - flunces only viewport 2
ViewportID = 3 parameters with suffix "3", e.g ScaleMode3 - flunces only viewport 3
and so on...
Sample code for single object view without Print Template:
Note: Object class, object Id and template ID are from specific database, so they will not work in your database.
(URL exmaples are separated to provide easier readability)
HopaGetView4Object ?classId=108 &objectId=76931 &DocumentForSpot=1 &Width=600 &Height=801 &SpotMarginPercent=122
With added print template:
HopaGetView4Object ?classId=108 &objectId=76931 &DocumentForSpot=1 &SpotMarginPercent=122 &TID=3255
Master viewport is filled in with our test object. Since we have't specified any parameters for two extra viewports, defaults are used.
Set of specific parameters for each viewport can be added to obtain diferent documents or scale modes:
For example, a new target class is provided for Vieweport #3 (that option is only available for use in Template)
Specific scale mode and scale value can be added for viewport #2 and mask mode for viewport #1:
HOPA: Using HQL as search criteria
New parameter hql/HQL is added, that allows to locate objects via HQL statements.
Some examples by operator
Equals: HopaGetView4Object?CID=118&HQL=hd_docdescr = "Italic"
In Set: HopaGetView4Object?PSETID=493&TID=6405&classId=108&HQL=fi2space_id in ("000480000900059","000480000900051","000480000900040")&MV=1&DFS=1&SM=2
Before: HopaGetView4Object?CID=118&HQL=hd_docdate before "1990-12-01"
Contains: HopaGetView4Object?PSETID=493&TID=6405&classId=108&HQL=fi2space_id contains "48000090004"&DFS=1&MV=1
Starts With: HopaGetView4Object?cid=108&HQL=fi2space_descr starts-with "RUM 2"&DFS=1
Before and after (date): HopaGetView4Object?CID=118&hql=hd_docdate before "1996-11-05" and hd_docdate after "1996-11-03"
In Set and Not In Set: HopaGetView4Object?cid=108&HQL=fi2space_class in ("02","ÖVA") and fi2space_function not in ("KOMMUNIKATION","03","02","00","PERSONAL","SERVICE","99","TEKNIK","01")&DFS=1
Searched values must be wrapped in quotes: "value" (in case of In Set operator it looks differently - see example above).
Operator and conditions joiner (and/or) must be written with small letters.
and/or joiners - only one of them can be used per HOPA call.
In the case of multiple results, only the first one is presented by HOPA. If MV=1 is used then only 10 first results are printed (in single PDF file).