Árvore de páginas

Versões comparadas

Chave

  • Esta linha foi adicionada.
  • Esta linha foi removida.
  • A formatação mudou.
HTML

<div id="main-content" class="wiki-content group">
	<h1 id="CustomizaçãodeEventos-Índice">Index</h1>
	<p>
		<style type='text/css'>/*<![CDATA[*/
div.rbtoc1412695595605 {
	padding: 0px;
}
div.rbtoc1412695595605 ul {
	list-style: none;
	margin-left: 0px;
}
div.rbtoc1412695595605 li {
	margin-left: 0px;
	padding-left: 0px;
}
/*]]>*/
</style>
	<div class='toc-macro rbtoc1412695595605'>
		<ul class='toc-indentation'>
			<li><span class='TOCOutline'>1</span> <a
				href='#CustomizaçãodeEventos-CustomizaçãodeEventos'>Customization
					of Events</a>
				<ul class='toc-indentation'>
					<li><span class='TOCOutline'>1.1</span> <a
						href='#CustomizaçãodeEventos-EventosDisponíveis'>Available
							Events</a>
						<ul class='toc-indentation'>
							<li><span class='TOCOutline'>1.1.1</span> <a
								href='#CustomizaçãodeEventos-AddDocumentConvertionExt'>AddDocumentConvertionExt</a></li>
							<li><span class='TOCOutline'>1.1.2</span> <a
								href='#CustomizaçãodeEventos-DisplayCentralTasks'>DisplayCentralTasks</a></li>
							<li><span class='TOCOutline'>1.1.3</span> <a
								href='#CustomizaçãodeEventos-DisplayCustomMetadata'>DisplayCustomMetadata</a></li>
							<li><span class='TOCOutline'>1.1.4</span> <a
								href='#CustomizaçãodeEventos-ValidateCustomMetadata'>ValidateCustomMetadata</a></li>
							<li><span class='TOCOutline'>1.1.5</span> <a
								href='#CustomizaçãodeEventos-BeforeDocumentPublisher'>BeforeDocumentPublisher</a></li>
							<li><span class='TOCOutline'>1.1.6</span> <a
								href='#CustomizaçãodeEventos-AfterDocumentPublisher'>AfterDocumentPublisher</a></li>
							<li><span class='TOCOutline'>1.1.7</span> <a
								href='#CustomizaçãodeEventos-BeforeDocumentViewer'>BeforeDocumentViewer</a></li>
							<li><span class='TOCOutline'>1.1.8</span> <a
								href='#CustomizaçãodeEventos-AfterSaveCard'>AfterSaveCard</a></li>
							<li><span class='TOCOutline'>1.1.9</span> <a
								href='#CustomizaçãodeEventos-AfterDeleteCard'>AfterDeleteCard</a></li>
							<li><span class='TOCOutline'>1.1.10</span> <a
								href='#CustomizaçãodeEventos-BeforeWatchContent'>BeforeWatchContent</a></li>
							<li><span class='TOCOutline'>1.1.11</span> <a
								href='#CustomizaçãodeEventos-AfterWatchContent'>AfterWatchContent</a></li>
							<li><span class='TOCOutline'>1.1.12</span> <a
								href='#CustomizaçãodeEventos-BeforeUnwatchContent'>BeforeUnwatchContent</a></li>
							<li><span class='TOCOutline'>1.1.13</span> <a
								href='#CustomizaçãodeEventos-AfterUnwatchContent'>AfterUnwatchContent</a></li>
							<li><span class='TOCOutline'>1.1.14</span> <a
								href='#CustomizaçãodeEventos-OnNotify'>OnNotify</a></li>
							<li><span class='TOCOutline'>1.1.15</span> <a
								href='#CustomizaçãodeEventos-Objetosutilizadosnoseventos'>Objects
									used in events</a>
								<ul class='toc-indentation'>
									<li><span class='TOCOutline'>1.1.15.1</span> <a
										href='#CustomizaçãodeEventos-DocumentDto'>DocumentDto</a></li>
									<li><span class='TOCOutline'>1.1.15.2</span> <a
										href='#CustomizaçãodeEventos-ApproverDto'>ApproverDto</a></li>
									<li><span class='TOCOutline'>1.1.15.3</span> <a
										href='#CustomizaçãodeEventos-DocumentSecurityConfigDto'>DocumentSecurityConfigDto</a></li>
									<li><span class='TOCOutline'>1.1.15.4</span> <a
										href='#CustomizaçãodeEventos-RelatedDocumentDto'>RelatedDocumentDto</a></li>
									<li><span class='TOCOutline'>1.1.15.5</span> <a
										href='#CustomizaçãodeEventos-WatchDTO'>WatchDTO</a></li>
								</ul></li>
						</ul></li>
				</ul></li>
			<li><span class='TOCOutline'>2</span> <a
				href='#CustomizaçãodeEventos-CustomizaçãodeEventosJMS'>Customization
					of JMS Events</a></li>
		</ul>
	</div>
	</p>
	<p>&#160;</p>
	<div>
		<h1 id="CustomizaçãodeEventos-CustomizaçãodeEventos">Customization
			of Events</h1>
	</div>
	<p>The customization of events is performed by creating scripts in
		the "JavaScript" scripting language. The implementation code of each
		script is stored in database and does not require the use of any other
		files, like for example, "custom.p".</p>
	<p>
		The customization of events for Fluig are created by the administrator
		from Fluig Studio. In the Fluig project, right click the folder &#160;<em>events&#160;</em>
		and then &#160;<em>New -> Fluig Global Event</em>&#160; as shown in
		the figure below.
	</p>
	<p>
		<img class="confluence-embedded-image image-center"
			src="http://tdn.totvs.com/download/attachments/75270416/image2013-9-19%2015%3A29%3A28.png?version=1&modificationDate=1379615299000&api=v2"
			data-image-src="http://tdn.totvs.com/download/attachments/75270416/image2013-9-19%2015%3A29%3A28.png?version=1&modificationDate=1379615299000&api=v2">
	</p>
	<p style="text-align: center;">
		<strong>Figure 1 - Event creation - Fluig Studio.</strong>
	</p>
	<p style="text-align: center;">
		<strong><br /></strong>
	</p>
	<p>Then simply enter the Server and the Name of the Event that will
		be added. A screen for editing the event opens, as in the following
		image:</p>
	<p>
		<img class="confluence-embedded-image image-center"
			src="http://tdn.totvs.com/download/attachments/75270416/image2013-9-19%2015%3A33%3A41.png?version=1&modificationDate=1379615552000&api=v2"
			data-image-src="http://tdn.totvs.com/download/attachments/75270416/image2013-9-19%2015%3A33%3A41.png?version=1&modificationDate=1379615552000&api=v2">
	</p>
	<p style="text-align: center;">
		<strong>Figure 2 - Event creation - Fluig Studio.</strong>
	</p>
	<p style="text-align: center;">
		<strong><br /></strong>
	</p>
	<p>
		You can also note that the .js file has been added to the project's
		&#160;<em>events</em>&#160; folder.
	</p>
	<p>&#160;</p>
	<p>Fluig allows you to use execution log in the customization of
		events. Through the global variable "log", you can get feedback of the
		execution of each event. There are four log levels, they are:</p>
	<ul>
		<li><strong>ERROR:</strong>&#160; presentation of errors.</li>
		<li><strong>DEBUG:</strong>&#160; debug execution.</li>
		<li><strong>WARN:</strong>&#160; inform possible execution
			problem.</li>
		<li><strong>INFO:</strong> &#160;presentation of messages.</li>
	</ul>
	<p>&#160;</p>
	<p>The presentation of each of the log types is conditioned to the
		application server configuration. For example, in JBoss®, by default,
		messages of the info and warn type are displayed on the server console
		and the debug and error type are displayed in the log file. Following
		is an example of log in script use:</p>
	<div class="code panel pdl" style="border-width: 1px;">
		<div class="codeContent panelContent pdl">
			<pre class="theme: Confluence; brush: java; gutter: false"
				style="font-size: 12px;">            log.info ("Testing the log info");</pre>
		</div>
	</div>
	<p>
		<span>There would be at the server console, the "Testing the
			log info" message.</span>
	</p>
	<p>
		<span><br /></span>
	</p>
	<div class="aui-message warning shadowed information-macro">
		<p class="title">Attention</p>
		<span class="aui-icon icon-warning">Icon</span>
		<div class="message-content">
			<p>
				Most events have <strong>WKUser</strong> to identify the user. This
				one by using the substitute function, where a user can substitute
				another, will always return the user that is currently using the
				system.
			</p>
			<p>
				Example: Ana set Bruno as her substitute, Bruno accesses the system
				and makes an action on behalf of Ana. The system will return user
				code Bruno in the events that use <strong>WKUser</strong>.
			</p>
		</div>
	</div>
	<p>&#160;</p>
	<h2 id="CustomizaçãodeEventos-EventosDisponíveis">
		<span>Available Events</span>
	</h2>
	<p>Following, the events available in Fluig will be detailed.</p>
	<h3 id="CustomizaçãodeEventos-AddDocumentConvertionExt">AddDocumentConvertionExt</h3>
	<p>
		This event enables you to customize document conversion performed by
		Fluig. More information about it can be found in the &#160;<a
			href="Conversores-de-Documentos_73082704.html">Document
			Converters</a> guide.
	</p>
	<p>&#160;</p>
	<h3 id="CustomizaçãodeEventos-DisplayCentralTasks">DisplayCentralTasks</h3>
	<p>This event is triggered before task central is displayed.
		Through it you can insert, change, or remove the links from task
		central. The event receives as parameter a LinkedHashMap with links
		available at task central.</p>
	<p>Example adding a custom link at the end of the items of task
		central:</p>
	<div class="code panel pdl" style="border-width: 1px;">
		<div class="codeContent panelContent pdl">
			<pre class="theme: Confluence; brush: java; gutter: false"
				style="font-size: 12px;">function displayCentralTasks (links){
links.put("Fluig","http://www.fluig.com");
}</pre>
		</div>
	</div>
	<p>&#160;</p>
	<p>Examples changing the display order of the links and adding
		three new ones, one at the beginning and two at the end:</p>
	<div class="code panel pdl" style="border-width: 1px;">
		<div class="codeContent panelContent pdl">
			<pre class="theme: Confluence; brush: java; gutter: false"
				style="font-size: 12px;">function displayCentralTasks (links){
	var _links = new java.util.LinkedHashMap();
	_links.put("Fluig","http://www.fluig.com");                                     
    var it = links.keySet().iterator();
    while (it.hasNext()) {           
       var key = it.next();
       _links.put(key, links.get(key));
	}             
	_links.put("Fluig - DEV" ,"http://dev.fluig.com");
	_links.put("Google","http://www.google.com.br/search?sourceid=chrome&amp;ie=UTF-8&amp;q=" + getValue("WKUser"));
	links.clear();
	links.putAll(_links);
}</pre>
		</div>
	</div>
	<p>&#160;</p>
	<p>Some information about the user and the company have been made
		available, but only for query through the getValue method.</p>
	<div class="table-wrap">
		<table class="confluenceTable">
			<tbody>
				<tr>
					<td class="confluenceTd"><p>WKUser</p></td>
					<td class="confluenceTd"><p>User code</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>WKCompany</p></td>
					<td class="confluenceTd"><p>Company number</p></td>
				</tr>
			</tbody>
		</table>
	</div>
	<div class="code panel pdl" style="border-width: 1px;">
		<div class="codeHeader panelHeader pdl"
			style="border-bottom-width: 1px;">
			<b>Example</b>
		</div>
		<div class="codeContent panelContent pdl">
			<pre class="theme: Confluence; brush: java; gutter: false"
				style="font-size: 12px;">function displayCentralTasks (links){
log.info("User: “ + getValue("WKUser"));
}</pre>
		</div>
	</div>
	<p>&#160;</p>
	<h3 id="CustomizaçãodeEventos-DisplayCustomMetadata">DisplayCustomMetadata</h3>
	<p>This event is triggered before the customized fields of a
		document are displayed, both at post and editing. Through it you can
		suggest the initial values for document metadata customized fields.
		The event receives a reference to the customized fields as parameter.</p>
	<div class="code panel pdl" style="border-width: 1px;">
		<div class="codeHeader panelHeader pdl"
			style="border-bottom-width: 1px;">
			<b>Example</b>
		</div>
		<div class="codeContent panelContent pdl">
			<pre class="theme: Confluence; brush: java; gutter: false"
				style="font-size: 12px;">function displayCustomMetadata(fields){
}</pre>
		</div>
	</div>
	<p>In the context of this event, the variable fields can be used to
		query or modify the values of the customized fields in a document. It
		does not allow adding new fields.</p>
	<p>To add new fields to a document, there are several possible
		ways.</p>
	<ul>
		<li>By inheritance from the parent folder.</li>
		<li>In the Customized Fields registration, by selecting the
			option &#160;<em>Show in all documents</em>&#160; or the default way.
		</li>
		<li>Through the WebService CustomFieldsService.</li>
		<li>When editing the document metadata, by the user.</li>
	</ul>
	<p>&#160;</p>
	<p>To query the value of a customized field in this event, use
		fields.getValue, passing as parameter the desired field code.
		Returning "null", if the field is not available for this document.</p>
	<div class="code panel pdl" style="border-width: 1px;">
		<div class="codeHeader panelHeader pdl"
			style="border-bottom-width: 1px;">
			<b>Example</b>
		</div>
		<div class="codeContent panelContent pdl">
			<pre class="theme: Confluence; brush: java; gutter: false"
				style="font-size: 12px;">function displayCustomMetadata(fields){
	log.info("Value of Field 1: “ + fields.getValue("campo1"));
}</pre>
		</div>
	</div>
	<p>
		<span><br /></span>
	</p>
	<p>
		<span>For editing, use fields.setValue, passing as parameter
			first the field name, then the value.</span>
	</p>
	<div class="code panel pdl" style="border-width: 1px;">
		<div class="codeHeader panelHeader pdl"
			style="border-bottom-width: 1px;">
			<b>Example</b>
		</div>
		<div class="codeContent panelContent pdl">
			<pre class="theme: Confluence; brush: java; gutter: false"
				style="font-size: 12px;">function displayCustomMetadata(fields){
	fields.setValue("field1","Value for Field 1");
}</pre>
		</div>
	</div>
	<p>&#160;</p>
	<p>&#160;</p>
	<p>In addition to the values of the customized fields, we provide
		some document information that is being created or edited, however
		only for query through the getValue method.</p>
	<div class="table-wrap">
		<table class="confluenceTable">
			<tbody>
				<tr>
					<td class="confluenceTd"><p>WKUser</p></td>
					<td class="confluenceTd"><p>User code</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>WKCompany</p></td>
					<td class="confluenceTd"><p>Company number</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>WKNumParentDocument</p></td>
					<td class="confluenceTd"><p>Parent folder number</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>WKDocumentType</p></td>
					<td class="confluenceTd"><p>Document type</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>WKPrivateDocument</p></td>
					<td class="confluenceTd"><p>If the document is being
							published in the private folder (true/false)</p></td>
				</tr>
			</tbody>
		</table>
	</div>
	<div class="code panel pdl" style="border-width: 1px;">
		<div class="codeHeader panelHeader pdl"
			style="border-bottom-width: 1px;">
			<b>Example</b>
		</div>
		<div class="codeContent panelContent pdl">
			<pre class="theme: Confluence; brush: java; gutter: false"
				style="font-size: 12px;">function displayCustomMetadata(fields){
	log.info("User: “ + getValue("WKUser"));
}</pre>
		</div>
	</div>
	<p>&#160;</p>
	<h3 id="CustomizaçãodeEventos-ValidateCustomMetadata">ValidateCustomMetadata</h3>
	<p>This event is triggered before saving the values of the document
		customized fields, both at post and editing. Through it you can change
		or validate the customized field values of document metadada. The
		event receives a reference to the customized fields as parameter.</p>
	<div class="code panel pdl" style="border-width: 1px;">
		<div class="codeHeader panelHeader pdl"
			style="border-bottom-width: 1px;">
			<b>Example</b>
		</div>
		<div class="codeContent panelContent pdl">
			<pre class="theme: Confluence; brush: java; gutter: false"
				style="font-size: 12px;">function validateCustomMetadata(fields){
}</pre>
		</div>
	</div>
	<p>
		<span><br /></span>
	</p>
	<p>
		<span>In the context of this event, the variable fields can be
			used to query or modify the values of the customized fields in a
			document. It does not allow adding new fields.</span>
	</p>
	<p>To add new fields in a document, there are several possible
		ways.</p>
	<ul>
		<li>By inheritance from the parent folder.</li>
		<li>In the Customized Fields registration, by selecting the
			option &#160;<em>Show in all documents</em>&#160; or the default way.
		</li>
		<li>Through the WebService CustomFieldsService.</li>
		<li>When editing the document metadata, by the user.</li>
	</ul>
	<p>&#160;</p>
	<p>To query the value of a customized field in this event, use
		fields.getValue, passing as parameter the desired field code.
		Returning "null", if the field is not available for this document.</p>
	<div class="code panel pdl" style="border-width: 1px;">
		<div class="codeHeader panelHeader pdl"
			style="border-bottom-width: 1px;">
			<b>Example</b>
		</div>
		<div class="codeContent panelContent pdl">
			<pre class="theme: Confluence; brush: java; gutter: false"
				style="font-size: 12px;">function validateCustomMetadata (fields){
	log.info("Value of Field 1: “ + fields.getValue("campo1"));
}</pre>
		</div>
	</div>
	<p>&#160;</p>
	<p>For editing, use fields.setValue, passing as parameter first the
		field name, then the value.</p>
	<div class="code panel pdl" style="border-width: 1px;">
		<div class="codeHeader panelHeader pdl"
			style="border-bottom-width: 1px;">
			<b>Example</b>
		</div>
		<div class="codeContent panelContent pdl">
			<pre class="theme: Confluence; brush: java; gutter: false"
				style="font-size: 12px;">function validateCustomMetadata (fields){
	fields.setValue("field1","Value for Field 1");
}</pre>
		</div>
	</div>
	<p>&#160;</p>
	<p>In addition to the customized field values, we provide some
		information about the document that is being created or edited, but
		only for query through the getValue method.</p>
	<div class="table-wrap">
		<table class="confluenceTable">
			<tbody>
				<tr>
					<td class="confluenceTd"><p>WKUser</p></td>
					<td class="confluenceTd"><p>User code</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>WKCompany</p></td>
					<td class="confluenceTd"><p>Company number</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>WKNumParentDocument</p></td>
					<td class="confluenceTd"><p>Parent folder number</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>WKDocumentType</p></td>
					<td class="confluenceTd"><p>Document type</p></td>
				</tr>
				<tr>
					<td colspan="1" class="confluenceTd">WKDocumentTypeId</td>
					<td colspan="1" class="confluenceTd">Document type ID</td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>WKPrivateDocument</p></td>
					<td class="confluenceTd"><p>If the document is being
							published in the private folder (true/false)</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>WKNumAcess</p></td>
					<td class="confluenceTd"><p>Number of accesses</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>WKComments</p></td>
					<td class="confluenceTd"><p>Document comments</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>WKAuthor</p></td>
					<td class="confluenceTd"><p>Document author code</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>WKCreateDate</p></td>
					<td class="confluenceTd"><p>Document creation date</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>WKDescription</p></td>
					<td class="confluenceTd"><p>Document description</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>WKNumDocument</p></td>
					<td class="confluenceTd"><p>Document number</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>WKNumVersion</p></td>
					<td class="confluenceTd"><p>Document version number</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>WKExpirationDate</p></td>
					<td class="confluenceTd"><p>Document expiration date</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>WKExpires</p></td>
					<td class="confluenceTd"><p>Document expires? (true/false)</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>WKFileSize</p></td>
					<td class="confluenceTd"><p>Document size in bytes</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>WKKeyWord</p></td>
					<td class="confluenceTd"><p>Document keywords</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>WKVolume</p></td>
					<td class="confluenceTd"><p>Document volume</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>WKSubject</p></td>
					<td class="confluenceTd"><p>Subject related to the
							document</p></td>
				</tr>
			</tbody>
		</table>
	</div>
	<div class="code panel pdl" style="border-width: 1px;">
		<div class="codeHeader panelHeader pdl"
			style="border-bottom-width: 1px;">
			<b>Example</b>
		</div>
		<div class="codeContent panelContent pdl">
			<pre class="theme: Confluence; brush: java; gutter: false"
				style="font-size: 12px;">function validateCustomMetadata (fields){
	log.info("User: “ + getValue("WKUser "));
}</pre>
		</div>
	</div>
	<p>&#160;</p>
	<p>The exceptions can be handled using the command throw.</p>
	<p>This command returns a message to the user when they try to save
		the document.</p>
	<div class="code panel pdl" style="border-width: 1px;">
		<div class="codeHeader panelHeader pdl"
			style="border-bottom-width: 1px;">
			<b>Example</b>
		</div>
		<div class="codeContent panelContent pdl">
			<pre class="theme: Confluence; brush: java; gutter: false"
				style="font-size: 12px;">function validateCustomMetadata (fields){
	if( fields.getValue("campo1") == “Area 1”){
   		throw "EXCEPTION HANDLING";
	}
}</pre>
		</div>
	</div>
	<p>&#160;</p>
	<p>&#160;</p>
	<h3 id="CustomizaçãodeEventos-BeforeDocumentPublisher">BeforeDocumentPublisher</h3>
	<p>Used when customized validation must be done in the document
		post/editing screen properties, before saving it to the database.
		Among all the document posting/editing screen properties, the custom
		fields will not be handled, because there is already an event that
		handles this situation.</p>
	<div class="code panel pdl" style="border-width: 1px;">
		<div class="codeHeader panelHeader pdl"
			style="border-bottom-width: 1px;">
			<b>Example</b>
		</div>
		<div class="codeContent panelContent pdl">
			<pre class="theme: Confluence; brush: java; gutter: false"
				style="font-size: 12px;">function beforeDocumentPublisher(){
}</pre>
		</div>
	</div>
	<p>&#160;</p>
	<p>Some properties are made available regarding the document that
		is being created or edited, but only for query through the getValue
		method.</p>
	<p>&#160;</p>
	<div class="table-wrap">
		<table class="confluenceTable">
			<tbody>
				<tr>
					<td class="highlight-grey confluenceTd"
						data-highlight-colour="grey"><p align="center">
							<span style="color: rgb(0, 51, 102);">Property</span>
						</p></td>
					<td class="highlight-grey confluenceTd"
						data-highlight-colour="grey"><p align="center">
							<span style="color: rgb(0, 51, 102);">Description</span>
						</p></td>
					<td class="highlight-grey confluenceTd"
						data-highlight-colour="grey"><p style="text-align: center;">
							<span style="color: rgb(0, 51, 102);">Type</span>
						</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>WKDocument</p></td>
					<td class="confluenceTd"><p>Document Object</p></td>
					<td class="confluenceTd"><p>DocumentDto</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>WKSubject</p></td>
					<td class="confluenceTd"><p>Document Subject Description</p></td>
					<td class="confluenceTd"><p>String</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>WKListApprover</p></td>
					<td class="confluenceTd"><p>Document Approver List</p></td>
					<td class="confluenceTd"><p>List&lt;ApproverDto></p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>WKListSecurity</p></td>
					<td class="confluenceTd"><p>List with document security</p></td>
					<td class="confluenceTd"><p>List
							&lt;DocumentSecurityConfigDto></p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>WKListRelatedDocument</p></td>
					<td class="confluenceTd"><p>List with documents related to
							the document</p></td>
					<td class="confluenceTd"><p>List&lt; RelatedDocumentDto></p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>WKState</p></td>
					<td class="confluenceTd"><p>Action status: PUBLISH or
							MODIFY</p></td>
					<td class="confluenceTd"><p>String</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>WKUser</p></td>
					<td class="confluenceTd"><p>Logged in user</p></td>
					<td class="confluenceTd"><p>String</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>WKCompany</p></td>
					<td class="confluenceTd"><p>Company Code</p></td>
					<td class="confluenceTd"><p>int</p></td>
				</tr>
			</tbody>
		</table>
	</div>
	<div class="aui-message hint shadowed information-macro">
		<p class="title">Note</p>
		<span class="aui-icon icon-hint">Icon</span>
		<div class="message-content">
			<p>
				The&#160;<em>Dto</em>&#160;objects will be explained in the chapter
				"Objects used in the events"
			</p>
		</div>
	</div>
	<p>
		<span><br /></span>
	</p>
	<p>
		The product returns &#160;<em>null</em>&#160; when it is necessary to
		pick up one of the properties of the document that does not exist.
	</p>
	<p>
		For example: Not all posted documents have an approver, thus the
		variable &#160;<em>WKListApprover</em>&#160; will only have
		information when there really are approvers in the post.
	</p>
	<div class="code panel pdl" style="border-width: 1px;">
		<div class="codeHeader panelHeader pdl"
			style="border-bottom-width: 1px;">
			<b>Example</b>
		</div>
		<div class="codeContent panelContent pdl">
			<pre class="theme: Confluence; brush: java; gutter: false"
				style="font-size: 12px;">function beforeDocumentPublisher(){
               
                var doc = getValue("WKDocument");
                var subject = getValue("WKSubject");
                var listApprover = getValue("WKListApprover");
                var listSeg = getValue("WKListSecurity");
                var listRelated = getValue("WKListRelatedDocument");
                var state = getValue("WKState");
                var user = getValue("WKUser");
                var company = getValue("WKCompany");

                log.info("Logged in User: " + user);

                log.info("Company: " + company);
               
                log.info("Document number: "+ doc.getDocumentId() + " - Version: "+ doc.getVersion());
               
                if(listApprover!=null){
                    for(j = 0; j &lt; listApprover.size(); j++) {           
                        if (listApprover.get(j).getColleagueId().equals("adm")){
                            throw "The adm user cannot be the document approver";
                        }
                    }
                }

                if(listSeg != null){
                    for(j = 0; j &lt; listSeg.size(); j++) {     
                        if (listSeg.get(j).getAttributionValue().equals("cvd")){
                            throw "The cvd user cannot be in document security";
                        }
                    }
                }

                if( listRelated != null){
                    log.info("The following documents are related to these documents: ");
                        for(j = 0; j &lt; listRelated.size(); j++) {          
                            log.info("Document no.: "+ listRelated.get(j).getRelatedDocumentId());
                        }
                }
                log.info("Subject: " + subject);
                log.info("Status: " + state);
}</pre>
		</div>
	</div>
	<p>&#160;</p>
	<h3 id="CustomizaçãodeEventos-AfterDocumentPublisher">AfterDocumentPublisher</h3>
	<p>Used when you need to handle customization of the document
		posting/editing screen properties after saving it to the database.
		Among all of the document posting/editing screen properties, the
		custom fields will not be handled.</p>
	<div class="code panel pdl" style="border-width: 1px;">
		<div class="codeHeader panelHeader pdl"
			style="border-bottom-width: 1px;">
			<b>Example</b>
		</div>
		<div class="codeContent panelContent pdl">
			<pre class="theme: Confluence; brush: java; gutter: false"
				style="font-size: 12px;">function afterDocumentPublisher(){
}</pre>
		</div>
	</div>
	<p>
		<span>The properties retrieved through the getValue() method
			are the same of the &#160;</span><em>beforeDocumentPublisher&#160;</em><span>
			events and the form of handing the properties can be seen in the
			example of the &#160;</span><em>beforeDocumentPublisher</em><span>
			event.</span>
	</p>
	<p>&#160;</p>
	<h3 id="CustomizaçãodeEventos-BeforeDocumentViewer">BeforeDocumentViewer</h3>
	<p>Used when customized validation must be done prior to viewing a
		document.</p>
	<div class="code panel pdl" style="border-width: 1px;">
		<div class="codeHeader panelHeader pdl"
			style="border-bottom-width: 1px;">
			<b>Example</b>
		</div>
		<div class="codeContent panelContent pdl">
			<pre class="theme: Confluence; brush: java; gutter: false"
				style="font-size: 12px;">function beforeDocumentViewer (){
}</pre>
		</div>
	</div>
	<p>&#160;</p>
	<p>Some properties are made available regarding the document that
		is being viewed, but only for query through the getValue method.</p>
	<div class="table-wrap">
		<table class="confluenceTable">
			<tbody>
				<tr>
					<td class="highlight-grey confluenceTd"
						data-highlight-colour="grey"><p align="center">
							<span style="color: rgb(0, 51, 102);">Property</span>
						</p></td>
					<td class="highlight-grey confluenceTd"
						data-highlight-colour="grey"><p align="center">
							<span style="color: rgb(0, 51, 102);">Description</span>
						</p></td>
					<td class="highlight-grey confluenceTd"
						data-highlight-colour="grey"><p style="text-align: center;">
							<span style="color: rgb(0, 51, 102);">Type</span>
						</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>WKDocument</p></td>
					<td class="confluenceTd"><p>Document Object</p></td>
					<td class="confluenceTd"><p>DocumentDto</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>WKUser</p></td>
					<td class="confluenceTd"><p>Logged in user.</p></td>
					<td class="confluenceTd"><p>String</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>WKCompany</p></td>
					<td class="confluenceTd"><p>Company Code</p></td>
					<td class="confluenceTd"><p>int</p></td>
				</tr>
			</tbody>
		</table>
	</div>
	<div class="aui-message hint shadowed information-macro">
		<p class="title">Note</p>
		<span class="aui-icon icon-hint">Icon</span>
		<div class="message-content">
			<p>
				The &#160;<em>Dto</em>&#160; objects will be explained in the
				chapter "Objects used in the events".
			</p>
		</div>
	</div>
	<div class="code panel pdl" style="border-width: 1px;">
		<div class="codeHeader panelHeader pdl"
			style="border-bottom-width: 1px;">
			<b>Example</b>
		</div>
		<div class="codeContent panelContent pdl">
			<pre class="theme: Confluence; brush: java; gutter: false"
				style="font-size: 12px;">function beforeDocumentViewer(){

                var doc = getValue("WKDocument");
                var company = getValue("WKCompany");
                var ds
               
                try {
                               var c1 = DatasetFactory.createConstraint(                                                                                                                                                                                                                                                    "allocatedDocumentPK.companyId", company, company, ConstraintType.MUST);
                               var c2 = DatasetFactory.createConstraint( "allocatedDocumentPK.sourceDocument", doc.getDocumentId(), doc.getDocumentId(), ConstraintType.MUST);
                               var c3 = DatasetFactory.createConstraint( "allocatedDocumentPK.sourceVersion", doc.getVersion(), doc.getVersion(), ConstraintType.MUST);
                               var c4 = DatasetFactory.createConstraint("active", "true","true", ConstraintType.MUST);
                                var constraints = new Array(c1, c2, c3, c4);
                               ds = DatasetFactory.getDataset("allocatedDocument", null, constraints, null);

                }catch (e) {
                               log.error("Error trying to recover the document in CheckOut: " + e.message);
                }

                if(ds!=null &amp;&amp; ds.rowsCount>0){       
                               throw  "This document is in Check Out and cannot be viewed. The document " + ds.getValue(0,"allocatedDocumentPK.destinationDocument") + " was generated and is under the responsibility of the user with registration "+ ds.getValue(0,"colleagueId");
                }
}</pre>
		</div>
	</div>
	<p>&#160;</p>
	<h3 id="CustomizaçãodeEventos-AfterSaveCard">AfterSaveCard</h3>
	<p>Used when creating/saving the data of a form record through
		Document Browsing or through Workflow transactions, if you wish to
		save the form record data in an external format. For example, when
		creating the form record, send the data to a Webservice of another
		product.</p>
	<p>&#160;</p>
	<div class="code panel pdl" style="border-width: 1px;">
		<div class="codeHeader panelHeader pdl"
			style="border-bottom-width: 1px;">
			<b>Example</b>
		</div>
		<div class="codeContent panelContent pdl">
			<pre class="theme: Confluence; brush: java; gutter: false"
				style="font-size: 12px;">function afterSaveCard(companyId, formId, cardId, versionId, cardData){
}</pre>
		</div>
	</div>
	<p>&#160;</p>
	<p>With parameters:</p>
	<div class="table-wrap">
		<table class="confluenceTable">
			<tbody>
				<tr>
					<td class="highlight-grey confluenceTd"
						data-highlight-colour="grey"><p align="center">
							<span style="color: rgb(0, 51, 102);">Property</span>
						</p></td>
					<td class="highlight-grey confluenceTd"
						data-highlight-colour="grey"><p align="center">
							<span style="color: rgb(0, 51, 102);">Description</span>
						</p></td>
					<td class="highlight-grey confluenceTd"
						data-highlight-colour="grey"><p style="text-align: center;">
							<span style="color: rgb(0, 51, 102);">Type</span>
						</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>companyId</p></td>
					<td class="confluenceTd"><p>Company Code</p></td>
					<td class="confluenceTd"><p>int</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>formId</p></td>
					<td class="confluenceTd"><p>Form Code</p></td>
					<td class="confluenceTd"><p>int</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>cardId</p></td>
					<td class="confluenceTd"><p>Form Record Code</p></td>
					<td class="confluenceTd"><p>int</p></td>
				</tr>
				<tr>
					<td colspan="1" class="confluenceTd">versionId</td>
					<td colspan="1" class="confluenceTd">Form Record Version</td>
					<td colspan="1" class="confluenceTd">int</td>
				</tr>
				<tr>
					<td colspan="1" class="confluenceTd">cardData</td>
					<td colspan="1" class="confluenceTd">Form Record Data</td>
					<td colspan="1" class="confluenceTd">Hashmap &lt;String,
						String></td>
				</tr>
			</tbody>
		</table>
	</div>
	<div class="code panel pdl" style="border-width: 1px;">
		<div class="codeHeader panelHeader pdl"
			style="border-bottom-width: 1px;">
			<b>Example</b>
		</div>
		<div class="codeContent panelContent pdl">
			<pre class="theme: Confluence; brush: java; gutter: false"
				style="font-size: 12px;">function afterSaveCard(companyId, formId, cardId, versionId, cardData){&#160;
	var custom = ServiceManager.getService("CustomCard");&#160;
	var serviceHelper = custom.getBean();&#160;
	var serviceLocator = serviceHelper.instantiate("com.totvs.technology.webdesk.forms.service.custom.CustomCardServiceLocator");&#160;
	var service = serviceLocator.getCustomCardPort();
&#160;
	var ar = new Array();&#160;
	var it = cardData.keySet().iterator();&#160;
	while (it.hasNext()) {&#160;
		var key = it.next();&#160;
		var field1 = serviceHelper.instantiate("com.totvs.technology.webdesk.forms.service.custom.CardKeyValue");&#160;
		
		field1.setKey(key);&#160;
			field1.setValue( cardData.get(key));&#160;
		log.info('>' + key + ': ' + cardData.get(key));&#160;
&#160;
		ar.push(field1);&#160;
	}&#160;
&#160;
	var resultArr = serviceHelper.instantiate("com.totvs.technology.webdesk.forms.service.custom.CardKeyValueArray");&#160;
	resultArr.setItem(ar);&#160;
	service.create(companyId, formId, cardId, versionId, resultArr);&#160;
}</pre>
		</div>
	</div>
	<p>&#160;</p>
	<h3 id="CustomizaçãodeEventos-AfterDeleteCard">AfterDeleteCard</h3>
	<p>Used as a supplement to the afterSaveCard event. It is called
		whenever a form or a form record is deleted from the bin.</p>
	<p>&#160;</p>
	<div class="code panel pdl" style="border-width: 1px;">
		<div class="codeHeader panelHeader pdl"
			style="border-bottom-width: 1px;">
			<b>Example</b>
		</div>
		<div class="codeContent panelContent pdl">
			<pre class="theme: Confluence; brush: java; gutter: false"
				style="font-size: 12px;">function afterSaveCard(companyId, formId, cardId, versionId, cardData){
}</pre>
		</div>
	</div>
	<p>&#160;</p>
	<p>With parameters:</p>
	<div class="table-wrap">
		<table class="confluenceTable">
			<tbody>
				<tr>
					<td class="highlight-grey confluenceTd"
						data-highlight-colour="grey"><p align="center">
							<span style="color: rgb(0, 51, 102);">Property</span>
						</p></td>
					<td class="highlight-grey confluenceTd"
						data-highlight-colour="grey"><p align="center">
							<span style="color: rgb(0, 51, 102);">Description</span>
						</p></td>
					<td class="highlight-grey confluenceTd"
						data-highlight-colour="grey"><p style="text-align: center;">
							<span style="color: rgb(0, 51, 102);">Type</span>
						</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>companyId</p></td>
					<td class="confluenceTd"><p>Company Code</p></td>
					<td class="confluenceTd"><p>int</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>cardId</p></td>
					<td class="confluenceTd"><p>Form Record Code</p></td>
					<td class="confluenceTd"><p>int</p></td>
				</tr>
			</tbody>
		</table>
	</div>
	<div class="code panel pdl" style="border-width: 1px;">
		<div class="codeHeader panelHeader pdl"
			style="border-bottom-width: 1px;">
			<b>Example</b>
		</div>
		<div class="codeContent panelContent pdl">
			<pre class="theme: Confluence; brush: java; gutter: false"
				style="font-size: 12px;">function afterDeleteCard(companyId,cardId){&#160;
	var custom = ServiceManager.getService("CustomCard");&#160;
	var serviceHelper = custom.getBean();
&#160;
	var serviceLocator = serviceHelper.instantiate("com.totvs.technology.webdesk.forms.service.custom.CustomCardServiceLocator");&#160;
&#160;
	var service = serviceLocator.getCustomCardPort();&#160;
&#160;
	log.info("########## loaded the CustomCard service");&#160;
	service.deleteCard(companyId, cardId);&#160;
}</pre>
		</div>
	</div>
	<p>&#160;</p>
	<h3 id="CustomizaçãodeEventos-BeforeWatchContent">BeforeWatchContent</h3>
	<p>Used when following some content from which record you wish to
		retrieve information and use it before the "follow" action. For
		example, to follow a document,you can retrieve its information and use
		it in a dataset.</p>
	<p>&#160;</p>
	<div class="code panel pdl" style="border-width: 1px;">
		<div class="codeHeader panelHeader pdl"
			style="border-bottom-width: 1px;">
			<b>Example</b>
		</div>
		<div class="codeContent panelContent pdl">
			<pre class="theme: Confluence; brush: java; gutter: false"
				style="font-size: 12px;">function beforeWatchContent(companyId, watchDTO){
}</pre>
		</div>
	</div>
	<p>&#160;</p>
	<p>With parameters:</p>
	<div class="table-wrap">
		<table class="confluenceTable">
			<tbody>
				<tr>
					<td class="highlight-grey confluenceTd"
						data-highlight-colour="grey"><p align="center">
							<span style="color: rgb(0, 51, 102);">Property</span>
						</p></td>
					<td class="highlight-grey confluenceTd"
						data-highlight-colour="grey"><p align="center">
							<span style="color: rgb(0, 51, 102);">Description</span>
						</p></td>
					<td class="highlight-grey confluenceTd"
						data-highlight-colour="grey"><p style="text-align: center;">
							<span style="color: rgb(0, 51, 102);">Type</span>
						</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>companyId</p></td>
					<td class="confluenceTd"><p>Company Code</p></td>
					<td class="confluenceTd"><p>int</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>watchDTO</p></td>
					<td class="confluenceTd"><p>Record data</p></td>
					<td class="confluenceTd"><p>WatchDTO</p></td>
				</tr>
			</tbody>
		</table>
	</div>
	<div class="code panel pdl" style="border-width: 1px;">
		<div class="codeHeader panelHeader pdl"
			style="border-bottom-width: 1px;">
			<b>Example</b>
		</div>
		<div class="codeContent panelContent pdl">
			<pre class="theme: Confluence; brush: java; gutter: false"
				style="font-size: 12px;">function beforeWatchContent(companyId, watchDTO){
	if(watchDTO.getSocialWatchType() == "DOCUMENT"){
		var objClass = "com.totvs.technology.social.document.6";
		var objClass = watchDTO.getObjectClass();
		var patt = new RegExp( /\d+/) ; 
		var documentId = patt.exec(objClass) ;
		var documentVersion = watchDTO.getObjectId();
		var doc = getValue("WKDocument"); 
		var company = companyId; 
		var ds ;
		try { 
			var c1 = DatasetFactory.createConstraint( "allocatedDocumentPK.companyId", company, company, ConstraintType.MUST); 
			var c2 = DatasetFactory.createConstraint("allocatedDocumentPK.sourceDocument",documentId,documentId, ConstraintType.MUST); 
			var c3 = DatasetFactory.createConstraint("allocatedDocumentPK.sourceVersion", documentVersion,documentVersion, ConstraintType.MUST); 
			var c4 = DatasetFactory.createConstraint("active", "true","true",ConstraintType.MUST); 
			var constraints = new Array(c1, c2, c3, c4); 
			
			ds = DatasetFactory.getDataset("allocatedDocument", null, constraints, null); 
		}catch (e) {
			log.error("Error trying to recover the document in CheckOut: " + e.message); 
		} 
	 
		if(ds!=null &amp;&amp; ds.rowsCount>0){ 
		 throw  "Your notification request was rejected because the document is in checkout." ; 
		}
	}
}</pre>
		</div>
	</div>
	<p>&#160;</p>
	<h3 id="CustomizaçãodeEventos-AfterWatchContent">AfterWatchContent</h3>
	<p>Used when following some content from which record you wish to
		retrieve information and use it after the "follow" action. For
		example, when following a post, it is possible to retrieve its
		information and use it to inform the user about the post author.</p>
	<p>&#160;</p>
	<div class="code panel pdl" style="border-width: 1px;">
		<div class="codeHeader panelHeader pdl"
			style="border-bottom-width: 1px;">
			<b>Example</b>
		</div>
		<div class="codeContent panelContent pdl">
			<pre class="theme: Confluence; brush: java; gutter: false"
				style="font-size: 12px;">function afterWatchContent(companyId, watchDTO){	
}</pre>
		</div>
	</div>
	<p>&#160;</p>
	<p>With parameters:</p>
	<div class="table-wrap">
		<table class="confluenceTable">
			<tbody>
				<tr>
					<td class="highlight-grey confluenceTd"
						data-highlight-colour="grey"><p align="center">
							<span style="color: rgb(0, 51, 102);">Property</span>
						</p></td>
					<td class="highlight-grey confluenceTd"
						data-highlight-colour="grey"><p align="center">
							<span style="color: rgb(0, 51, 102);">Description</span>
						</p></td>
					<td class="highlight-grey confluenceTd"
						data-highlight-colour="grey"><p style="text-align: center;">
							<span style="color: rgb(0, 51, 102);">Type</span>
						</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>companyId</p></td>
					<td class="confluenceTd"><p>Company Code</p></td>
					<td class="confluenceTd"><p>int</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>watchDTO</p></td>
					<td class="confluenceTd"><p>Record data</p></td>
					<td class="confluenceTd"><p>WatchDTO</p></td>
				</tr>
			</tbody>
		</table>
	</div>
	<div class="code panel pdl" style="border-width: 1px;">
		<div class="codeHeader panelHeader pdl"
			style="border-bottom-width: 1px;">
			<b>Example</b>
		</div>
		<div class="codeContent panelContent pdl">
			<pre class="theme: Confluence; brush: java; gutter: false"
				style="font-size: 12px;">function afterWatchContent(companyId, watchDTO){
	if(watchDTO.getSocialWatchType() == "POST"){
		throw "The user "+watchDTO.getUserAlias()+" will be notified about the post " + watchDTO.getText() + " of author " + watchDTO.getPostAuthor() ;
	}
}</pre>
		</div>
	</div>
	<p>&#160;</p>
	<h3 id="CustomizaçãodeEventos-BeforeUnwatchContent">BeforeUnwatchContent</h3>
	<p>Used when you stop following some content from which record you
		wish to retrieve information and use it before the "stop following"
		action. For example, when trying to stop following a community, you
		can decide if the user can stop following it.</p>
	<p>&#160;</p>
	<div class="code panel pdl" style="border-width: 1px;">
		<div class="codeHeader panelHeader pdl"
			style="border-bottom-width: 1px;">
			<b>Example</b>
		</div>
		<div class="codeContent panelContent pdl">
			<pre class="theme: Confluence; brush: java; gutter: false"
				style="font-size: 12px;">function beforeUnwatchContent(companyId, watchDTO){
}</pre>
		</div>
	</div>
	<p>&#160;</p>
	<p>With parameters:</p>
	<div class="table-wrap">
		<table class="confluenceTable">
			<tbody>
				<tr>
					<td class="highlight-grey confluenceTd"
						data-highlight-colour="grey"><p align="center">
							<span style="color: rgb(0, 51, 102);">Property</span>
						</p></td>
					<td class="highlight-grey confluenceTd"
						data-highlight-colour="grey"><p align="center">
							<span style="color: rgb(0, 51, 102);">Description</span>
						</p></td>
					<td class="highlight-grey confluenceTd"
						data-highlight-colour="grey"><p style="text-align: center;">
							<span style="color: rgb(0, 51, 102);">Type</span>
						</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>companyId</p></td>
					<td class="confluenceTd"><p>Company Code</p></td>
					<td class="confluenceTd"><p>int</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>watchDTO</p></td>
					<td class="confluenceTd"><p>Record data</p></td>
					<td class="confluenceTd"><p>WatchDTO</p></td>
				</tr>
			</tbody>
		</table>
	</div>
	<div class="code panel pdl" style="border-width: 1px;">
		<div class="codeHeader panelHeader pdl"
			style="border-bottom-width: 1px;">
			<b>Example</b>
		</div>
		<div class="codeContent panelContent pdl">
			<pre class="theme: Confluence; brush: java; gutter: false"
				style="font-size: 12px;">function beforeUnwatchContent(companyId, watchDTO){
	if(watchDTO.getSocialWatchType() == "COMMUNITY"){
		
		throw "You cannot stop being notified about the community " + watchDTO.getDescription() ;
	}
}</pre>
		</div>
	</div>
	<p>&#160;</p>
	<h3 id="CustomizaçãodeEventos-AfterUnwatchContent">AfterUnwatchContent</h3>
	<p>Used when you stop following some content from which record you
		wish to retrieve information and use it after the "stop following"
		action. For example, to stop following a post, you can retrieve its
		information and inform the user that this post has many followers.</p>
	<p>&#160;</p>
	<div class="code panel pdl" style="border-width: 1px;">
		<div class="codeHeader panelHeader pdl"
			style="border-bottom-width: 1px;">
			<b>Example</b>
		</div>
		<div class="codeContent panelContent pdl">
			<pre class="theme: Confluence; brush: java; gutter: false"
				style="font-size: 12px;">function afterUnwatchContent(companyId, watchDTO){
}</pre>
		</div>
	</div>
	<p>&#160;</p>
	<p>With parameters:</p>
	<div class="table-wrap">
		<table class="confluenceTable">
			<tbody>
				<tr>
					<td class="highlight-grey confluenceTd"
						data-highlight-colour="grey"><p align="center">
							<span style="color: rgb(0, 51, 102);">Property</span>
						</p></td>
					<td class="highlight-grey confluenceTd"
						data-highlight-colour="grey"><p align="center">
							<span style="color: rgb(0, 51, 102);">Description</span>
						</p></td>
					<td class="highlight-grey confluenceTd"
						data-highlight-colour="grey"><p style="text-align: center;">
							<span style="color: rgb(0, 51, 102);">Type</span>
						</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>companyId</p></td>
					<td class="confluenceTd"><p>Company Code</p></td>
					<td class="confluenceTd"><p>int</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>watchDTO</p></td>
					<td class="confluenceTd"><p>Record data</p></td>
					<td class="confluenceTd"><p>WatchDTO</p></td>
				</tr>
			</tbody>
		</table>
	</div>
	<div class="code panel pdl" style="border-width: 1px;">
		<div class="codeHeader panelHeader pdl"
			style="border-bottom-width: 1px;">
			<b>Example</b>
		</div>
		<div class="codeContent panelContent pdl">
			<pre class="theme: Confluence; brush: java; gutter: false"
				style="font-size: 12px;">function afterUnwatchContent(companyId, watchDTO){
	if(watchDTO.getSocialWatchType() == "POST" &amp;&amp; watchDTO.getNumberWatchers() &lt; 3 ){
		log.erro("The post   \"" + watchDTO.getText() + "\" of author " + watchDTO.getPostAuthor() + " is no longer polemic" )
	}
}</pre>
		</div>
	</div>
	<p>&#160;</p>
	<h3 id="CustomizaçãodeEventos-OnNotify">OnNotify</h3>
	<p>
		To interfere with sending a Fluig default email, the <em>onNotify</em>
		global event should be used, which is triggered when any of the Fluig
		emails are sent. In this event, changes can be made, such as adding
		other email recipients, modifying the values of parameters used in the
		email template, etc.
	</p>
	<p>Following is an example of how to implement this event:</p>
	<div class="code panel pdl" style="border-width: 1px;">
		<div class="codeContent panelContent pdl">
			<pre class="theme: Eclipse; brush: javascript; gutter: true"
				style="font-size: 12px;">function onNotify(subject, receivers, template, params) {
    if (template.match("TPLDOCUMENT_APPROVAL_PENDING") != null) {
        receivers.add("[email protected]");
    }
}</pre>
		</div>
	</div>
	<div class="aui-message warning shadowed information-macro">
		<p class="title">Attention</p>
		<span class="aui-icon icon-warning">Icon</span>
		<div class="message-content">
			<p>
				Starting with Fluig version 1.3.3, it is recommended to validate the
				template using <strong>template ==
					"TPLDOCUMENT_APPROVAL_PENDING</strong><strong>"&#160;</strong>instead of the
				match() function, thus avoiding redundancies in customization, since
				match() can return as valid for more than one template in cases like
				TPLNEW_TASK and TPLNEW_TASK_POOL_GROUP.
			</p>
		</div>
	</div>
	<p>&#160;</p>
	<p>&#160;</p>
	<div class="syntaxhighlighter  javascript">
		<p>The onNotify event is available in the global event list. When
			you select this event in the list of available events, the above
			function signature will already be populated automatically.&#160;This
			event provides the following parameters:</p>
	</div>
	<div class="table-wrap">
		<table class="confluenceTable">
			<tbody>
				<tr>
					<th style="text-align: center;" class="confluenceTh"><span
						style="color: rgb(0, 51, 102);">Parameter</span></th>
					<th style="text-align: center;" class="confluenceTh"><span
						style="color: rgb(0, 51, 102);">Description</span></th>
				</tr>
				<tr>
					<td class="confluenceTd">subject</td>
					<td class="confluenceTd">Is the email subject. Changing this
						variable will result in all users receiving the email with the new
						subject configured. Example of use: <strong>subject.add("SUBJECT");</strong>
					</td>
				</tr>
				<tr>
					<td class="confluenceTd">receivers</td>
					<td class="confluenceTd">List of email recipients. You can
						also add other emails from users who are not part of the process.
						You can also add emails from users who are not registered in
						Fluig, if you need to notify a person that does not have access to
						the system.</td>
				</tr>
				<tr>
					<td class="confluenceTd">template</td>
					<td class="confluenceTd">Allows you to validate the type of
						email that is being sent (for example, template of a document
						under approval, expiring document, and so on). Based on this
						variable, we can distinguish which emails we want to customize. It
						is recommended to always check the template code in order to avoid
						changes in other types of email that do not need customization.</td>
				</tr>
				<tr>
					<td class="confluenceTd">params</td>
					<td class="confluenceTd">It is a data map that allows
						changing/adding parameters to be provided in the email. The name
						of the parameters provided in this map must be the same as those
						used within the template file.</td>
				</tr>
			</tbody>
		</table>
	</div>
	<p>&#160;</p>
	<p>In the example presented above, it is being validated if the
		template is the "TPLDOCUMENT_APPROVAL_PENDING" (which corresponds to
		the document pending approval). If so, a new email will be added to
		the list of recipients. That is, besides the person responsible for
		the approval, another person will be notified, receiving a copy of the
		email. Since the template code is being validated, the other email
		types will not be affected.</p>
	<p>The templates can be queried within the volume directory, in:
		&lt;VOLUME>\templates\tplmail. If you need to add some parameter to
		the default email, the templates can be edited directly in this
		directory.</p>
	<div>
		<p>&#160;</p>
		<p>&#160;</p>
		<div class="aui-message warning shadowed information-macro">
			<p class="title">Important</p>
			<span class="aui-icon icon-warning">Icon</span>
			<div class="message-content">
				<ul class="alternate">
					<li>The global event onNotify has variable bind to access log,
						datasetManager, DatasetFactory, DatasetBuilder, ConstraintType and
						ServiceManager.</li>
					<li>It is recommended to check the list of parameters (params)
						received before using them, as they vary according to the template
						used.</li>
					<li>When a workflow has onNotify event, the global onNotify
						event is ignored for those process emails.</li>
					<li>It is essential to validate through the code of the
						template before any implementation, because ALL emails will go
						through this customization when the event is logged.</li>
				</ul>
			</div>
		</div>
		<p>&#160;</p>
	</div>
	<h3 id="CustomizaçãodeEventos-Objetosutilizadosnoseventos">Objects
		used in events</h3>
	<p>There are some objects provided by the product that are used in
		events. In the next sessions they will be explained, as well as their
		methods and their returns.</p>
	<p>&#160;</p>
	<h5 id="CustomizaçãodeEventos-DocumentDto">DocumentDto</h5>
	<p>This object represents the document and its properties. There is
		more information about it in the table below:</p>
	<p>&#160;</p>
	<div class="table-wrap">
		<table class="confluenceTable">
			<tbody>
				<tr>
					<td class="highlight-grey confluenceTd"
						data-highlight-colour="grey"><p align="center">
							<span style="color: rgb(0, 51, 102);">Function</span>
						</p></td>
					<td class="highlight-grey confluenceTd"
						data-highlight-colour="grey"><p align="center">
							<span style="color: rgb(0, 51, 102);">Function Description</span>
						</p></td>
					<td class="highlight-grey confluenceTd"
						data-highlight-colour="grey"><p align="center">
							<span style="color: rgb(0, 51, 102);">Return Type</span>
						</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>getDocumentId()</p></td>
					<td class="confluenceTd"><p>Returns the document number.</p></td>
					<td class="confluenceTd"><p align="center">int</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>getVersion()</p></td>
					<td class="confluenceTd"><p>Returns the document version
							number.</p></td>
					<td class="confluenceTd"><p align="center">int</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>getCompanyId()</p></td>
					<td class="confluenceTd"><p>Returns the code of the
							company in which the document was published.</p></td>
					<td class="confluenceTd"><p align="center">Int</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>getUUID()</p></td>
					<td class="confluenceTd"><p>Returns the UUID (Universal
							Unique Identifier) of the document.</p></td>
					<td class="confluenceTd"><p align="center">String</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>getDocumentTypeId()</p></td>
					<td class="confluenceTd"><p>Returns the type of the
							physical file, if it returns blank or null, it is because this
							type is not known to Fluig.</p></td>
					<td class="confluenceTd"><p align="center">String</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>getLanguageId()</p></td>
					<td class="confluenceTd"><p>Returns the language code of
							the document.</p></td>
					<td class="confluenceTd"><p align="center">String</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>getIconId()</p></td>
					<td class="confluenceTd"><p>Returns the icon code of the
							document.</p></td>
					<td class="confluenceTd"><p align="center">int</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>getTopicId()</p></td>
					<td class="confluenceTd"><p>Returns the subject code of
							the document.</p></td>
					<td class="confluenceTd"><p align="center">int</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>getColleagueId()</p></td>
					<td class="confluenceTd"><p>Returns the registration of
							the user who created the document.</p></td>
					<td class="confluenceTd"><p align="center">String</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>getDocumentDescription()</p></td>
					<td class="confluenceTd"><p>Returns the document
							description.</p></td>
					<td class="confluenceTd"><p align="center">String</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>getAdditionalComments()</p></td>
					<td class="confluenceTd"><p>Returns the additional
							comments of the document.</p></td>
					<td class="confluenceTd"><p align="center">String</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>getPhisicalFile()</p></td>
					<td class="confluenceTd"><p>Returns the physical path
							where the document is stored.</p></td>
					<td class="confluenceTd"><p align="center">String</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>getCreateDate()</p></td>
					<td class="confluenceTd"><p>Returns the creation date.</p></td>
					<td class="confluenceTd"><p align="center">java.util.Date</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>getApprovedDate()</p></td>
					<td class="confluenceTd"><p>Returns the Approval date.</p></td>
					<td class="confluenceTd"><p align="center">java.util.Date</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>getLastModifiedDate()</p></td>
					<td class="confluenceTd"><p>Returns the Date of the last
							modification.</p></td>
					<td class="confluenceTd"><p align="center">java.util.Date</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>getDocumentType()</p></td>
					<td class="confluenceTd"><p>Returns the type of document,
							where:</p>
						<p>0 to Root folder</p>
						<p>1 to Folder</p>
						<p>2 is Normal document</p>
						<p>3 is External document</p>
						<p>4 to Card index</p>
						<p>5 to Card</p>
						<p>7 to Workflow Attachment</p>
						<p>8 to New Content</p>
						<p>9 to Application</p>
						<p>10 to Report</p>
						<p>portal to Site</p>
						<p>portalPage to Site Page</p></td>
					<td class="confluenceTd"><p align="center">String</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>getExpirationDate()</p></td>
					<td class="confluenceTd"><p>Returns the expiration date.</p></td>
					<td class="confluenceTd"><p align="center">java.util.Date</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>getParentDocumentId()</p></td>
					<td class="confluenceTd"><p>Returns the number of the
							parent Folder/Card Index</p></td>
					<td class="confluenceTd"><p align="center">int</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>getRelatedFiles()</p></td>
					<td class="confluenceTd"><p>String with the name of the
							main physical file and attachments.</p></td>
					<td class="confluenceTd"><p align="center">String</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>getActiveVersion()</p></td>
					<td class="confluenceTd"><p>Returns if the version is
							active.</p></td>
					<td class="confluenceTd"><p align="center">boolean</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>getVersionDescription()</p></td>
					<td class="confluenceTd"><p>Returns the version
							description.</p></td>
					<td class="confluenceTd"><p align="center">String</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>getDownloadEnabled()</p></td>
					<td class="confluenceTd"><p>Returns if the document allows
							Download</p></td>
					<td class="confluenceTd"><p align="center">boolean</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>getApproved()</p></td>
					<td class="confluenceTd"><p>Returns if the document is
							under approval.</p></td>
					<td class="confluenceTd"><p align="center">boolean</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>getValidationStartDate()</p></td>
					<td class="confluenceTd"><p>Returns data from which the
							document can be viewed.</p></td>
					<td class="confluenceTd"><p align="center">java.util.Date</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>getPublisherId()</p></td>
					<td class="confluenceTd"><p>Returns the registration of
							the user who published the document.</p></td>
					<td class="confluenceTd"><p align="center">String</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>getCardDescription()</p></td>
					<td class="confluenceTd"><p>Returns the description of the
							card for document of type 5.</p></td>
					<td class="confluenceTd"><p align="center">String</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>getDocumentPropertyNumber()</p></td>
					<td class="confluenceTd"><p>Returns the card index that
							was used as the basis for creating the card, so it only has a
							value when the document is of type 5 (card).</p></td>
					<td class="confluenceTd"><p align="center">int</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>getDocumentPropertyVersion()</p></td>
					<td class="confluenceTd"><p>Returns the version of the
							card index in which the card was created.</p></td>
					<td class="confluenceTd"><p align="center">int</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>getPrivateDocument()</p></td>
					<td class="confluenceTd"><p>Returns if the document/folder
							is under the private folder.</p></td>
					<td class="confluenceTd"><p align="center">boolean</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>getPrivateColleagueId()</p></td>
					<td class="confluenceTd"><p>If it is a private document,
							returns the user registration where this document is allocated.</p></td>
					<td class="confluenceTd"><p align="center">String</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>getIndexed()</p></td>
					<td class="confluenceTd"><p>Returns if the document has
							already been indexed.</p></td>
					<td class="confluenceTd"><p align="center">boolean</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>getPriority()</p></td>
					<td class="confluenceTd"><p>Returns the priority of the
							document.</p></td>
					<td class="confluenceTd"><p align="center">int</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>getUserNotify()</p></td>
					<td class="confluenceTd"><p>Returns if it notifies users
							who have this subject of interest.</p></td>
					<td class="confluenceTd"><p align="center">boolean</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>getExpires()</p></td>
					<td class="confluenceTd"><p>Returns if the document has
							expired.</p></td>
					<td class="confluenceTd"><p align="center">boolean</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>getVolumeId()</p></td>
					<td class="confluenceTd"><p>Returns the volume where the
							document has been posted, if blank it uses the parent volume.</p></td>
					<td class="confluenceTd"><p align="center">String</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>getInheritSecurity()</p></td>
					<td class="confluenceTd"><p>Returns if it inherits
							security from parent.</p></td>
					<td class="confluenceTd"><p align="center">boolean</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>getUpdateIsoProperties()</p></td>
					<td class="confluenceTd"><p>Returns if it updates the
							properties of the controlled copy.</p></td>
					<td class="confluenceTd"><p align="center">boolean</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>getLastModifiedTime()</p></td>
					<td class="confluenceTd"><p>Returns the time of the last
							modification in milliseconds.</p></td>
					<td class="confluenceTd"><p align="center">String</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>getDeleted()</p></td>
					<td class="confluenceTd"><p>Returns if the document is in
							the bin.</p></td>
					<td class="confluenceTd"><p align="center">boolean</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>getDatasetName()</p></td>
					<td class="confluenceTd"><p>Returns the dataset document,
							if the document is a card index.</p></td>
					<td class="confluenceTd"><p align="center">String</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>getKeyWord()</p></td>
					<td class="confluenceTd"><p>Returns the keywords of the
							document. Each word is separated by a comma.</p></td>
					<td class="confluenceTd"><p align="center">String</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>getImutable()</p></td>
					<td class="confluenceTd"><p>Returns if the version/review
							is unmodifiable.</p></td>
					<td class="confluenceTd"><p align="center">boolean</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>getDraft()</p></td>
					<td class="confluenceTd"><p>Returns if the document is
							being edited, for document of "new Content" type.</p></td>
					<td class="confluenceTd"><p align="center">boolean</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>getInternalVisualizer()</p></td>
					<td class="confluenceTd"><p>Returns if it uses internal
							viewer.</p></td>
					<td class="confluenceTd"><p align="center">boolean</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>getPhysicalFileSize()</p></td>
					<td class="confluenceTd"><p>Returns the physical size of
							the main document and attachments.</p></td>
					<td class="confluenceTd"><p align="center">float</p></td>
				</tr>
			</tbody>
		</table>
	</div>
	<div class="code panel pdl" style="border-width: 1px;">
		<div class="codeHeader panelHeader pdl"
			style="border-bottom-width: 1px;">
			<b>Example</b>
		</div>
		<div class="codeContent panelContent pdl">
			<pre class="theme: Confluence; brush: java; gutter: false"
				style="font-size: 12px;">var doc = getValue("WKDocument");
log.info("Document number: "+ doc.getDocumentId() + " - Version: "+ doc.getVersion());</pre>
		</div>
	</div>
	<p>&#160;</p>
	<h5 id="CustomizaçãodeEventos-ApproverDto">ApproverDto</h5>
	<p>This object represents the approvers and their properties. There
		is more information about it in the table below:</p>
	<p>&#160;</p>
	<div class="table-wrap">
		<table class="confluenceTable">
			<tbody>
				<tr>
					<td class="highlight-grey confluenceTd"
						data-highlight-colour="grey"><p align="center">
							<strong>Function</strong>
						</p></td>
					<td class="highlight-grey confluenceTd"
						data-highlight-colour="grey"><p align="center">
							<strong>Function Description</strong>
						</p></td>
					<td class="highlight-grey confluenceTd"
						data-highlight-colour="grey"><p align="center">
							<strong>Return Type</strong>
						</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>getDocumentId()</p></td>
					<td class="confluenceTd"><p>Returns the document number.</p></td>
					<td class="confluenceTd"><p align="center">int</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>getVersion()</p></td>
					<td class="confluenceTd"><p>Returns the document version
							number.</p></td>
					<td class="confluenceTd"><p align="center">int</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>getCompanyId()</p></td>
					<td class="confluenceTd"><p>Returns the code of the
							company in which the document was published.</p></td>
					<td class="confluenceTd"><p align="center">Int</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>getColleagueId()</p></td>
					<td class="confluenceTd"><p>Returns the user registration
							or the group code that is approving this document. It is possible
							to know if it will return a user or a group by type of approval.</p></td>
					<td class="confluenceTd"><p align="center">String</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>getApproverType()</p></td>
					<td class="confluenceTd"><p>Returns the type of approval,
							where:</p>
						<p>0 for User</p>
						<p>1 to Group</p></td>
					<td class="confluenceTd"><p align="center">int</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>getLevelId()</p></td>
					<td class="confluenceTd"><p>Returns the level of approval,
							in the case of approval levels.</p></td>
					<td class="confluenceTd"><p align="center">int</p></td>
				</tr>
			</tbody>
		</table>
	</div>
	<div class="code panel pdl" style="border-width: 1px;">
		<div class="codeHeader panelHeader pdl"
			style="border-bottom-width: 1px;">
			<b>Example</b>
		</div>
		<div class="codeContent panelContent pdl">
			<pre class="theme: Confluence; brush: java; gutter: false"
				style="font-size: 12px;">var listApprover = getValue("WKListApprover");
	if(listApprover!=null){
    	for(j = 0; j &lt; listApprover.size(); j++) {           
       	 if (listApprover.get(j).getColleagueId().equals("adm")){
            throw "The adm user cannot be the document approver";
        }
    }
}</pre>
		</div>
	</div>
	<p>
		<span style="color: rgb(0, 0, 0);">&#160; &#160; &#160;
			&#160;&#160;</span>
	</p>
	<h5 id="CustomizaçãodeEventos-DocumentSecurityConfigDto">DocumentSecurityConfigDto</h5>
	<p>This object represents the security of a document and its
		properties, in the table below there is more information about it:</p>
	<p>
		<strong>&#160;</strong><span>&#160;</span>
	</p>
	<div class="table-wrap">
		<table class="confluenceTable">
			<tbody>
				<tr>
					<td class="highlight-grey confluenceTd"
						data-highlight-colour="grey"><p align="center">
							<span style="color: rgb(0, 51, 102);">Function</span>
						</p></td>
					<td class="highlight-grey confluenceTd"
						data-highlight-colour="grey"><p align="center">
							<span style="color: rgb(0, 51, 102);">Function Description</span>
						</p></td>
					<td class="highlight-grey confluenceTd"
						data-highlight-colour="grey"><p align="center">
							<span style="color: rgb(0, 51, 102);">Return Type</span>
						</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>getDocumentId()</p></td>
					<td class="confluenceTd"><p>Returns the document number.</p></td>
					<td class="confluenceTd"><p align="center">int</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>getVersion()</p></td>
					<td class="confluenceTd"><p>Returns the document version
							number.</p></td>
					<td class="confluenceTd"><p align="center">int</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>getCompanyId()</p></td>
					<td class="confluenceTd"><p>Returns the code of the
							company in which the document was published.</p></td>
					<td class="confluenceTd"><p align="center">Int</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>getAttributionValue()</p></td>
					<td class="confluenceTd"><p>Returns the registration of a
							user or the code of the group that is in the security of this
							document. It is possible to know if it will return a user or a
							group by type of security.</p>
						<p>Note: Returns blank when the type is all users.</p></td>
					<td class="confluenceTd"><p align="center">String</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>getAttributionType()</p></td>
					<td class="confluenceTd"><p>Returns the type of security,
							where:</p>
						<p>1 for User;</p>
						<p>2 to Group;</p>
						<p>3 to All Users.</p></td>
					<td class="confluenceTd"><p align="center">int</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>getPermission()</p></td>
					<td class="confluenceTd"><p>Returns if it is a permission.</p>
						<p>Note: If it is not a permission, it is a constraint.</p></td>
					<td class="confluenceTd"><p align="center">boolean</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>getShowContent()</p></td>
					<td class="confluenceTd"><p>Returns if it lists the
							content.</p></td>
					<td class="confluenceTd"><p align="center">boolean</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>getSecurityLevel()</p></td>
					<td class="confluenceTd"><p>Returns in the
							permission/restriction level, where:</p>
						<p>-1 to no permission/restriction (denies access);</p>
						<p>0 to Reading;</p>
						<p>1 to Writing;</p>
						<p>2 to Modification;</p>
						<p>3 to Total.</p></td>
					<td class="confluenceTd"><p align="center">int</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>getSequence()</p></td>
					<td class="confluenceTd"><p>Returns the
							permission/restriction string.</p></td>
					<td class="confluenceTd"><p align="center">int</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>getSecurityVersion()</p></td>
					<td class="confluenceTd"><p>Returns if it uses this
							version security in the other ones.</p></td>
					<td class="confluenceTd"><p align="center">boolean</p></td>
				</tr>
			</tbody>
		</table>
	</div>
	<div class="code panel pdl" style="border-width: 1px;">
		<div class="codeHeader panelHeader pdl"
			style="border-bottom-width: 1px;">
			<b>Example</b>
		</div>
		<div class="codeContent panelContent pdl">
			<pre class="theme: Confluence; brush: java; gutter: false"
				style="font-size: 12px;">var listSeg = getValue("WKListSecurity");
if(listSeg != null){
    for(j = 0; j &lt; listSeg.size(); j++) {     
        if (listSeg.get(j).getAttributionValue().equals("cvd")){
            throw "The cvd user cannot be in document security";
        }
    }
}</pre>
		</div>
	</div>
	<p>
		<strong>&#160;</strong>
	</p>
	<h5 id="CustomizaçãodeEventos-RelatedDocumentDto">RelatedDocumentDto</h5>
	<p>This object represents the related document and its properties.
		There is more information about it in the table below:</p>
	<p>&#160;</p>
	<div class="table-wrap">
		<table class="confluenceTable">
			<tbody>
				<tr>
					<td class="highlight-grey confluenceTd"
						data-highlight-colour="grey"><p align="center">
							<span style="color: rgb(0, 51, 102);">Function</span>
						</p></td>
					<td class="highlight-grey confluenceTd"
						data-highlight-colour="grey"><p align="center">
							<span style="color: rgb(0, 51, 102);">Function Description</span>
						</p></td>
					<td class="highlight-grey confluenceTd"
						data-highlight-colour="grey"><p align="center">
							<span style="color: rgb(0, 51, 102);">Return Type</span>
						</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>getDocumentId()</p></td>
					<td class="confluenceTd"><p>Returns the document number.</p></td>
					<td class="confluenceTd"><p align="center">int</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>getVersion()</p></td>
					<td class="confluenceTd"><p>Returns the document version
							number.</p></td>
					<td class="confluenceTd"><p align="center">int</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>getCompanyId()</p></td>
					<td class="confluenceTd"><p>Returns the code of the
							company in which the document was published.</p></td>
					<td class="confluenceTd"><p align="center">int</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>getRelatedDocumentId()</p></td>
					<td class="confluenceTd"><p>Returns the number of the
							document that is related to the posted document.</p></td>
					<td class="confluenceTd"><p align="center">int</p></td>
				</tr>
			</tbody>
		</table>
	</div>
	<div class="code panel pdl" style="border-width: 1px;">
		<div class="codeHeader panelHeader pdl"
			style="border-bottom-width: 1px;">
			<b>Example</b>
		</div>
		<div class="codeContent panelContent pdl">
			<pre class="theme: Confluence; brush: java; gutter: false"
				style="font-size: 12px;">var listRelated = getValue("WKListRelatedDocument");
	if( listRelated != null){
   	 log.info("The following documents are related to these documents: ");
     for(j = 0; j &lt; listRelated.size(); j++) {          
        log.info("Document no.: "+ listRelated.get(j).getRelatedDocumentId());
     }
}</pre>
		</div>
	</div>
	<p>
		<strong>&#160;</strong>
	</p>
	<h5 id="CustomizaçãodeEventos-WatchDTO">WatchDTO</h5>
	<p>This object represents the notifications of following comments
		and its properties. There is more information about it in the table
		below:</p>
	<p>&#160;</p>
	<div class="table-wrap">
		<table class="confluenceTable">
			<tbody>
				<tr>
					<td class="highlight-grey confluenceTd"
						data-highlight-colour="grey"><p align="center">
							<span style="color: rgb(0, 51, 102);">Function</span>
						</p></td>
					<td class="highlight-grey confluenceTd"
						data-highlight-colour="grey"><p align="center">
							<span style="color: rgb(0, 51, 102);">Function Description</span>
						</p></td>
					<td class="highlight-grey confluenceTd"
						data-highlight-colour="grey"><p align="center">
							<span style="color: rgb(0, 51, 102);">Return Type</span>
						</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>getEntityId()</p></td>
					<td class="confluenceTd"><p>Returns the code of the
							Content.</p></td>
					<td class="confluenceTd"><p align="center">String</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>getUserId()</p></td>
					<td class="confluenceTd"><p>Returns the user code.</p></td>
					<td class="confluenceTd"><p align="center">String</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>getUserAlias()</p></td>
					<td class="confluenceTd"><p>Returns the user alias.</p></td>
					<td class="confluenceTd"><p align="center">String</p></td>
				</tr>
				<tr>
					<td colspan="1" class="confluenceTd">getSociableId()</td>
					<td colspan="1" class="confluenceTd">Returns the sociable
						code.</td>
					<td colspan="1" style="text-align: center;" class="confluenceTd">String</td>
				</tr>
				<tr>
					<td colspan="1" class="confluenceTd">getCreationDate()</td>
					<td colspan="1" class="confluenceTd">Returns the creation
						date.</td>
					<td colspan="1" style="text-align: center;" class="confluenceTd">String</td>
				</tr>
				<tr>
					<td colspan="1" class="confluenceTd">getLastUpdateDate()</td>
					<td colspan="1" class="confluenceTd">Returns the date of the
						last update.</td>
					<td colspan="1" style="text-align: center;" class="confluenceTd">String</td>
				</tr>
				<tr>
					<td colspan="1" class="confluenceTd">getNumberComments()</td>
					<td colspan="1" class="confluenceTd">Returns the number of
						comments.</td>
					<td colspan="1" style="text-align: center;" class="confluenceTd">String</td>
				</tr>
				<tr>
					<td colspan="1" class="confluenceTd">getNumberLikes()</td>
					<td colspan="1" class="confluenceTd">Returns the number of
						supports.</td>
					<td colspan="1" style="text-align: center;" class="confluenceTd">String</td>
				</tr>
				<tr>
					<td colspan="1" class="confluenceTd">getNumberShares()</td>
					<td colspan="1" class="confluenceTd">Returns the number of
						shares.</td>
					<td colspan="1" style="text-align: center;" class="confluenceTd">String</td>
				</tr>
				<tr>
					<td colspan="1" class="confluenceTd">getNumberWatchers()</td>
					<td colspan="1" class="confluenceTd">Returns the number of
						follows.</td>
					<td colspan="1" style="text-align: center;" class="confluenceTd">String</td>
				</tr>
				<tr>
					<td colspan="1" class="confluenceTd">getNumberDenouncements()</td>
					<td colspan="1" class="confluenceTd">Returns the number of
						reports.</td>
					<td colspan="1" style="text-align: center;" class="confluenceTd">String</td>
				</tr>
				<tr>
					<td colspan="1" class="confluenceTd">getSocialWatchType()</td>
					<td colspan="1" class="confluenceTd">Returns the type (social)</td>
					<td colspan="1" style="text-align: center;" class="confluenceTd">String</td>
				</tr>
				<tr>
					<td colspan="1" class="confluenceTd">getPostAuthor()</td>
					<td colspan="1" class="confluenceTd">Returns the content
						author.</td>
					<td colspan="1" style="text-align: center;" class="confluenceTd">String</td>
				</tr>
				<tr>
					<td colspan="1" class="confluenceTd">getTags()</td>
					<td colspan="1" class="confluenceTd">Returns the tags.</td>
					<td colspan="1" style="text-align: center;" class="confluenceTd">String</td>
				</tr>
				<tr>
					<td colspan="1" class="confluenceTd">getText()</td>
					<td colspan="1" class="confluenceTd">Returns the text.</td>
					<td colspan="1" style="text-align: center;" class="confluenceTd">String</td>
				</tr>
				<tr>
					<td colspan="1" class="confluenceTd">getDescription()</td>
					<td colspan="1" class="confluenceTd">Returns the description.</td>
					<td colspan="1" style="text-align: center;" class="confluenceTd">String</td>
				</tr>
				<tr>
					<td colspan="1" class="confluenceTd">getObjectClass()</td>
					<td colspan="1" class="confluenceTd">Returns the class of the
						object.</td>
					<td colspan="1" style="text-align: center;" class="confluenceTd">String</td>
				</tr>
				<tr>
					<td colspan="1" class="confluenceTd">getObjectId()</td>
					<td colspan="1" class="confluenceTd">Returns the objectId.</td>
					<td colspan="1" style="text-align: center;" class="confluenceTd">String</td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>getThumbURL()</p></td>
					<td class="confluenceTd"><p>Returns the thumb url.</p></td>
					<td class="confluenceTd"><p align="center">String</p></td>
				</tr>
			</tbody>
		</table>
	</div>
	<p>
		<strong><br /></strong>
	</p>
	<div>
		<h1 id="CustomizaçãodeEventos-CustomizaçãodeEventosJMS">Customization
			of JMS Events</h1>
	</div>
	<p>Fluig has JMS event customization, allowing you to create audit
		procedures on the basis of information provided by the product. JMS
		(Java Message Service) is a Java™ API that provides an asynchronous
		connection between applications through messaging.</p>
	<p>
		The product triggers two types of customizable JMS messages,&#160;<strong>wdkDocument</strong>&#160;
		and &#160;<strong>wdkAbstract</strong>.
	</p>
	<p>
		The &#160;<strong>wdkDocument</strong>&#160; will be triggered when
		Fluig documents are handled, for the application to receive the
		message with the information from the document, the class has to
		extend the MessageListener and have the following line:
	</p>
	<div class="code panel pdl" style="border-width: 1px;">
		<div class="codeContent panelContent pdl">
			<pre class="theme: Confluence; brush: java; gutter: false"
				style="font-size: 12px;">@MessageDriven(mappedName = "custom/DocumentListener", activationConfig = {
@ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Topic"),
@ActivationConfigProperty(propertyName = "destination", propertyValue = "topic/wdkDocument")})</pre>
		</div>
	</div>
	<p>&#160;</p>
	<p>The return object will be a MapMessage which will contain the
		following parameters:</p>
	<ul>
		<li><strong>event (String):</strong>&#160;Provides the type of
			event that was performed with the document, as shown in the table
			below:</li>
	</ul>
	<div class="table-wrap">
		<table class="confluenceTable">
			<tbody>
				<tr>
					<td class="highlight-grey confluenceTd"
						data-highlight-colour="grey"><p align="center">
							<span style="color: rgb(0, 51, 102);">Event</span>
						</p></td>
					<td class="highlight-grey confluenceTd"
						data-highlight-colour="grey"><p style="text-align: center;">
							<span style="color: rgb(0, 51, 102);">Description</span>
						</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>
							<em>PUBLISH</em>
						</p></td>
					<td class="confluenceTd"><p>A new document posted.</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>
							<em>MODIFY</em>
						</p></td>
					<td class="confluenceTd"><p>Document is modified</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>
							<em>DELETE</em>
						</p></td>
					<td class="confluenceTd"><p>Document is deleted from the
							database.</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>
							<em>SENDRECYCLE</em>
						</p></td>
					<td class="confluenceTd"><p>Document is sent to bin.</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>
							<em>DELETEFOLDER</em>
						</p></td>
					<td class="confluenceTd"><p>A folder is deleted from the
							database.</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>
							<em>EXTERNALCONVERTION</em>
						</p></td>
					<td class="confluenceTd"><p>Document with custom
							conversion.</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>
							<em>CONVERTIONLONGTERM</em>
						</p></td>
					<td class="confluenceTd"><p>Document converted to long
							term.</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>
							<em>MOVE</em>
						</p></td>
					<td class="confluenceTd"><p>One or more documents or
							folders have been moved from one folder to another.</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>
							<em>RESTORERECYCLE</em>
						</p></td>
					<td class="confluenceTd"><p>Restores documents and folders
							from the Bin.</p></td>
				</tr>
			</tbody>
		</table>
	</div>
	<p>&#160;</p>
	<ul>
		<li><strong>companyId (Integer):</strong>&#160;Code of the
			company in which the document was handled.</li>
		<li><strong>colleagueId (String):</strong>&#160;User who
			performed the action.</li>
		<li><strong>documentId (Integer):</strong>&#160;Code of the
			document that experienced the action.</li>
		<li><strong>version (Integer):</strong>&#160;Document version
			number.</li>
		<li><strong>lhasCreatedDocument (Boolean):</strong>&#160;Reports
			if document was created.</li>
		<li><strong>IhasIncreasedVersion (Boolean):</strong>&#160;Reports
			if the version was incremented.</li>
		<li><strong>changedApproval (Boolean):</strong>&#160;Reports if
			the approver has been modified.</li>
		<li><strong>document (byte[ ]):</strong>&#160;Array of bytes with
			the document and its properties.</li>
	</ul>
	<p>&#160;</p>
	<div class="code panel pdl" style="border-width: 1px;">
		<div class="codeHeader panelHeader pdl"
			style="border-bottom-width: 1px;">
			<b>Example</b>
		</div>
		<div class="codeContent panelContent pdl">
			<pre class="theme: Confluence; brush: java; gutter: false"
				style="font-size: 12px;">import java.util.Enumeration;
import javax.ejb.ActivationConfigProperty;
import javax.ejb.MessageDriven;
import javax.jms.MapMessage;
import javax.jms.Message;
import javax.jms.MessageListener;

@MessageDriven(mappedName = "custom/DocumentListener", activationConfig = {
@ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Topic"),
@ActivationConfigProperty(propertyName = "destination", propertyValue = "topic/wdkDocument")
})

public class DocumentListenerMessageBean implements MessageListener {

    @Override
    public void onMessage(Message message) {
        try {
            System.out.println("========Document Listener========");
            System.out.println("Message received: " + message.getJMSMessageID());
            if (message instanceof MapMessage) {
                MapMessage mm = (MapMessage) message;
                @SuppressWarnings("unchecked")
                Enumeration&lt;String> es = mm.getMapNames();
                while (es.hasMoreElements()) {
                    String prop = es.nextElement();
                    System.out.println(prop + ": " + mm.getObject(prop));
                }
            }
            System.out.println("========End of Document Listener========");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}</pre>
		</div>
	</div>
	<p>&#160;</p>
	<p>
		The &#160;<strong>wdkAbstract</strong>&#160; will be triggered when
		some Fluig objects are handled, according to the table below:
	</p>
	<p>&#160;</p>
	<div class="table-wrap">
		<table class="confluenceTable">
			<tbody>
				<tr>
					<td class="highlight-grey confluenceTd"
						data-highlight-colour="grey"><p align="center">
							<span style="color: rgb(0, 51, 102);">Object</span>
						</p></td>
					<td class="highlight-grey confluenceTd"
						data-highlight-colour="grey"><p align="center">
							<span style="color: rgb(0, 51, 102);">Description</span>
						</p></td>
					<td class="highlight-grey confluenceTd"
						data-highlight-colour="grey"><p align="center">
							<span style="color: rgb(0, 51, 102);">DB Table</span>
						</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>Icon</p></td>
					<td class="confluenceTd"><p>Icon</p></td>
					<td class="confluenceTd"><p>ICON</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>Topic</p></td>
					<td class="confluenceTd"><p>Subject</p></td>
					<td class="confluenceTd"><p>TOPIC</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>Shortcut</p></td>
					<td class="confluenceTd"><p>Menu Security</p></td>
					<td class="confluenceTd"><p>MENU_ICON</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>LogAccess</p></td>
					<td class="confluenceTd"><p>Access Log</p></td>
					<td class="confluenceTd"><p>LOG_ACCESS</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>ColleagueReplacement</p></td>
					<td class="confluenceTd"><p>Substitute</p></td>
					<td class="confluenceTd"><p>COLAB_SUBSTTO</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>Application</p></td>
					<td class="confluenceTd"><p>Application</p></td>
					<td class="confluenceTd"><p>APLICATIVO</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>ProgressLib</p></td>
					<td class="confluenceTd"><p>Progress Environment</p></td>
					<td class="confluenceTd"><p>AMBIEN_PROGRESS</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>GlobalCalendar</p></td>
					<td class="confluenceTd"><p>Holiday</p></td>
					<td class="confluenceTd"><p>CALEND_GLOBAL</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>Term</p></td>
					<td class="confluenceTd"><p>Term</p></td>
					<td class="confluenceTd"><p>TERM</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>Synonym</p></td>
					<td class="confluenceTd"><p>Synonym</p></td>
					<td class="confluenceTd"><p>SYNONYM</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>DocumentType</p></td>
					<td class="confluenceTd"><p>Document Type</p></td>
					<td class="confluenceTd"><p>TIPO_DOCUMENTO</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>Volume</p></td>
					<td class="confluenceTd"><p>Volume</p></td>
					<td class="confluenceTd"><p>VOL_FISIC</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>AttributionMecanism</p></td>
					<td class="confluenceTd"><p>Assignment Mechanism</p></td>
					<td class="confluenceTd"><p>MECAN_ATRIBUIC</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>EmailTemplate</p></td>
					<td class="confluenceTd"><p>Email Template</p></td>
					<td class="confluenceTd"><p>TEMPLATE_EMAIL</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>CustomizedDatasetBuilder</p></td>
					<td class="confluenceTd"><p>Dataset</p></td>
					<td class="confluenceTd"><p>SERV_DATASET</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>DataService</p></td>
					<td class="confluenceTd"><p>Services</p></td>
					<td class="confluenceTd"><p>SERV_DADOS</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>CustomFields</p></td>
					<td class="confluenceTd"><p>Customized Fields</p></td>
					<td class="confluenceTd"><p>CAMPO_CUSTOM</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>UserGraphicSetings</p></td>
					<td class="confluenceTd"><p>Dashboard</p></td>
					<td class="confluenceTd"><p>CONFIGUR_GRAF_USUAR</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>Watermark</p></td>
					<td class="confluenceTd"><p>Watermark</p></td>
					<td class="confluenceTd"><p>MARCA_DAGUA</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>WebLayout</p></td>
					<td class="confluenceTd"><p>Layout</p></td>
					<td class="confluenceTd"><p>WEBLAYOUT</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>Adapter</p></td>
					<td class="confluenceTd"><p>Adapters</p></td>
					<td class="confluenceTd"><p>ADAPTER</p></td>
				</tr>
			</tbody>
		</table>
	</div>
	<p>&#160;</p>
	<p>For the application to receive the message with the information
		of these objects, the class has to extend the MessageListener and have
		the following line:</p>
	<div class="code panel pdl" style="border-width: 1px;">
		<div class="codeContent panelContent pdl">
			<pre class="theme: Confluence; brush: java; gutter: false"
				style="font-size: 12px;">@MessageDriven(mappedName = "custom/DocumentListener", activationConfig = {
@ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Topic"),
@ActivationConfigProperty(propertyName = "destination", propertyValue = "topic/wdkAbstract")})</pre>
		</div>
	</div>
	<p>&#160;</p>
	<p>The return object will be a MapMessage which will contain the
		following parameters:</p>
	<ul>
		<li><strong>event (String):</strong>&#160;Provides the type of
			event that was performed with the object, as shown in the table
			below:</li>
	</ul>
	<div class="table-wrap">
		<table class="confluenceTable">
			<tbody>
				<tr>
					<td class="highlight-grey confluenceTd"
						data-highlight-colour="grey"><p align="center">
							<span style="color: rgb(0, 51, 102);">Event</span>
						</p></td>
					<td class="highlight-grey confluenceTd"
						data-highlight-colour="grey"><p style="text-align: center;">
							<span style="color: rgb(0, 51, 102);">Description</span>
						</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>CREATE</p></td>
					<td class="confluenceTd"><p>A new object was created.</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>UPDATE</p></td>
					<td class="confluenceTd"><p>An object was modified</p></td>
				</tr>
				<tr>
					<td class="confluenceTd"><p>DELETE</p></td>
					<td class="confluenceTd"><p>An object was deleted from the
							database.</p></td>
				</tr>
			</tbody>
		</table>
	</div>
	<p>&#160;</p>
	<ul>
		<li><strong>userId (String):</strong>&#160;User who performed the
			action.</li>
		<li><strong>entity (String):</strong>&#160;The object entity that
			is being handled, according to the object table that has already been
			presented above.</li>
		<li><strong>mapNewVersion (byte[ ]):</strong>&#160;Array of bytes
			of a HashMap &lt; String, Object > with the property of the object.</li>
		<li><strong>mapPreviousVersion (byte[ ]):</strong>&#160;Array of
			bytes of a HashMap &lt; String, Object> with the property of the
			object before the change.</li>
	</ul>
	<p>&#160;</p>
	<div class="aui-message hint shadowed information-macro">
		<p class="title">Note</p>
		<span class="aui-icon icon-hint">Icon</span>
		<div class="message-content">
			<p>This map has no objects when the event is CREATE and DELETE.</p>
		</div>
	</div>
	<p>&#160;</p>
	<p>To transform the Array of bytes received in the message in a
		HashMap, just use the function below:</p>
	<div class="code panel pdl" style="border-width: 1px;">
		<div class="codeContent panelContent pdl">
			<pre class="theme: Confluence; brush: java; gutter: false"
				style="font-size: 12px;">&#160;private Map&lt;String, Object> decoderMap(byte[] array) {
    
        if(array.length>0){
            ByteArrayInputStream bos = new ByteArrayInputStream(array);
            ObjectInputStream p = new ObjectInputStream(bos);
            Object docObject = p.readObject();
            try{
                Map&lt;String, Object> map = (Map&lt;String, Object>) docObject;
                return map;
            }catch(java.lang.ClassCastException e){
                e.printStackTrace();
            }
        }                   
        return null;
    }</pre>
		</div>
	</div>
	<div class="code panel pdl" style="border-width: 1px;">
		<div class="codeHeader panelHeader pdl"
			style="border-bottom-width: 1px;">
			<b>Example</b>
		</div>
		<div class="codeContent panelContent pdl">
			<pre class="theme: Confluence; brush: java; gutter: false"
				style="font-size: 12px;">&#160;package com.totvs.fluig.custom.dm;

import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.util.Enumeration;
import java.util.Iterator;
import java.util.Map;
import javax.ejb.ActivationConfigProperty;
import javax.ejb.MessageDriven;
import javax.jms.MapMessage;
import javax.jms.Message;
import javax.jms.MessageListener;

@MessageDriven(mappedName = "custom/DocumentListener", activationConfig = {
    @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Topic"),
    @ActivationConfigProperty(propertyName = "destination", propertyValue = "topic/wdkAbstract")
})
public class AbstractListenerMessageBean implements MessageListener {
    @Override
    public void onMessage(Message message) {
        try {
            System.out.println("==============Abstract Listener====================");
            System.out.println("Message received: " + message.getJMSMessageID());
            if (message instanceof MapMessage) {
                MapMessage mm = (MapMessage) message;
                @SuppressWarnings("unchecked")
                Enumeration&lt;String> es = mm.getMapNames();
                while (es.hasMoreElements()) {
                    String prop = es.nextElement();
                    System.out.println(prop + ": " + mm.getObject(prop));
                    if(prop.equalsIgnoreCase("mapNewVersion")
                            || prop.equalsIgnoreCase("mapOldVersion")){
                        Map&lt;String, Object> m = decoderMap(mm.getBytes(prop));
                        Iterator it = m.entrySet().iterator();
                        while (it.hasNext()) {
                            Map.Entry e = (Map.Entry)it.next();
                            System.out.println(prop + " - " + e.getKey() + ": " + e.getValue());
                        }
                    }
                }
            }
            System.out.println("==========End of Abstract Listener===============");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
      
    private Map&lt;String, Object> decoderMap(byte[] array) throws IOException, ClassNotFoundException{
        if(array.length>0){
            ByteArrayInputStream bos = new ByteArrayInputStream(array);
            ObjectInputStream p = new ObjectInputStream(bos);
            Object docObject = p.readObject();
            try{
                Map&lt;String, Object> map = (Map&lt;String, Object>) docObject;
                return map;
            }catch(java.lang.ClassCastException e){
                e.printStackTrace();
            }
        }                   
        return null;
    }

}
&#160;</pre>
		</div>
	</div>
</div>