Histórico da Página
HTML |
---|
<div id="main-content" class="wiki-content group"> <h1 id="ConversoresdeDocumentos-Índice">Índice<>Contents</h1> <p> </p> <p> <style type='text/css'>/*<![CDATA[*/ div.rbtoc1412695505262 { padding: 0px; } div.rbtoc1412695505262 ul { list-style: none; margin-left: 0px; } div.rbtoc1412695505262 li { margin-left: 0px; padding-left: 0px; } /*]]>*/ </style> <div class='toc-macro rbtoc1412695505262'> <ul class='toc-indentation'> <li><span class='TOCOutline'>1</span> <a href='#ConversoresdeDocumentos-VisualizaçãodeDocumentosVisualizaçãodeDocumentos'>Visualización>Viewing de documentos.<Documents</a></li> <li><span class='TOCOutline'>2</span> <a href='#ConversoresdeDocumentos-ConhecimentosNecessários'>Conocimientos>Necessary necesarios<Knowledge</a></li> <li><span class='TOCOutline'>3</span> <a href='#ConversoresdeDocumentos-ConstruçãodeumConversor'>Construcción>Construction deof una convertidor <Converter</a> <ul class='toc-indentation'> <li><span class='TOCOutline'>3.1</span> <a href='#ConversoresdeDocumentos-Parte1:ConstruindooEJBMessage-Driven'>Parte>Part 1: ConstruyendoBuilding el EJBthe Message-Driven<Driven EJB</a></li> <li><span class='TOCOutline'>3.2</span> <a href='#ConversoresdeDocumentos-Parte2:Message-Drivenparacriaçãodedocumentosdelongoprazo'>parte>Part 2: Message-Driven parafor lathe creacióncreation deof documentos a largo plazo<long-term documents</a></li> <li><span class='TOCOutline'>3.3</span> <a href='#ConversoresdeDocumentos-Parte3:RegistrandooconversornoFluig'>parte>Part 3: RegistrandoRegistering elthe convertidorconverter enat Fluig</a></li> <li><span class='TOCOutline'>3.4</span> <a href='#ConversoresdeDocumentos-Parte4:AdicionarolisteneraoservidorFluig'>Parte>Part 4: AñadirAdd elthe listener alto servidorthe Fluig<Fluig server</a></li> <li><span class='TOCOutline'>3.5</span> <a href='#ConversoresdeDocumentos-Parte5:Indicarqueodocumentoutilizaovisualizadorinterno'>parte>Part 5: IndicarIndicate that quéthe documentodocument utilizauses elthe visorinternal interno<viewer</a></li> </ul></li> <li><span class='TOCOutline'>4</span> <a href='#ConversoresdeDocumentos-ThirdPartyTrademarks'>Third -Party Trademarks</a></li> </ul> </div> </p> <h1 id="ConversoresdeDocumentos-VisualizaçãodeDocumentos">Visualización>Document de documentos.<View</h1> <p>De<p>By forma predeterminadadefinition, elthe visorinternal internoview deat Fluig soportasupports the losformats formatosfor dedocuments, documentosimages, detexts imágenes,and textosPDF yextension. documentosHowever, dethere extensiónare PDF.cases Sinwhere embargo,it hayis casosnecessary enthat losthe cualesViewer esbe necesariosupported quefor elother visualizadordocument seaformats, soportadosuch enas otrosspreadsheets, formatos de documentos como planillas DWGDWG files, etc.</p> <p>Con<p>In elorder finto deease facilitarthe laintegration integraciónwith condifferent distintosformats, formatos,Fluig Fluighas cuentacustomization conpoints puntosthat allows deany personalizaciónfile queformat permitento quebe cualquiersupported formato de archivo sea soportado por el visualizador interno, ya que existe una herramienta que realiza la conversión de formato deseado a formato PDFin the internal viewer as long as there is any tool available to perform the conversion of the desired format to the PDF format.</p> <p> LosThe documentosdocuments debenmust tenerhave unaa copiacopy enin formatothe PDF 1.4 para format to be internally visualizarviewed internamente enin Fluig, cuyawhose especificaciónspecification estáis enin <a href="http://www.adobe.com/devnet/pdf/pdf_reference_archive.html" style="font-size: 10.0pt; line-height: 13.0pt;" class="external-link" rel="nofollow">http://www.adobe.com/devnet/pdf/pdf_reference_archive.html</a> </p> <p>Fluig hacemakes lathe conversiónautomatic automáticaconversion ato PDF conwith lostext documentos dedocuments textosupported que soporta Microsoft ®by Microsoft® Word uor OpenOffice.org ™. Para otrosorg™. For other types, if tipos,one siwishes seto deseause them utilizarin elthe visualizadorinternal internoviewer, sea debeconversion armarplugin unfor pluginPDF paramust la conversión a PDFbe built.</p> <h1 id="ConversoresdeDocumentos-ConhecimentosNecessários">Conocimientos>Necessary Necesarios<Knowledge</h1> <p>Para construir un convertidor es necesario poseer los siguientes conocimientos<p>In order to build a converter, it is necessary to have the following skills:</p> <ul> <li>Tecnología <span<li><span style="font-size: 10.0pt; font-family: Arial, sans-serif;">™>Java Java™ EE</span><span> Technology</li> <li><span style="font-size: 10.0pt; font-family: Arial, sans-serif;">Lenguaje>JavaScript JavaScript<Language</span></li> </ul> <h1 id="ConversoresdeDocumentos-ConstruçãodeumConversor">Construcción>Construction deof una convertidor<Converter</h1> <p> <span style="font-size: 10.0pt; line-height: 13.0pt;">El plugin>The deconversion conversiónplugin seis componemade deof dostwo partesparts:</span> </p> <ol> <li>Un<li>A componenteMessage-Driven EJB Message-Driven, para recibir la solicitudcomponent to receive the conversion de conversiónrequest;</li> <li>Aplicación<li>Application/programaprogram quethat haráwill laconvert conversiónit;</li> <li>Indicar<li>Indicate quethat elthe documentodocument utilizauses elthe visorinternal interno.<viewer</li> </ol> <p>Este capítulo presentará un ejemplo de un convertidor de archivos de texto (txt) a formato<p>This chapter will present an example of a converter for text (.txt) files to PDF, parain queorder ustedto pueda utilizarlo en el visualizador interno de use the internal viewer on Fluig.</p> <p> </p> <div class="aui-message hint shadowed information-macro"> <p class="title">Importante<>Important</p> <span class="aui-icon icon-hint">Icon</span> <div class="message-content"> <p>Para<p>Please ayudarlo,download descarguethe losfollowing siguientes códigoscodes:</p> <p> <a href="attachments/73082704/126158185.zip">ECMExternalConvertion-project.zip</a> </p> </div> </div> <p> </p> <p> </p> <h3 id="ConversoresdeDocumentos-Parte1:ConstruindooEJBMessage-Driven">Parte>Part 1: ConstruyendoBuilding elthe EJB Message-Driven<Driven EJB</h3> <p class="MsoNormal" style="text-align: justify;"> CrearCreate una Message-Driven quethat escuchelistens elto temathe <strong>topic/wdkDocument</strong>: Letopic: mostramosFind unaexample fuentesource de ejemplobelow: </p> <div class="code panel pdl" style="border-width: 1px;"> <div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"> <b>TxtMessageBean.java</b> </div> <div class="codeContent panelContent pdl"> <pre class="first-line: 1; theme: Eclipse; brush: java; gutter: true" style="font-size: 12px;">paquete>package com.fluig.conv; Importimport javax.ejb.ActivationConfigProperty; Importimport javax.ejb.MessageDriven; Importimport javax.ejbjms.MessageDrivenMessage; Importimport javax.ejbjms.MessageDrivenMessageListener; @MessageDriven (nombrename = "pruebatest/TxtConverter'", activationConfig = {} @ActivationConfigProperty (propertyName = "destinationType", propertyValue = "javax.jms.Topic"), @ActivationConfigProperty (propertyName = "destinationTypedestination", propertyValue = "javax.jms.Topictopic/wdkDocument"), }) public class TxtMessageBean implements MessageListener {} @Override public void onMessage(Message message) { try { String event = message.getStringProperty("event"); if (event != null && event.equals("EXTERNALCONVERTION")) { String doc = message.getStringProperty("documentpath"); if (doc != null && doc.endsWith(".txt")) { ProcessBuilder pb = new ProcessBuilder("txt2pdf.exe", doc, doc + ".pdf", "-lpp40"); pb.start(); } } } catch (Exception e) { e. printStackTrace (); } } }</pre> </div> </div> <p class="MsoNormal" style="text-align: justify;"> ElThe Message-Driven anterior configura la propiedad above configures the destinationType paraproperty for <strong>"javax.jms.Topic"</strong> parato indicate indicarthat queit ustedwill escucharálisten unto temaa JMS topic, yand lathe propiedaddestination deproperty destinoto para <strong>"topic/wdkDocument"</strong> parato indicate indicarwhich atopic quéwill temabe selistened escucharáto. ElThe tema "topic/wdkDocument" es dondetopic seis envíanwhere losthe eventosdocument depublishing publicaciónevents are desent documentosto. </p> <p class="MsoNormal" style="text-align: justify;"> AlUpon recibirreceiving una mensajemessage, the deberátype comprobarof elpublished tipoevent demust eventobe publicadochecked porthrough medio dethe StringProperty "<strong>evento<<strong>event</strong>",; siif elthe valorvalue deof estathis propiedadproperty esis <strong>"EXTERNALCONVERTION"</strong>, it significameans quethat Fluig indicais queindicating esthat elthis momentois dethe ejecutartime lafor conversiónthe customized personalizadaconversion to take place. </p> <p class="MsoNormal" style="text-align: justify;"> ParaIn order obtenerto laobtain rutathe deldocument documentopath, Compruebecheck lathe StringProperty <strong>"documentpath"</strong>. </p> <p class="MsoNormal" style="text-align: justify;">Después>After dethis, esto,the sefile compruebaextension lamust extensiónbe delchecked parato validarvalidate siif estethis esis elthe convertidorcorrect correctoconverter, porquebecause puedethere habermay másbe demore unothan paraone diferentes extensionesconverter for different extensions.</p> <p class="MsoNormal" style="text-align: justify;">Cuando>Once se hayathe validadoparameters losare parámetrosvalidated, the seconverter puedeprogram llamarcan entoncesbe alcalled; programain dethe conversiónexample, que en el caso del ejemplo, fue utilizado el txt2pdf freewarethe txt2pdf http://www.verypdf.com/txt2pdf/ freeware was used.</p> <p class="MsoNormal" style="text-align: justify;">El>The documento detarget destinodocument debemust tenerhave elthe mismosame nombrename másplus la extensiónthe .pdf yextension, esteand deberáit quedarshould be enin elthe mismosame directoriodirectory. EjEx: doc.txt convertidoconverted: doc.txt.pdf</p> <p class="MsoNormal" style="text-align: justify;">Le>It recordamosis queimportant elto documentoremember dethat origenthe nosource podrádocument sermay modificado,not conbe lamodified, sanciónwith de quethe penalty of Fluig indiqueindicating quethat seit has habeen cambiadoexternally externamentechanged (validación de CRCCRC validation).</p> <p class="MsoNormal" style="text-align: justify;"> <span style="font-size: 10.0pt; line-height: 13.0pt;">Message-Driven>This deberá empaquetarse e implantarse en el servidor de aplicacionesMessage-Driven must be packed and deployed on the application server conformeaccording lasto especificacionesJava™ de Java ™ EEEE specifications.</span> </p> <p class="MsoNormal" style="text-align: justify;"> </p> <h3 id="ConversoresdeDocumentos-Parte2:Message-Drivenparacriaçãodedocumentosdelongoprazo">Parte>Part 2: Message-Driven parafor lathe creacióncreation deof documentos a largo plazo<long-term documents</h3> <p class="MsoNormal" style="text-align: justify;"> <span style="color: rgb(51, 51, 51); font-size: 10.0pt; font-weight: normal; line-height: 13.0pt;">Se>The puede utilizar el Mesage-Driven presentado en el punto anterior paraMessage-Driven presented in the previous item can be used in the la creación de documentoscreation of long-term documents, with a largofew plazo,changes siendo necesario hacerbeing necessary. algunosIn cambios.order Parato saberknow si MEssageif the Message-Driven is estábeing siendoused utilizadofor parathe lacreation creaciónof dela archivo a largo plazo, hay un nuevo parámetrolong-term file, there is a new parameter called llamado "isLongTerm", estethis parámetroparameter esis unaa String, yand if siit es igual ais "true", the "true"document esit porquewants elto documentogenerate queis se desea generar es un a PDF/A, considered a long-term considerado como el archivo a largo plazofile.</span> </p> <p class="MsoNormal" style="text-align: justify;"> <span style="font-size: 10.0pt; line-height: 13.0pt;">Fluig consideraconsiders sóloonly elthe formato PDF/A format comoas the formatoone posiblepossible parato generargenerate documentoslong-term a largo plazo a través dedocuments via </span>Message-Driven<span style="font-size: 10.0pt; line-height: 13.0pt;">.</span> </p> <p class="MsoNormal" style="text-align: justify;"> <span style="font-size: 10.0pt; line-height: 13.0pt;"> </span><span style="font-size: 10.0pt; line-height: 13.0pt;">Para>In order to identificaridentify lathe creacióncreation deof un archivo a largolong-term plazo, se debefile, the physical name of the modificardocument elshould nombre físico del documentobe changed, incluyendoincluding lathe string "PDFĂ"PDFA" at the end of althe final del nombre del archivofile name. PorFor ejemploexample, siif elthe nombre del archivo esfile name is manual.txt, el nombre de este archivo después de la conversión seráthe name of this file after conversion will be manual.txtPDFA.pdf. Vea el ejemplo a continuación queSee the ilustraexample below losshowing cambiosthe necesarioschanges enneeded elin </span>Message-Driven<span style="font-size: 10.0pt; line-height: 13.0pt;"> parato crearcreate elthe documento a largo plazolong-term document:</span> </p> <div class="code panel pdl" style="border-width: 1px;"> <div class="codeContent panelContent pdl"> <pre class="first-line: 1; theme: Eclipse; brush: java; gutter: true" style="font-size: 12px;">String longTerm = message.getStringProperty("isLongTerm"); if (doc != null && doc.endsWith(".txt")) { if (longTerm != null && longTerm.equals("true")) { String documentName = doc + "PDFA.pdf"; //llamarCall althe métodoconversion demethod conversiónfor para PDF/A } }</pre> </div> </div> <p class="MsoNormal" style="text-align: justify;">En>On lathe primerafirst línealine, sethe recupera el valor del parámetroparameter value "isLongTerm" is recovered parato saberknow siif sethe necesitacreation laof creacióna delong-term unfile archivois abeing largo plazorequested. DespuésAfter dechecking haberthe comprobadodocument laextension, extensiónthe dellongTerm documento,variable sevalue compruebais elchecked. valorIf deit lais variablenot longTerm,null siand esta no es nula y es igual a "true", entonces creamos mediante el llamado del método de conversión de documentos utilizando el nombre del archivo con string is "true", then the creation can be performed by calling the document conversion method using for such the file name with the "PDFA.pdf" string.</p> <p class="MsoNormal" style="text-align: justify;"> </p> <h3 id="ConversoresdeDocumentos-Parte3:RegistrandooconversornoFluig">Parte>Part 3: RegistrandoRegistering elthe convertidorconverter enat Fluig</h3> <p>En<p>In Fluig Studio, hagaright-click clicthe conevents elfolder, botónselect derecho del mousse en lathe New carpetaoption eventos,and seleccionarthen lathe opciónFluig New,Global y luego la opción Evento Global FluigEvent option:</p> <p> <img class="confluence-embedded-image confluence-content-image-border" height="329" width="655" src="http:attachments/73082704/tdn.totvs.com/plugins/servlet/confluence/placeholder/unknown-attachment?locale=pt_BR&version=2" data73407626.png" data-image-src="http:attachments/73082704/tdn.totvs.com/plugins/servlet/confluence/placeholder/unknown-attachment?locale=pt_BR&version=273407626.png"> </p> <p> ElThe asistenteNew EventoEvent Nuevowizard seis abreopened. SelecioneSelect elthe evento <strong>addDocumentConvertionExt </strong>ystrong>event luegoand hagathen clicclick enon elthe botónFinish Finishbutton. </p> <p> <img class="confluence-embedded-image" src="http:attachments/73082704/tdn.totvs.com/plugins/servlet/confluence/placeholder/unknown-attachment?locale=pt_BR&version=273407627.png" data-image-src="http:attachments/73082704/tdn.totvs.com/plugins/servlet/confluence/placeholder/unknown-attachment?locale=pt_BR&version=273407627.png"> </p> <p>El<p>The eventoevent seis agregaráadded alto proyectothe enproject copiarin eventosthe yevents sefolder abriráand paraopened lafor ediciónediting. ElThe objetivoobjective deof estethis eventoglobal globalevent esis agregarto lasadd extensionesthe queextensions tienenwith una convertidorcustom personalizadoconverter. En este ejemploIn this example, it is esnecessary necesarioto añadiradd lathe extensióntxt txtextension, as seen conformein lathe fuente a continuaciónsource below:</p> <div class="code panel pdl" style="border-width: 1px;"> <div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"> <b>addDocumentConvertionExt.js</b> </div> <div class="codeContent panelContent pdl"> <pre class="first-line: 1; theme: Eclipse; brush: javascript; gutter: true" style="font-size: 12px;">function addDocumentConvertionExt(ext) { ext.Add add("txt"); }</pre> </div> </div> <div class="aui-message warning shadowed information-macro"> <span class="aui-icon icon-warning">Icon</span> <div class="message-content"> <p> <strong>Atención<strong>Attention: </strong>Parastrong>For laprinting impresiónpublished dedocuments los documentoswith publicados con la opción "Actualizar Propiedades de la Copiathe option "Update Controlled Copy Properties?" the external Controlada?" <strong>NO<converter will <strong>NOT</strong> se utilizará el convertidor be used. Since it is necessary externo. Como es necesario aplicar las propiedades de la copiato apply the controlled copy properties to the original document and controlada del documento original y realizar una nueva conversión,perform a new conversion, this process can only be performed at the esteexecution procesotime sewith puedethe realizarproduct enstandard tiempoconverter. de ejecución con elTherefore, in convertidorthe estándarprinting de producto. Por lo tantoof documents, enformat lacan impresión del documento, puede experimentar la pérdida de formateo dependiendo debe lost depending on the recursosvisual visualesresources aplicadosapplied enin suits contenidocontent (bordesborders, colors, coloresimages, imágenes, etc.). </p> </div> </div> <p class="MsoNormal" style="text-align: justify;"> </p> <h3 id="ConversoresdeDocumentos-Parte4:AdicionarolisteneraoservidorFluig">Parte>Part 4: AñadirAdd elthe listener ento althe servidorFluig Fluig<server</h3> <p> <span style="color: rgb(51, 51, 51); font-size: 10.0pt; font-weight: normal; line-height: 13.0pt;">Paquete>Pack delthe JMS </span><em style="color: rgb(51, 51, 51); font-size: 10.0pt; font-weight: normal; line-height: 13.0pt;">listener </em><span style="color: rgb(51, 51, 51); font-size: 10.0pt; font-weight: normal; line-height: 13.0pt;">JMS> yand eladd agregadoit ento < > SERVER FLUIGFLUIG>/jboss/apps /.</span> </p> <p style="text-align: center;"> <img class="confluence-embedded-image image-left" src="http:attachments/73082704/tdn.totvs.com/plugins/servlet/confluence/placeholder/unknown-attachment?locale=pt_BR&version=2126158181.png" data-image-src="http:attachments/73082704/tdn.totvs.com/plugins/servlet/confluence/placeholder/unknown-attachment?locale=pt_BR&version=2">  </p> <p 126158181.png">  </p> <p style="text-align: center;"> </p> <p style="text-align: center;"> </p> <p> </p> <h3 id="ConversoresdeDocumentos-Parte5:Indicarqueodocumentoutilizaovisualizadorinterno">Parte>Part 5: IndicarIndicate quéthat documentothe utilizadocument eluses visorinternal interno<viewer</h3> <p>Ahora<p>Now quethat lathe extensión .txt extension sewas registrórecorded comoas poseedorahaving dea uncustomized convertidor personalizadoconverter, simplementemark marquethe laoption opción "¿Utiliza visualizador interno"Use Internal Viewer?" enin la publicación del documentothe document publication:</p> <p> <img class="confluence-embedded-image" width="500" src="http:attachments/73082704/tdn.totvs.com/plugins/servlet/confluence/placeholder/unknown-attachment?locale=pt_BR&version=273407620.png" data-image-src="http:attachments/73082704/tdn.totvs.com/plugins/servlet/confluence/placeholder/unknown-attachment?locale=pt_BR&version=2"> 73407620.png"> </p> <p> </p> <p>  <strong>Notes:</p>strong> <p>OBSERVACIONES<</p> <ul> <li>En<li>In elthe ejemploexample proporcionadoprovided, seintegration presentanexamples ejemplosare deprovided integracionesfor conthe lospreviously productoscreated <em>Office (Word, Excel yand PowerPoint)</em> creados anteriormenteproducts. </li> <li>En<li>In elthe ejemploexample proporcionadoprovided, sean presentaintegration unexample ejemplo defor integración de conversión de formatos converting <em>DWG</em> formats utilizando la herramientausing the <em>dwg2pdf </em> de la empresa em>tool from the <em>AutoDWG</em> company. </li> <li>Los<li>The códigosconversion decodes conversiónare sononly sólo ejemplosexamples, sutheir desarrollodevelopment yand configuración es responsabilidad del desarrolladorconfiguration are the responsibility of the developer.</li> <li>Puede<li>A utilizarpacked el<em>plugin<strong> <em>plugin<strong> </strong></em>empaquetado disponible en el anexo. Para la integración con productos deem> can be used made Microsoft se requiere de ajustes detallados en elavailable in the attachment. The settings detailed in the guide <a href="75271469.html">ambiente>Java® de ejecución de Java ®<execution environment</a>, permitiendoallowing lacommunication comunicaciónbetween entrethe el servidor Fluig yserver los componentes de <em>Office</em>and <em>Office</em> components are necessary for the integration with Microsoft products. </li> </ul> </div><h1 id="ConversoresdeDocumentos-ThirdPartyTrademarks">Third-Party Trademarks</h1> <p>Microsoft, Word are either registered trademarks or trademarks of Microsoft Corporation in the United States and/or other countries.</p> <p>JavaScript is a trademark of Oracle Corporation.</p> <p>Java and OpenOffice.org are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.</p> </div> |
Visão Geral
Import HTML Content
Conteúdo das Ferramentas
Tarefas