Documentation

The complete knowledge base about ARender - How to install it and how to configure it as needed

Annotations

Annotation creation policy configuration

It is possible to define several behavior for annotation creation in ARender. This configuration is in file arender-server-custom-<…>.properties.

Key parameter Description Type
arender.server.annotations.can.create Allow users to create annotation. Booléen
arender.server.annotations.text.html.support Sticky note supports HTML. Booléen
arender.server.annotations.text.reply.support Sticky note supports replies. Booléen
arender.server.annotations.text.status.support Sticky note supports status. Booléen
arender.server.annotations.text.security.support Sticky note supports security. Booléen

Look at corresponding parts for annotation securities AnnotationSecurity and stamp templates Stamp.

Stamp template configuration

To modify existing stamp, or add new stamps, default configuration is at annotation-template-catalog.xml. There are two type of stamps are available: Text and image stamp.

Text stamp

Configurable properties are:

Description Key parameter Type
Stamp name name String
Font color fontColor String (text color or hexadecimal)
Font size fontSize Integer
Background color backgroundColor Texte (text color or hexadecimal)
Border color borderColor Texte (text color or hexadecimal)
Border style borderStyle Integer (0 or 1, without or with border)
Rotation (°) rotation Integer
Text stamp example
<bean class="com.arondor.viewer.client.api.annotation.templates.AnnotationTemplate">
    <property name="name" value="Urgent" />
    <property name="annotationType">
         <value
             type="com.arondor.viewer.client.api.annotation.Annotation$AnnotationType">Stamp</value>
    </property>
    <property name="contentTemplate" value="Urgent" />
    <property name="annotationStyle">
         <bean class="com.arondor.viewer.client.api.annotation.AnnotationStyle">
             <property name="fontColor" value="red" />
             <property name="fontSize" value="20" />
             <property name="backgroundColor" value="none" />
             <property name="borderColor" value="red" />
             <property name="borderStyle" value="1" />
             <property name="borderWidth" value="1" />
             <property name="rotation" value="350" />
         </bean>
    </property>
</bean>

Image Stamp

Configurable properties are:

