Jump to: navigation, search

HotSpotting (Plugin)


Overview

This Plugin is designed to enable the work with HotSpots and Annotations on the server side.

Usage

The Plugin exposes several methods through the classes Annotating and "HotSpotting" that can be used in UBIK® customizing code.

[edit]

Annotating (write annotation to revision)

Example script for the UBIK® Whobert that shows the basic capabilities of the Plugin.

using System;
using System.Windows.Forms;
using UBIK.Kernel;
using UBIK.Compiler;
using System.Linq;
using UBIK.Module.HotSpotting.Module;
using UBIK.WinX.HotSpotting.Models;
using UBIK.WinX.HotSpotting.Common;

namespace Studio
{
        public class ObjectTest
        {
                public void TestObject (params BaseClass[] InVariables)
                {
                        BaseClass obj = InVariables[0];
                        UBIK.Document.DocumentClass sourcedoc = obj.Environment.UBIKDataFactory().ContentObject(new Guid("a847ab9f-1e4c-42ed-933f-833fb8d69b5e")) as UBIK.Document.DocumentClass;
                       
                        // create an instance of the Annotated Document wrapper
                        UBIK.Module.Annotation.AnnotatedDocument pdf = new UBIK.Module.Annotation.AnnotatedDocument(sourcedoc);

                        // optional you can set the relation name
                        pdf.SetRedlineRelationName("MY_RELATION_NAME");

                        UBIK.Document.DocumentClass revDoc;

                        // create a new revision and write annotations to pdf file
                        // True => clear annotations property afterwards
                        if (pdf.WriteAnnotationToRevisionDoc(true, out revDoc))
                        {
                            revDoc.Save();    // save revision document
                            pdf.Save();          // save original document with cleared annotations property
                        }
                       
                        Debugger.Output(this, "*** Finished"); 
                }
        }
}