Annotations

Configuration de la politique de creation d’annotation

Il est possible de définir au préalable différents comportements vis-à-vis de la création d’annotation dans ARender. Cette configuration se fait dans le fichier configurations/arender-custom-server.properties.

Propriété Description Type
arender.server.annotations.can.create Autoriser à créer des annotations. Booléen
arender.server.annotations.text.html.support Notes textuelles supportent le HTML. Booléen
arender.server.annotations.text.reply.support Notes textuelles supportent les réponses. Booléen
arender.server.annotations.text.status.support Notes textuelles supportent les statuts. Booléen
arender.server.annotations.text.security.support Annotations supportent la sécurité. Booléen
arender.server.annotations.text.comment.reply.support Notes textuelles supportent les réponses dans l’exploreur d’annotation. Booléen

Voir les parties correspondantes pour la configuration de la sécurité des annotations AnnotationSecurity et les modèles de tampon Stamp.

Configuration des modèles de tampons

Afin de modifier les tampons existants, ou bien en rajouter de nouveaux, modifier la configuration existante dans annotation-template-catalog.xml. Deux types de tampons sont disponibles, les tampons texte et image.

Tampon texte

Les propriétés configurables sont :

Description Clé du paramètre Type
Nom du tampon name Texte
Couleur de la police fontColor Texte (couleur en texte ou hexadécimal)
Taille de la police fontSize Entier
Couleur du fond backgroundColor Texte (couleur en texte ou hexadécimal)
Couleur de la bordure borderColor Texte (couleur en texte ou hexadécimal)
Style de bordure borderStyle Entier (O ou 1, sans ou avec bordure)
Rotation (en °) rotation Entier
Exemple d'un tampon texte
<bean class="com.arondor.viewer.client.api.annotation.templates.AnnotationTemplate">
    <property name="name" value="Urgent" />
    <property name="annotationType">
         <value
             type="com.arondor.viewer.annotation.common.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>

Tampon image

Les propriétés configurables sont :

Description Clé du paramètre Type
Nom du tampon name Texte
Chemin vers l’image imageLocation Texte (image base64 ou url vers l’image)
Taille de l’image defaultPosition PageRelativePosition
Largeur width Entier
Hauteur height Entier
Rotation (en °) rotation Entier
Exemple d'un tampon image
<bean class="com.arondor.viewer.client.api.annotation.templates.AnnotationTemplate">
    <property name="name" value="Image" />
        <property name="annotationType">
            <value
                type="com.arondor.viewer.annotation.common.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/jQae8jSGY5KNwFfMb8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UEBATUIv4PjLUPTjqL7sIAAAAASUVORK5CYII=" />
        <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>

Configuration de la création d’annotations

Il est possible de surcharger des propriétés d’annotation définies par défaut dans configurations/arender-custom-client.properties, comme par exemple l’opacité ou bien la couleur. La configuration a lieu dans events-configuration.xml dans un bean d’action de création (class = com.arondor.viewer.client.toppanel.behavior.annotation.CreateAnnotationButtonHandler) Pour cela il faut définir en plus du type d’annotation à créer, un modèle d’annotation.

Le bean complet d’un rectangle bleu avec une bordure de taille 12 et vide au centre (Opacité à 0) est composé de la manière suivante :

<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>
            <!-- Définition de l'annotation -->
            <property name="model">
                <!-- Classe d'annotation -->
                <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>
            <!-- Fin de la définition de l'annotation -->
        </bean>
    </constructor-arg>
</bean>

Les propriétés disponibles selon les types d’annotation sont :

Type d’annotation Classe Propriétés configurables (Type de la propriété)
Square SquareElemType opacity (décimal), width (entier), color (Color, couleur de la bordure), interiorColor (Color, couleur intérieure),
Circle CircleElemType opacity (décimal), width (entier), color (Color, couleur de la bordure), interiorColor (Color, couleur intérieure), style (StyleBEType, style de la bordure)
Text SquareElemType opacity (décimal), color (Color)
Highlight HighlightElemType opacity (décimal), color (Color), flags (AnnotationFlags)
Underline UnderlineElemType opacity (décimal), color (Color), flags (AnnotationFlags)
Strikeout StrikeoutElemType opacity (décimal), color (Color), flags (AnnotationFlags)
Line LineElemType opacity (décimal), color (Color), head (LineEndType , tête de la flèche), tail (LineEndType, queue)
Polygon PolygonElemType opacity (décimal), width (entier), color (Color,couleur de la bordure), interiorColor (Color, couleur intérieure), style (StyleBEType, style de la bordure)
Polyline PolylineElemType opacity (décimal), width (entier), color (Color)
Ink InkElemType opacity (décimal), width (entier), color (Color)