Description Key parameter Type
Stamp name name String
Image url imageLocation String (base64 image or image url)
Image size defaultPosition PageRelativePosition
Width width Integer
Height height Integer
Rotation (°) rotation Integer
Image stamp example
<bean class="com.arondor.viewer.client.api.annotation.templates.AnnotationTemplate">
    <property name="name" value="Image" />
        <property name="annotationType">
            <value
                type="com.arondor.viewer.client.api.annotation.Annotation$AnnotationType">ImageStamp</value>
        </property>
        <property name="imageLocation"
            value="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAABUCAYAAADH/HimAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3goBDi0zg4i+yAAAABl0RVh0Q29tbWVudABDcmVhdGVkIHdpdGggR0lNUFeBDhcAABHBSURBVHja7Z17mFR1Gcc/M7OwuyDgrlyUSwIiKgqYeU9THksrtFALzSyMzGtPRmWPYppaGmrlrTRvoaV5NzPo8pRpV/CKaYjiJUVQ2FBABRHYOf3xvr/nvPPbc2Zmd2F3dub3fZ55ZnfmzDm/3++89/f9vQcCAgICAgICAgKqEBnzSvs+CVsD25j/s0WODQjo0QxSiiGy+r4XcBfwJvAWsApYDny7BDMFBPRYOMl/FPALYJT3fS9gEvAYEBV5/RTIheUMqFaMVkL/H7C3frYvMF8/3wj8BDgaOBiYCtwErNPvNwATgyYJqGYcaAh+tr6vAS4tYZr9QI/9UVjCgGrHNcZsWgyM8EyxpBfAn4A/B4c9oJocc0vgI4HnlTHeAhYBeeC/wEElzndo0CAB1cYgjjH6AGeojxGpFhgANADXASv185XA/WpuzQIuBm4BXtbvfw80h6UNqBYGyQJNwD9UU0TAHUCdOS4LDAe+AMwxzBIBa4EngUuACcpowawKqBo0Ao8agv958B8qSoDlPC2/A/Ax4HhgnN6/bFiqLYc/GOb4k5pUgTkqA1ninNJU1fIbKMw7nWSODdjMmK4+Rx5Y4mmOTGCSitAgqI8X6X1qNX9HwCFhmTa/VMqqpliii/wusHtgiophCuf/jQae8jSGY5KNwFfMb8J928xS6Qqz6LP1s1AiUjn3ZxiwWhlik9Ec7vVxo+2DebWZMdxT00ODJKoIxnBrPwlYb+5R3jDGfOADHjPRw+5bxY/1arPgfwy0WVGYiYTO80Z7RKpBvoJEsnoScoYpsgnargk4DrgQ+DFwGnGqoFs0YzPwnGGQIwJNVgSGIFHEyDBGHola/RUY1AM1hfN565Xom4GBGliYhZQw+d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YGmAakBApCSjBuQkocc0rDBVdBeR2HFa0BAzWiOeqQ84kLiBNkwJMPailSopgUTAgKqDn5i7Xzilv0ZJCHo9mmfmmKGBQRUvebYCSnmazDMAvJglwgparOaIyCgZjCDwke0OSZwO82O8pgpMEhATZhVjcgehPHEmXhnOt2mzLG3YY6AgJrBnshmqTEe07imARFS7Rl8joCaw1Qkt7GVxwAZ4G8UdiIJ2iOg6s0pjAl1LPEWSlsWPQgpU9+EbJsNjBFQ9bBlE1mkU+NJtM18jyBuMjDZ+y4wSUDVO+Oupcxk2m7K2Y64u8d+wecIqBXN4TAU6Q5/hKdVQHpducYB0zymCgioejQgLUHH0HbPSDOyDzlC9o6TwEABAVWnOWy7zccp3KvhXqOQTU4R0mnDOuzBvAqoWsaw/WAfJu615BoIgOzfcA75pYSq3IAagStV/wCyHXbHBMbpj/S7tfs5csHvCKh2Z9y9jwP+Ttw0zppMffW7CGn9SfA1AmqBQbLGdFqGtNDplaA9nlbmuMZojqA1AmoC2yHh2lM9xnEFib9X5jjXc8iDBgmoaqc8Y7TDRZ5Z5Zxy91yNyUFjBNSi3zEHKTBs8BzuRuRJQquQ/qsEBgmoNSb5MdLdvNn7fADS2XwVslPQfhfMqoCaYI7DkA7oAyjMko9Fuq2vI/STDahRTEAelLO/pxU+h7T4t7VVAQE1hX7IcxyO9DTKbOIHovwymFMBtWpanYO0AXUYjTy1yLUFdQ+5yYUlC6g15tidwr3i5wCvEzeS/jKFD6AJUauAmsJC2j60MlIm2c0wU+grG1CTmO0xxlKkdGRYWJqAajadyj0uizSR7os8ydT5Ha1hKQNqnZHSfIpgSgUEBATUIv4PjLUPTjqL7sIAAAAASUVORK5CYII=" />
        <property name="defaultPosition">
            <bean class="com.arondor.viewer.client.api.geometry.PageRelativePosition">
                 <property name="w" value="200" />
                 <property name="h" value="100" />
            </bean>
        </property>
        <property name="annotationStyle">
            <bean class="com.arondor.viewer.client.api.annotation.AnnotationStyle">
                <property name="rotation" value="340" />
            </bean>
        </property>
</bean>

Annotation creation configuration

In a annotation creation action button it is possible to override annotation properties defined in arender-default.properties, as default annotation color or opacity. This configuration is done in events-configuration.xml in a creation bean (class = com.arondor.viewer.client.toppanel.behavior.annotation.CreateAnnotationButtonHandler) In the creation action bean, definition of an annotation is needed.

Complete definition of empty blue border rectangle:

<bean id="SquareCreationAction" class="com.arondor.viewer.client.toppanel.behavior.annotation.CreateAnnotationButtonHandler">
    <constructor-arg>
        <bean class="com.arondor.viewer.client.annotation.events.PrepareAnnotationCreationEvent">
            <constructor-arg>
                <value type="com.arondor.viewer.annotation.common.AnnotationType">Square</value>
            </constructor-arg>
            <!-- annotation definition -->
            <property name="model">
                <!-- annotation classes -->
                <bean class="com.arondor.viewer.annotation.api.SquareElemType">
                    <!-- annotation properties -->
                    <property name="width" value="12" />
                    <property name="opacity" value="0" />
                    <property name="color">
                        <bean class="com.arondor.viewer.annotation.common.Color">
                            <property name="r" value="0" />
                            <property name="g" value="0" />
                            <property name="b" value="255" />
                        </bean>
                    </property>
                </bean>
            </property>
            <!-- End of annotation definition -->
        </bean>
    </constructor-arg>
</bean>

Available properties are:

