Document toolboxDocument toolbox

(sv) HOPAGetView4Object



Få åtkomst till dokument eller bild (av typ/klass angivet i HOPA inställningar) länkad till anropat objekt via parametrar i en HOPA url



Parametrar 

 

Parameter

Abbr.

Required

Default value

Description

viewport suffix?

ClassId

CID

-

HDC Object class

ObjectId

ID

-

HDC Object Id (key)

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:

  • PNG (image - can be wrapped in print template as well)

  • JPG (image - can be wrapped in print template as well)

  • PDF (pdf file - forces printout mode and uses default print template if none is specified)

-

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.
Multiply values can be given separated with a comma, if objects can be presented on single drawing, all will be highlighted on single page.

-

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
If DFS=0 is used then this parameter (if present) will be omitted (since v 3.5.0).

-

ScaleMode

SM

-

per Template

Scale Mode used to control the way an image is fit into the view-port. For available options refer to (sv) Malleditor and Scale modes section.

Scale

S

 -

per Template

Requires SM=4 or 5 (Scale drawing or Scale View)

FitMode

FM

-

0

  • 0 – fit to specified width and height – this is the default value. Uses default width and height values if not provided.

  • 1 – fix width: generated picture has width equal to specified and height results from aspect ratio;

  • 2 – fix height: generated picture has height equal to specified and width results from aspect ratio;

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). 

-



Förklaring:

  • 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 (sv) Objektklasser 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), FieldNameFieldValue - 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 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



Exempel

Generell struktur för URL

kodexempel på externa anrop:



http://<server_name>/HopaGetView4Object?Domain=<domain_id_or_name>&ClassName=<external_class_name_defined_in_EID>&ObjectId=<external_ID>

Multipla fältvärden

Då ClassName/ClassId parametrarna används kan multipla fältvärden anges i anropet, separerade med kommatecken.

ObjectID eller HQL stödjer inte multipla fältvärden än.

Om de anropade objekten finns på samma ritning så kommer de att markeras på en enda bild. Om anropet görs med parametern MV=1 så kommer resultatet att bli flera bildsidor om de anropade objekten finns på olika ritningar (OBS att flersidig utskrift endast kan göras om PDF är utformatet). 

Exempel:

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

Textmakron kommer bara att redovisa data för det först funna objektet i anropet.

Hantering av multipla vyer i utskriftsmall

För detaljerad beskrivning av vy parametrar var god se avsnittet Malleditor.

Specifika vyer i utskriftsmallar kan hanteras antingen via inställningar för vyn i utskriftsmallen eller genom vy-specifika parametrar i HOPA URL:n (vy-specifika parametrar i URL går före vy-specifika inställningar i utskriftsmalen.



Vy-specifika parametrar i HOPA URL kräver vy-ID suffix enligt nedan:

  • ViewportID = utan suffix - en sådan parameter gäller för samtliga vyer i en utskriftsmall (om inte samma parameter används igen med ett vy-ID suffix)

  • ViewportID = 1 parametrar med suffix "1", t.ex. ScaleMode1 - påverkar bara vy med ID=1

  • ViewportID = 2 parametrar med suffix "2", t.ex. ScaleMode2 - påverkar bara vy med ID=2

  • ViewportID = 3 parametrar med suffix "3", t.ex. ScaleMode3 - påverkar bara vy med ID=3

  • och så vidare...



Exempelsträng för ett objekt utan utskriftsmall:

(URL parametrarna är separerade med mellanslag för att kunna läsas enklare)

HopaGetView4Object ?classId=108 &objectId=76931 &DocumentForSpot=1 &Width=600 &Height=801 &SpotMarginPercent=122



Med utskriftsmall tillagd:

HopaGetView4Object ?classId=108 &objectId=76931 &DocumentForSpot=1 &SpotMarginPercent=122 &TID=3255

Huvudvyn är fylld med det anropade objektet. Då inga specifika parametrar skickats med för de 2 övriga vyerna så används standardinställningar för dessa. 



Specifika parametrar för respektive vy kan adderas till HOPA URL:n för att visa olika skalor, maskningar av objekt eller t.o.m. andra dokument:

Exempelvis är en målklass angiven för Vy #3 (denna option finns bara tillgänglig i utskriftsmallen)

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).