Précision sur les propriétés :

  • Color : une couleur est définie de la façon suivante. Les valeurs r,g et b sont comprises entre 0 et 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 : les valeurs autorisées sont 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 : un tag d’obfuscation est disponible
<property name="flags">
    <bean class="com.arondor.viewer.annotation.common.AnnotationFlags">
        <property name="obfuscate" value="true" />
    </bean>
</property>
  • Style : Deux styles sont disponibles : CLOUDY et SOLID
<property name="style">
    <bean class=" com.arondor.viewer.annotation.api.StyleBEType">
        <constructor-arg>
            <value>CLOUDY</value>
        </constructor-arg>
    </bean>
</property>

Configuration de la sécurité des annotations

La liste des sécurités permet de définir les sécurités que l’on souhaite pour toutes les annotations. Cette liste sera visible en tant que liste déroulante dans la barre d’outils lors de l’édition d’une annotation. Chaque sécurité est défini par deux paramètres :

  • symbolicName, correspondant à la valeur envoyée au serveur pour traitement.
  • localizedDisplayNames, correspondant à un tableau associatif ayant pour chaque entrée la locale comme clé et valeur affichée à l’utilisateur comme valeur.
Exemple
<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 d’un sous-menu pour les boutons de création d’annotation

Depuis la version 4.7.x, les boutons d’annotations sont dans la barre de menu par défaut, ils ne sont plus dans un sous-menu.

img

Configuration actuel des boutons dans le toppanel

Voici la configuration actuelle du bean servant de conteneur pour les boutons de création d’annotation :

Exemple
    <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>
    

Voici un exemple de bean qui définit un bouton de création d’annotation se trouvant dans le toppanel :

Exemple
    <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 pour mettre les boutons dans un sous-menu

Le sous-menu

Le conteneur va devoir être modifié afin de devenir un bouton ouvrant un sous-menu. En premier les propriétés suivantes doivent être supprimées car elles ne sont pas compatibles avec le sous-menu :

  • shrinkToDropDown
  • dropdownId
  • dropdownClassName

La classe du bean doit être modifiée pour qu’elle corresponde à un bouton ouvrant un sous-menu. La nouvelle classe à utiliser est com.arondor.viewer.client.toppanel.presenter.SubMenuButtonPresenter.

Voici l’exemple complet du bean, à mettre dans le fichier arender-custom-integration.xml, qui permet d’avoir un bouton ouvrant un sous-menu à la place d’un simple conteneur de bouton dans le toppanel :

Exemple
<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>

Les boutons dans le sous-menu

Pour mettre les boutons dans un sous-menu, il va falloir prendre les bean correspondants aux annotations que vous voulez mettre dans le sous-menu, puis les rajouter dans le fichier arender-custom-integration.xml. Ensuite, les propriétés suivantes devront être supprimées car elles ne sont pas compatibles avec un bouton de sous-menu :

  • name
  • buttonGroup
  • inactiveButtonHandler
  • supportShortCut
  • shortcut

La classe du bean doit être modifiée afin d’avoir un bouton pouvant bien s’intégrer dans le sous-menu. La nouvelle classe à utiliser est com.arondor.viewer.client.widgets.DropdownMenuItem.

Si le double-clique doit être géré, alors il faudra ajouter avant la propriété buttonHandler, la propriété suivante permettant de définir le temps, en milliseconde, de l’intervalle entre les deux cliques :

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

Une fois ces étapes terminées, vous allez avoir un bean ressemblant à l’exemple suivant. L’étape devra être répétée pour chaque bouton devant être ajouté dans un sous-menu.

Exemple
<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>

Résultat avec plusieurs boutons de création d’annotation dans le sous-menu :

img