Annotation type Class Configurable property (property type)
Square SquareElemType opacity (decimal), width (integer), color (Color, border color), interiorColor (Color, interior color), style (StyleBEType, border style)
Circle CircleElemType opacity (decimal), width (integer), color (Color, border color), interiorColor (Color, interior color), style (StyleBEType, border style)
Text SquareElemType opacity (decimal), color (Color)
Highlight HighlightElemType opacity (decimal), color (Color), flags (AnnotationFlags)
Underline UnderlineElemType opacity (decimal), color (Color), flags (AnnotationFlags)
Strikeout StrikeoutElemType opacity (decimal), color (Color), flags (AnnotationFlags)
Line LineElemType opacity (decimal), color (Color), head (LineEndType), tail (LineEndType)
Polygon PolygonElemType opacity (decimal), width (integer), color (Color,border color), interiorColor (Color, interior color), style (StyleBEType, border style)
Polyline PolylineElemType opacity (decimal), width (integer), color (Color)
Ink InkElemType opacity (decimal), width (integer), color (Color)

Precision about properties:

  • Color: a color is defined on this model. r,g et b values are between 0 and 255.
<property name="color">
    <bean class="com.arondor.viewer.annotation.common.Color">
        <property name="r" value="0" />
        <property name="g" value="0" />
        <property name="b" value="255" />
    </bean>
</property>
  • LineEndType: authorized values SQUARE, CIRCLE, DIAMOND, OPEN_ARROW, CLOSED_ARROW, NONE, BUTT, R_OPEN_ARROW, R_CLOSED_ARROW
<property name="head">
    <value type="com.arondor.viewer.annotation.api.LineEndType">NONE</value>
</property>
  • AnnotationFlags: obfuscate tag is available
<property name="annotationFlags">
    <bean class="com.arondor.viewer.annotation.common.AnnotationFlags">
        <property name="obfuscate" value="true" />
    </bean>
</property>
  • Style: Two styles are available: CLOUDY and SOLID
<property name="style">
    <bean class=" com.arondor.viewer.annotation.api.StyleBEType">
        <constructor-arg>
            <value>CLOUDY</value>
        </constructor-arg>
    </bean>
</property>

Annotation securities configuration

Securities list allows to define securities for all annotations. This list is visible as dropdown list in annotation toolbar when an annotation is in edit mode. Every security has two parameters:

  • symbolicName, value sent to server for processing.
  • localizedDisplayNames, a map which have for every entry locale as key and display name as value.
Example
<bean id="availableSecurityLevels" class="java.util.ArrayList">
    <constructor-arg>
        <list>
            <bean class="com.arondor.viewer.annotation.common.SecurityLevel">
                <property name="symbolicName" value="private" />
                <property name="localizedDisplayNames">
                    <map>
                        <entry>
                            <key>
                                <value>fr</value>
                            </key>
                            <value>Privé</value>
                        </entry>
                        <entry>
                            <key>
                                <value>en</value>
                            </key>
                            <value>Private</value>
                        </entry>
                    </map>
                </property>
            </bean>
            <bean class="com.arondor.viewer.annotation.common.SecurityLevel">
                <property name="symbolicName" value="public" />
                <property name="localizedDisplayNames">
                    <map>
                        <entry>
                            <key>
                                <value>fr</value>
                            </key>
                            <value>Public</value>
                        </entry>
                        <entry>
                            <key>
                                <value>en</value>
                            </key>
                            <value>Public</value>
                        </entry>
                    </map>
                </property>
            </bean>
        </list>
    </constructor-arg>
</bean>

Configuration of a submenu for the annotation creation buttons

Since the version 4.7.x, the annotation buttons are in the toppanel by default, they are no longer in a submenu.

img

Current configuration of the buttons in the toppanel

Here is the current configuration of the bean serving as the container for the annotation creation buttons :

Example
    <bean id="annotationMenu"
		class="com.arondor.viewer.client.toppanel.presenter.SimpleButtonSetPresenter">
		<property name="enabled" value="${topPanel.annotationMenu}" />
		<property name="orderedNamedList" value="${topPanel.annotation.buttons.beanNames}" />
		<property name="className" value="fullHeight annotationMenu" />
		<property name="visibilityForTopPanel">
			<ref bean="topPanelVisibilityMode" />
		</property>
		<property name="shrinkToDropDown" value="true" />
		<property name="dropdownId" value="dropdownAnnotation" />
		<property name="dropdownClassName" value="standardButton icon-add-annotations more-icon" />
	</bean>

Here is an example of a bean that defines an annotation creation button located in the toppanel:

