Á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">
	<h3
		id="id-2.AssociaçãodeRegistrosdoBancodeDadoscomDocumentosnoGED-2.1.Objetivo">
		<strong>2.1. Objective</strong>
	</h3>
	<p align="LEFT">Allow the user to upload/download a document to the
		FLUIG(GED) document center, linking it to a record in business
		database. This functionality can be used in metadata forms of the type
		CRUDFreeForm or FreeForm.</p>
	<p align="LEFT">&#160;</p>
	<h3
		id="id-2.AssociaçãodeRegistrosdoBancodeDadoscomDocumentosnoGED-2.2.GuiadeUtilização">
		<strong>2.2. Use Guide</strong>
	</h3>
	<p align="LEFT">
		When a form includes a record selected by the user, its <strong>Related
			Actions</strong> component can present an item to allow the association of any
		document with the selected record. Figure 1.2.a presents a Metadata
		CRUD with a selected record. When the user clicks <strong>Related
			Actions</strong>, the <strong>Document Association</strong> item will be
		presented.
	</p>
	<p align="LEFT">
		<img class="confluence-embedded-image image-center"
			src="http://tdn.totvs.com/download/attachments/81789095/image00.png?version=2&modificationDate=1381350303000&api=v2"
			data-image-src="http://tdn.totvs.com/download/attachments/81789095/image00.png?version=2&modificationDate=1381350303000&api=v2">
	</p>
	<p align="LEFT" style="text-align: center;">
		<strong>Figure 1.2.a</strong>
	</p>
	<p align="LEFT">
		<span>In the case of CRUDFreeForm, when the user selects a
			record (only 1) in the search grid, the document association item
			should be automatically available. In the case of FreeForm, the
			ABLScript code shall be used to enable the item. </span><span>&#160;</span>
	</p>
	<p align="LEFT">
		<span>When the user clicks the <strong>Document
				Association</strong> item, the window presented in Figure 1.2.b will be
			displayed.
		</span>
	</p>
	<p align="LEFT" style="text-align: center;">
		<img class="confluence-embedded-image image-center"
			src="http://tdn.totvs.com/download/attachments/81789095/image02.png?version=1&modificationDate=1381854680000&api=v2"
			data-image-src="http://tdn.totvs.com/download/attachments/81789095/image02.png?version=1&modificationDate=1381854680000&api=v2"><strong>Figure
			1.2.b</strong>
	</p>
	<p align="LEFT">
		After confirming the operation, the window of Figure 1.2.c will be
		presented to the user, where the user can click the <strong>Select</strong>
		button to choose a file in the local machine.
	</p>
	<p align="LEFT">
		<img class="confluence-embedded-image image-center"
			src="http://tdn.totvs.com/download/attachments/81789095/image03.png?version=1&modificationDate=1381854823000&api=v2"
			data-image-src="http://tdn.totvs.com/download/attachments/81789095/image03.png?version=1&modificationDate=1381854823000&api=v2">
	</p>
	<p align="LEFT" style="text-align: center;">
		<strong>Figure 1.2.c</strong>
	</p>
	<p align="LEFT">&#160;</p>
	<p align="LEFT">The system will then load the file and send it to a
		folder in GED. Then it displays the screen shown in Figure 1.2.d.</p>
	<p align="LEFT">
		<img class="confluence-embedded-image image-center"
			src="http://tdn.totvs.com/download/attachments/81789095/image04.png?version=1&modificationDate=1381855014000&api=v2"
			data-image-src="http://tdn.totvs.com/download/attachments/81789095/image04.png?version=1&modificationDate=1381855014000&api=v2">
	</p>
	<p align="LEFT" style="text-align: center;">
		<strong>Figure 1.2.d</strong>
	</p>
	<p align="LEFT">After adding a document, the user has the option to
		add other files to associate with the same record, as shown in Figure
		1.2.e.</p>
	<p align="LEFT">
		<img class="confluence-embedded-image image-center"
			src="http://tdn.totvs.com/download/attachments/81789095/image05.png?version=1&modificationDate=1381855187000&api=v2"
			data-image-src="http://tdn.totvs.com/download/attachments/81789095/image05.png?version=1&modificationDate=1381855187000&api=v2">
	</p>
	<p align="LEFT" style="text-align: center;">
		<strong>Figure 1.2.e</strong>
	</p>
	<p align="LEFT">
		In another situation, the user may select the <strong>same</strong>
		record again, open <strong>Related Actions</strong> and click again in
		<strong>Document Association</strong> (Figure 1.2.a). From this point,
		the user can download one of the files associated back to the local
		machine or remove the document association with the record, as shown
		in figures 1.2.f and 1.2.g.
	</p>
	<p align="LEFT">
		<img class="confluence-embedded-image image-center"
			src="http://tdn.totvs.com/download/attachments/81789095/image06.png?version=1&modificationDate=1381855306000&api=v2"
			data-image-src="http://tdn.totvs.com/download/attachments/81789095/image06.png?version=1&modificationDate=1381855306000&api=v2">
	</p>
	<p align="LEFT" style="text-align: center;">
		<strong>Figure 1.2.f</strong>
	</p>
	<p align="LEFT" style="text-align: center;">
		<img class="confluence-embedded-image image-center"
			src="http://tdn.totvs.com/download/attachments/81789095/image07.png?version=1&modificationDate=1381855561000&api=v2"
			data-image-src="http://tdn.totvs.com/download/attachments/81789095/image07.png?version=1&modificationDate=1381855561000&api=v2"><strong>Figure
			1.2.g</strong>
	</p>
	<p align="LEFT">&#160;</p>
	<h3
		id="id-2.AssociaçãodeRegistrosdoBancodeDadoscomDocumentosnoGED-2.3.GuiadeProgramação">
		<strong>2.3. Programming Guide</strong>
	</h3>
	<p>
		In order for the component of <strong>Related Actions</strong> of a <strong>CRUDFreeForm</strong>
		to be able to present the <strong>Document Association</strong> item,
		the <strong>enableDocRel</strong> property must be set via the
		ABLScript, as shown in the following example:
	</p>
	<p align="LEFT" class="western" style="margin-left: 37.4333px;">
		<span><strong>SETPROPERTY</strong></span><span>(relatedActions,
			“</span><span>enableDocRel</span><span><strong>”, true).</strong></span>
	</p>
	<p align="LEFT" class="western" style="margin-left: 7.0px;">
		<span><strong><br /></strong>In case of <strong>FreeForm</strong>
			forms, the developer should add the <strong>RelatedActionsOperation</strong>
			component to the form. When there is a selected record in the form,
			run a script similar to the following:</span>
	</p>
	<div class="code panel pdl" style="border-width: 1px;">
		<div class="codeContent panelContent pdl">
			<pre class="theme: Eclipse; brush: plain; gutter: true"
				style="font-size: 12px;">DEFINE VARIABLE relatedActions AS WIDGET-HANDLE.
