 |
HyperDoc Online Publishing API |
Why integrate HyperDoc Online with an external web application?
Many HyperDoc clients use web applications where some documents stored in the HyperDoc database are published. Facility management is an excellent example. Special web application supports marketing department in selling or renting flats. One of the most important part of a FM web application are graphical plans and pictures. Usually such plans are stored in HyperDoc database. Instead of copying and specially preparing plans to be published in the Internet you can use HyperDoc Online Publishing API (HOPA) that dynamically delivers requested view of a given document (plan, picture). The unique feature offered by HyperDoc Online is Internet printing that allows easy controlling of printing scale. Summary of HyperDoc Online Publishing API advantages:
- HyperDoc Online dynamically prepares views of requested plans, so preparing special versions for publishing in the Internet is not needed. It facilitates the maintenance of drawings files when objects presented in the Internet change often.
- You have full control over your web application layout and structure.
- Browser-based printing allows easy controlling of the printout scale.
- Printing templates enable preparing advanced printout layouts that may contain many plans (e.g. the whole floor and the view of the chosen flat), mixed with photographs and data retrieved dynamically from the database.
What you should know about HyperDoc?HyperDoc in a nutshell
HyperDoc manages hierarchical structures of "business objects" stored in the database. A "business object" represents some element (part, entity) from the application real world. To each "business object" (e.g. flat) you attach any number of documents (e.g. flat plan). Document consists of description (a database record) and content (a file). The document description consists of document attributes. HyperDoc can be configured to use any number of document types, which differ in number of attributes. You can store in the HyperDoc repository documents in any type (scanned documents, vector drawings, text documents etc.). HyperDoc can display and print directly dozen raster formats, popular vector formats and MS Office documents. If it does not support file format than it invokes appropriate application. Object hierarchies
It is natural to organize various "business objects" on different level of hierarchical structure. A typical documents repository for e.g. facility management is based on the following hierarchical structure of "business objects":
Property
Building
Floor
Flat
Room
HyperDoc supports multiple hierarchies, which define different views or aspects of your database. In FM applications, additional hierarchies may be built e.g. around contracts, services, installations etc. Beside main (default) hierarchy, each additional hierarchy has to be distinguished by its own name. Objects and spots
HyperDoc allows you to create graphical element (called spot) and link this spot to a given "business object". This graphical element can be used to hyper navigation, dynamic visualization of object location and state. For example in facility management application you can draw polygonal spot on the floor plan and link it to a flat object. The highlighted spot allows you graphically distinguish flat location and state. Spots are defined in a special vector drawing named Object Overlay. Foreground vector drawings
To facilitate efficient work with graphical documents presented as background drawings and enhance system capabilities, the HyperDoc adds additional vector drawings that are automatically placed on top of the background documents and maintained separately for dedicated purposes. These drawings are referred to as foreground drawings. HyperDoc creates two active drawings that are overlaid with every document: ObjectOverlay Drawing and Redlining Drawing.
ObjectOverlay Drawing is intended to maintain fore-mentioned spots. Redlining Drawing is a drawing where user can place various annotations, markings and descriptions referring to document versions. Object identification
If you want to use HyperDoc Online Publishing API (HOPA) object identification is the most important thing. Your web application and HyperDoc keep information about common resources. If you have facility management web application FLAT is such a common resource. Your web application publishes information about flat and if you want to get images associated with that flat from HOPA you have to know how HyperDoc identifies particular flat ("business object"). HyperDoc identifies "business object" using two parameters: ObjectClass and unique object identifier within a given class. The ObjectClass name is determined by HyperDoc configuration and it defines category of "business object". Typically ObjectClass is defined by a table in database. A value of the key field of the record in the "object class" table is used as the unique identifier of a given object. Document selection
There can be many documents associated with a given "business object" in the HyperDoc database.
HOPA offers two basic methods of document selection. First, you can choose document connected to a given object. If there is default document defined, HyperDoc will use it. Otherwise, a first found document is used. This method is referred as "document for object" method.
The second method uses spots linked to a given object to determine set of documents. Usually business object has single spot linked to it. In such a case document on top of which spot is defined is used by HOPA. If there are more than one spot, a first found spot is used.
You can use the document type as additional parameter to select appropriate document. HOPA allows you to control, which part of image will be returned and what parameters will be used while generating the result. This method is referred as "document for spot" method.
In both cases, HOPA gives you an opportunity to perform more specific choice within set of possible documents by defining extra conditions regarding desired value of any attribute describing document in HyperDoc data base. Print templates
To accomplish user-defined shape of printouts, HyperDoc makes use of print template concept. A print template is a special vector drawing that keeps layout of printout for desired page format and setup. The print template defines document localization on the paper sheet via special vector entity called "image window". Additional graphical elements, like standard border definition, description texts, company logo or other decorative elements may be also defined.
The print template may contain special text macros that HyperDoc interprets while printing documents. Text macros to be expanded in print template should be entered in a special format referred to as dynamic texts. The way HyperDoc resolves text macro is declared by its first char.
A set of predefined text macros start from "$" char, e.g. "$Date", "$DocumentName". User-defined universal SQL SELECT queries start from "@" char in a form "@SELECT …". Text macros to be resolved externally must start from "!" char, e.g. "!CompanyName".
For more complex printouts, multiple "image widows" with different documents placed in each of them may be used. You may compose e.g. specific template for presenting flats with detailed flat plan in one image window, overall building plan with marked flat localization in second image window, and general photo of the building in third image window.
HyperDoc uses a separate utility called Template Editor for preparing print template drawings. Dynamic presentations
HyperDoc offers flexible way for visual presentation of chosen features of business objects on graphical documents. This is accomplished by imposing predefined sets of graphical tools (e.g. with different fill color, border width, hatch type) to spots linked to these objects that fulfill desired criteria specified in general way as SQL predicates.
Dynamic presentations, defined by HyperDoc and maintained in its database, may be activated on request using presentation name. When the presentation is applied to printed document, additional presentation legend may be automatically inserted into legend area predefined in print template. HyperDoc Online
HyperDoc Online is a special module, which allows read-only access to HyperDoc database via Internet. Its user interface, implemented in form of HTML frames and Java applets, reassembles original HyperDoc interface known from local installation in Internet environment.
HOPA usage scenarios
Typically HyperDoc clients use HyperDoc to manage theirs documents repositories. Some of them use HyperDoc Online to browse documents in the repository in read-only mode. Mostly HyperDoc and HyperDoc Online are used in Local Area Network. It is possible to make a server with HyperDoc Online available in the Internet. If HyperDoc Online is accessible from the Internet then you can use HOPA while implementing the web application. If you don't want to get your web application access to all documents stored in your repository you can use separate HO installation outside your LAN where only required documents are replicated. HyperDoc Replication Add-In allows you incrementally replicate document subset to the remote database handled by HyperDoc Online. Direct access to a HyperDoc database via HOPA
The following picture shows this type of integration implemented in Telge Bostäder project:  Telge Bostäder uses HyperDoc and HyperDoc Online in LAN environment. They decided to use existing HyperDoc Online installation as a source of drawings that should be published in the Internet.
The integration the external web application and HyperDoc Online is very simple. Whenever the web application wants to display or print document associated with a given flat it should request it from the HyperDoc Online using Publishing API.
Using replication to narrow amount of data available for external web application
The following picture shows this type of integration implemented in ÖrebroBostäder / Momentum project:  ÖrebroBostäder uses HyperDoc and HyperDoc Online in their LAN environment. Additionally they have WEB application (HUSAR) hosted on the external Internet server. Due to security of document repository ÖrebroBostäder decided to use second HyperDoc Online installation working as Publishing Agent. HyperDoc Online Publishing Agent is installed on the same server as HUSAR application. It uses database which configuration reflects original HyperDoc database configuration. It is possible to narrow visible fields for all objects and document stored in this remote database. ÖrebroBostäder Marketing Clerk uses HyperDoc Replication Add-In to incrementally update objects and documents available on the remote database. The WEB application, HUSAR, has been modified. When HUSAR prepares HTML page about a particular flat it requests graphical data from HyperDoc Online Publishing Agent.
The integration procedure consists of the following steps:
- Installing and configuring remote HyperDoc database. You can use different database engine on the remote server than used by original HyperDoc installation. For example you can use SQL Server with your original HyperDoc installation and Jet database as replicated copy.
- Installing HyperDoc Online Publishing Agent on the remote server.
- Modifying WEB application to use HyperDoc Online Publishing API whenever you want to display or print document associated with a given object.
- Installing Replication Add-In.
- Replicating periodically data to be published on the remote server.
|