Example
    <bean id="addHighlightRectangleAnnotationButton"
		class="com.arondor.viewer.client.widgets.ActivableButtonPresenter">
		<constructor-arg value="addHighlightRectangleAnnotationButton" />
		<property name="name" value="Square" />
		<property name="supportDoubleClick" value="${topPanel.annotationMenu.highlight.repeat}" />
		<property name="enabled" value="${topPanel.annotationMenu.highlight}" />
		<property name="className" value="standardButton icon-highlight-area toppanelButton" /> 
		<property name="buttonGroup" value="topPanel" />
		<property name="buttonTitle">
			<ref bean="labels#addRectangleAnnotation" />
		</property>
		<property name="visibilityForTopPanel">
			<ref bean="topPanelVisibilityMode" />
		</property>
		<property name="doubleClickButtonHandler">
			<ref bean="highlightCreationRepeatableAction" />
		</property>
		<property name="inactiveButtonHandler">
			<ref bean="quitAnnotationCreationAction" />
		</property>
		<property name="buttonHandler">
			<ref bean="highlightCreationAction" />
		</property>
		<property name="supportShortCut" value="true"/>
		<property name="shortcut">
			<bean
				class="com.arondor.viewer.client.documentcontent.shortcuts.KeyboardShortCut"
				scope="prototype">
				<property name="ctrl" value="true" />
				<property name="key" value="${shortcut.annotation.rectangle.key}" />
				<property name="enabled" value="${shortcut.annotation.rectangle.enabled}" />
			</bean>
		</property>
	</bean>

Configuration to put the buttons in a submenu

The submenu

The container will have to be modified in order to become a button opening a submenu. First the following properties must be deleted because they are not compatible with the submenu :

  • shrinkToDropDown
  • dropdownId
  • dropdownClassName

The class of the bean must be modified so that it corresponds to a button opening a submenu. The new class to be used is com.arondor.viewer.client.toppanel.presenter.SubMenuButtonPresenter.

Here is the complete example of the bean, to be put in the arender-custom-integration.xml file, which allows to have a button opening a submenu instead of a simple button container in the toppanel :

Example
<bean id="annotationMenu"
    class="com.arondor.viewer.client.toppanel.presenter.SubMenuButtonPresenter">
    <constructor-arg value="annotationMenu"/>
    <property name="enabled" value="${topPanel.annotationMenu}" />
    <property name="orderedNamedList" value="${topPanel.annotation.buttons.beanNames}" />
    <property name="className" value="standardButton icon-add-annotations more-icon" />
    <property name="visibilityForTopPanel">
        <ref bean="topPanelVisibilityMode" />
    </property>
    <property name="buttonGroup" value="topPanel" />
</bean>

The buttons in the submenu

To put the buttons in a submenu, you will have to take the bean corresponding to the annotations you want to put in the submenu, then add them to the arender-custom-integration.xml file. Then the following properties will need to be removed as they are not compatible with a submenu button :

  • name
  • buttonGroup
  • inactiveButtonHandler
  • supportShortCut
  • shortcut

The class of the bean must be modified in order to have a button that can be integrated into the submenu. The new class to use is com.arondor.viewer.client.widgets.DropdownMenuItem.

If the double-click must be managed, then it will be necessary to add before the buttonHandler property, the following property allowing to define the time, in milliseconds, of the interval between the two clicks :

Example
<property name="clickInterval" value="200" />

Once these steps are completed, you will have a bean that looks like the following example. The step will have to be repeated for each button to be added in a submenu.

Example
<bean id="addHighlightRectangleAnnotationButton"
    class="com.arondor.viewer.client.widgets.DropdownMenuItem">
    <constructor-arg value="addHighlightRectangleAnnotationButton" />
    <property name="supportDoubleClick" value="${topPanel.annotationMenu.highlight.repeat}" />
    <property name="enabled" value="${topPanel.annotationMenu.highlight}" />
    <property name="className" value="standardButton icon-highlight-area toppanelButton" /> 
    <property name="clickInterval" value="200" />
    <property name="buttonTitle">
        <ref bean="labels#addRectangleAnnotation" />
    </property>
    <property name="visibilityForTopPanel">
        <ref bean="topPanelVisibilityMode" />
    </property>
    <property name="doubleClickButtonHandler">
        <ref bean="highlightCreationRepeatableAction" />
    </property>
    <property name="buttonHandler">
        <ref bean="highlightCreationAction" />
    </property>
</bean>

Result with several annotation creation buttons in the submenu :

img