DEFINE VARIABLE data AS CHARACTER.
DEFINE TEMP-TABLE ttFullRecId
   FIELD databaseName AS CHARACTER
   FIELD tableName AS CHARACTER
   FIELD recordKeys AS CHARACTER.
DEFINE TEMP-TABLE ttRecId
   FIELD cdn_cliente AS INTEGER
   FIELD cod_empresa AS CHARACTER.
CREATE ttRecId.
ttRecId.cdn_cliente = 3455.
ttRecId.cod_empresa = "1".
data = JSON-ENCODE(ttRecId, true).
CREATE ttFullRecId.
ttFullRecId.databaseName = "emsuni".
ttFullRecId.tableName = "cliente".
ttFullRecId.recordKeys = data.
data = JSON-ENCODE(ttFullRecId, true).
SETPROPERTY(relatedActions, "enableDocRel", true).
CALLFUNCTION(relatedActions, "setDocRecordId", data).</pre>
		</div>
	</div>
	<p>&#160;</p>
	<p align="LEFT" class="western" style="margin-left: 7.0px;">
		<span>Information about associations between record and
			documents is stored in a table named <strong>docto_ged_relac_rec</strong>
			in the EMSFND database.<br />
		</span>
	</p>
	<p>&#160;</p>
	<p>
		<strong><br /></strong>
	</p>
</div>