Mostrando entradas con la etiqueta JD Edwards. Mostrar todas las entradas
Mostrando entradas con la etiqueta JD Edwards. Mostrar todas las entradas

miércoles, 5 de junio de 2024

[JD Edwards] Orchestrator: Manipulate Output - Remove duplicate nodes (EN)

 

Hola JDEFriends,

On this occasion, I want show how I've got to realize in a simple way transform a orchestrator json with items repeated, in other without items repeteaded output.

We are the following json input:


We can see how are several repeated references. We are use the function "uniq" of json module in JRuby into the Manipulated Ouput of ower orchestrator:

require 'json'  
def main(orchAttr, input)
    
    jsonIn = JSON.parse(input)
    
    #Add code here to manipulate JSON output
    items = jsonIn['ITEMS']
    unique_items = items.uniq{|item| item['ShortItemNo']}
    jsonIn['ITEMS'] = unique_items
    
    jsonOut = JSON.generate(jsonIn)
    
    return jsonOut
end

We get all ITEM nodes, and apply the uniq function, this iterate about all items, and it return the json with the unique items in function of the 'ShortItemNo' attribute.



Good code!


jueves, 23 de mayo de 2024

[JD Edwards] Orchestrator: Manipulate Output - Eliminar nodos duplicados (ES)

 

Hola JDEFriends,


En esta ocasión quería mostraros cómo he conseguido realizar de manera simple transformar un json de orchestrator con artículos repetidos, en otro como salida sin referencias repetidas.

Tenemos el siguiente json input:


Vemos cómo tenemos varias referencias repetidas. Vamos a usar la función "uniq" del módulo json en JRuby en el Manipulate Output de nuestro orchestrator:

require 'json'  
def main(orchAttr, input)
    
    jsonIn = JSON.parse(input)
    
    #Add code here to manipulate JSON output
    items = jsonIn['ITEMS']
    unique_items = items.uniq{|item| item['ShortItemNo']}
    jsonIn['ITEMS'] = unique_items
    
    jsonOut = JSON.generate(jsonIn)
    
    return jsonOut
end

Obtenemos todos los nodos de ITEMS y aplicamos la función uniq que itera sobre todo los items y nos devuelve el json con los items únicos en función del atributo 'ShortItemNo'



Buen código!


viernes, 17 de mayo de 2024

[JD Edwards] Orchestrator Manipulate Output - Remove node by key (ENG)

Hola JDEFriends,

In this occassion, I'm going to show you how to manipulate the output json of your orchestrator. Well because we want to add or remove some element of it, group, change tags, etc. that we have not been able to do in the orchestration itself.

The first one we should to do is execute our orchestrator and see our json output. Next, we're go to output properties and on the tab "Manipulate output":


Here, we have our json as input and output. In the middle, we can to do custom manipulations in groovy, jruby, etc. script language acoording to your version and preference.

In my case, I want was to remove some json nodes based on an input parameter (in this case, in the exection of the availability application P41202).

Here the code:

availability_grid.reject! do |item|

        if jsonIn['GetTotals'] != "1"
            item['Location'] == 'TOTAL:' || item['Location'] == 'GRAND TOTAL:'
        end
    end

And here, you can do everything you can image and/or need.

You will have to run your orchestrator trial and error, off course, since until now, we have no way to debug or test it individually.

Happy code!

jueves, 16 de mayo de 2024

[JD Edwards] Orchestrator Manipulate Output - Eliminar nodo por clave (ES)

Hola JDE Amigos,

En ésta ocasión, os voy a mostrar cómo manipular el json de salida de vuestro orchestrator. Bien porque querramos añadir o eliminar algún elemento del mismo, agrupar, cambiar etiquetas, etc. que no hemos podido hacer en la propia orquestación.

Lo primero que debemos hacer es ejecutar nuestro orchestrator y ver la salida de nuestro json. A continuación, nos vamos a las propiedades de salida y a la pestaña "Manipulate Output":


 Aquí tendremos como entrada y salida de la función nuestro json. En medio, podemos hacer las manipulaciones que necesitemos en lenguaje script groovy, jruby, etc. según vuestra versión y preferencia.

En mi caso, lo que quería era quitar unos nodos del json en función de un parámetro de entrada (en este caso en la ejecución de la aplicación de disponibilidad P41202).

He aquí el código:

availability_grid.reject! do |item|

        if jsonIn['GetTotals'] != "1"
            item['Location'] == 'TOTAL:' || item['Location'] == 'GRAND TOTAL:'
        end
    end

Y aquí ya podréis realizar todo lo que podáis imaginar y/o necesitéis. 

Tendréis que ejecutar a prueba-error vuestro orchestrator eso sí, ya que hasta ahora, no tenemos forma de poder debugarlo ni testearlo individualmente.

Feliz código!

[JD Edwards] P90U100 - Table Definition Inquiry (ENG)

 Hola JDEFriends,


As I mentioned in a previous post, we have the JDETables web tool to inquiry fields, index, perform queries, etc. on JDE tables.

Well, interanally in JDE we have a application with a similar functionality which is P90U100 - Table Definition Inquiry:


En esta pantalla podemos filtrar por una tabla y obtener todos sus campos con sencuencias, alias, nombre, índice, tipo de dato y todas las propiedades de cada campo del diccionario de datos.

In this query we can filter by a table and get all its fields with sequences, alias, name, index, data type, and all data dictionary properties.

Very useful, although with less functionality than JDETables obviously.

Happy code!

[JD Edwards] P90U100 - Table Definition Inquiry (ES)

 Hola JDE Amigos,


Como comenté en un post anterior, tenemos la herramienta web JDETables para consultar campos, índices, realizar queries, etc. sobre tablas de JDE.

Pues bien, internamente en JDE tenemos una aplicación con una funcionalidad similar que es P90U100 - Table Definition Iquiry:


En esta pantalla podemos filtrar por una tabla y obtener todos sus campos con sencuencias, alias, nombre, índice, tipo de dato y todas las propiedades de cada campo del diccionario de datos.

Muy útil, aunque con menos funcionalidad que JDETables obviamente.

Feliz Código!

martes, 30 de abril de 2024

[SQL] LISTAGG Function

Sometimes, I'm find needing go group data grouping by a line. For example, how get and export all user emails. Normally, we have 1-1 relation a database table, but we want export grouping un a unique line by user. I'm sure, we could export to a excel and pivot in a table, or with other tool. But, how to do it in SQL?

The solution lies in the LISTAGG function, which groups all rows results into a single colum.

The sintax is the next:

           
SELECT LISTAGG(column_name, delimiter) WITHIN GROUP (ORDER BY ordering_column)
FROM table_name

        

Consequently, in the previous example, we could achieve this with the following query:

SELECT EAAN8, ABALPH, LISTAGG(TRIM(EAEMAL), ',') WITHIN GROUP (ORDER BY EAEMAL) AS EMAILS FROM F01151 JOIN F0101 ON EAAN8=ABAN8 WHERE EAETP = 'E' GROUP BY EAAN8, ABALPH;

Return the nex ouptut:


In next posts we are looking how export in XML, JSON, etc. format.

Kind regards and good code!


[SQL] Función LISTAGG

 Hola JDEFriends,

En ocasiones me he encontrado con la necesidad de obtener datos agrupando en una línea. Por ejemplo, cómo obtener y exportar todos los emails de un usuario. Normalmente, para ello tenemos relación 1-1 en una tabla en base de datos, pero queremos exportar agrupado en una única línea por usuario. Seguramente podamos exportarlo a un excel y pivotarlo en una tabla o con otra herramienta ¿Cómo hacemos esto en SQL?

La solución está en la función LISTAGG, la cual agrupa en una única columna todos los resultados de las filas.

La sintaxis es la siguiente:

        
           
SELECT LISTAGG(column_name, delimiter) WITHIN GROUP (ORDER BY ordering_column)
FROM table_name

        

Por lo cual, en el ejemplo anterior podríamos realizarlo con la siguiente query:

SELECT EAAN8, ABALPH, LISTAGG(TRIM(EAEMAL), ',') WITHIN GROUP (ORDER BY EAEMAL) AS EMAILS FROM F01151 JOIN F0101 ON EAAN8=ABAN8 WHERE EAETP = 'E' GROUP BY EAAN8, ABALPH;

Con la siguiente salida:


En otro posts veremos cómo exportar en formato XML, JSON, etc.

Saludos y buen código!


viernes, 1 de abril de 2022

[JD Edwards - BSSV] Import external JAVA library (ENG)

Hi jde friends,

Sometimes, we find ourselves with need to extend JD Edwards functionalities and we find many functionalities in JAVA packages or libraries, JAVA is one of the most languages and platform used in technologies. For example, recently I worked in a project to implement Bidimensional code QR. So, what is the JDE solution?


Well, we use a JAVA library to facilitate the coding. In this case IdAutomation (that is license paid, but there are other as Google (Zxing) and many other open source, depending on each case and use). So, this provider provides a java library in witch it has a class and a method for facility implementation, that we pass the string to be encoded and it return as array string encoded. Later, to this array we put a font in BIPublisher and we already have our encoded QR code. Easy right?

Then, we generated our BSSV object (and we cannot forget our BSFN in C to communicate our report or application with BSSV component), with our class and main method. But, how import IdAutomation QR library to our JD Developer project?

1. On our project, we press the rigth button and in the context menu click on Project Properties:

2. Press in Librares and Classpath menu and next press button Add JAR Directory

3. Select the JAVA library (I recommend leaving in the JDE Path JDE system\Classes (later I explain the reason)

4. Press on Open button in the dialog, and it is added to the project:

5. Press OK and save the project. We can use library classes and method importing to our java class.

               boolean bestMask = true;           // Best pattern mask
               
               String resultQREncode = qre.FontEncode(dataToEncode, applyTilde, encodingMode, errorCorrectionLevel, version, bestMask);
               internalVO.setSzQREncodedData(resultQREncode);
               
               printMsg(context, "Encoded => ");
               printMsg(context, resultQREncode);

And we have everything ready in our project!!!

To deploy, we have to configure system to use a external library for when compiling and generating deploy package it imports the external library in jar jde deploy package. This configuration is done in deploy server (although I also configure it in my fat client).

1. Copy the library to system\Classes folder:

2. Modify the file sbffoundation.ini inside the same folder, in the section [Foundation] y and add a line "LIB" + "next sequence" + "=" + "library name"

And with this we already our BSSV project with an external library ready to deploy!

Pd: I have also used an external library for Datamatrix code, integrate with Webcenter Content through RIDC standard java package, and recently to create a proxy client webservice through an external library with java wsimport command to integrate with Salesforce that you can see here.

Good code JDE Friends!

sábado, 19 de febrero de 2022

[JD Edwards] Form Charts - ChartControl Component (ENG)

Hola jdedwerds,

I recently worked on a project where we needed to display KPI's of sales orders processed automatically, so beside showing the boring tables with the processed orders info and the percentage calculation in certain fields, I thought of adding a graph which is always more visually pleasing.

This time I have done it natively, it's true that we have had this tool for quite some time but I've rarely seen it used even in a standard apps - on the P41021 availability app and on some planning/production applications- and I don't understand why (it are not the most powerful charts for that there are other tools, but for simple cases use it should be enough)

It's true that we have other tools in the environment itself such as One View Reporting OVR or that KPI's are usuarlly analyzed in business with Business Intelligence BI tools, but why not give them a touch of color to our JDE applications??




The first thing to do is to insert a ChartControl in our form:



Then, in the event where we have the information to display (after reading each grid line, at the end of the grid, etc.) we create a variable to load the XML tags needed for the chart -in my case a foot chart-. Then, we load the information to the chart through the Set Data XML function available in the Chart Control Functions section of the System Functions. And finally, we perform the action to draw the chart with the Draw Chart function avaible in the same section previously seen:




Therefore, the code would like this:


The following chart types are available:

  • bar_basic
  • bar_basic_percent
  • cluster_bar_basic
  • combo_basic
  • line_basic
  • pie_basic
  • pie_ontime
  • stacked_bar_basic
  • stacked_bar_ontime

We can perform visualization tests of graphs and examples created in our installation on our web server with the resource http://<webhost>:<webport>/jde/GraphPrototype.maf




For more oficial information in the next link: https://support.oracle.com/epmos/faces/DocumentDisplay?id=648865.1

The next thing I want to integrate are external charts from Google Charts, through a TextBlock and with the API's provided by Google. I'll try to make a POC, soon.

I hope you found it interesting and useful.

Best regards.

Alfredo.

viernes, 18 de febrero de 2022

[JD Edwards] Gráficos Formularios - Componente ChartControl (ESP)

Hola jdedwerds,

Recientemente trabajé en un proyecto donde necesitaba mostrar unos KPI's de pedidos de ventas procesados automáticamente, por lo que aparte de mostrar las aburridas tablas con la info de pedidos procesados y el cálculo del porcentaje en ciertos campos, se me ocurrió añadir una gráfica que siempre resulta más agradable visualmente. 

Ésta vez lo hice de manera nativa, es cierto que tenemos desde hace bastante tiempo ésta herramienta pero pocas veces la he visto ser utilizada incluso de manera estándar -en pantalla disponibilidad P41021 y en algunas de planificación/producción- y no entiendo el motivo (no son las gráficas más potentes para eso existen otras herramientas, pero para un uso y casos sencillos debería ser suficiente).. 

Es cierto que disponemos de otras herramientas en el propio entorno como One View Reporting OVR o que normalmente los KPI's se analizan en negocio con herramientas de Business Intelligence BI, pero por qué no darles un toque de color a nuestras pantallas JDE??




Lo primero que debemos realizar es insertar un ChartControl en nuestro formulario:



A continuación en el evento donde dispongamos de la información para mostrar (después de leer cada línea, al finalizar el grid, etc.), lo que haremos será crear una variable para cargar las etiquetas XML necesarias para el gráfico -en mi caso un gráfico de pie-. Posteriormente, cargamos la información al gráfico a través de la función Set Data XML disponible en la sección Chart Control Functions de las System Functions. Y finalmente realizamos la acción para que se dibuje el gráfico con la función Draw Chart disponible en la misma sección anteriormente vista:




Por lo cual, el código quedaría tal que así:


Disponemos de los siguientes tipos de gráficos:

  • bar_basic
  • bar_basic_percent
  • cluster_bar_basic
  • combo_basic
  • line_basic
  • pie_basic
  • pie_ontime
  • stacked_bar_basic
  • stacked_bar_ontime

Podemos realizar pruebas de visualización de gráficas y ejemplos creados en nuestra instalación, en nuestro servidor web con el recurso http://<webhost>:<webport>/jde/GraphPrototype.maf




Para más información oficial en el siguiente enlace: https://support.oracle.com/epmos/faces/DocumentDisplay?id=648865.1

Lo siguiente que quiero integrar son gráficas externas de Google Charts, mediante un TextBlock y con las API's facilitadas por Google. Intentaré hacer una POC, próximamente.

Espero les haya resultado interesante y útil.

Un saludo,

Alfredo.

jueves, 9 de diciembre de 2021

[JD Edwards - BSSV] JD Edwards - Salesforce integration: Making proxy package JAVA with WSIMPORT tool

Hi friend,

Recently, I've done a JDE with Salesforce Cloud integration, through BSSV both inbound and outbound communication with Soap technology. Salesforce use Apex (Oracle Application Express) for integrations

Integración JDE - Salesforce



One of the main problems that I found was generate proxy client, the  Organization WSDL  has a lot of methods (this service is the principal , and it is used for all access related: login, logout, sessions, userinfo, etc), and besides that when trying to generate proxy client in JDeveloper 12c (12.2.1.3.0) it gave errors to namespaces conflicts.

So, I decided try alternate path, using JAVA wsimport tool, it tool from the file or IP WSDL will generate us a package java .jar with all classes and method services, it package we could import to a ower bssv project as external library and works comfortable.

You can look a lot of information about the use of it java tool:

https://docs.oracle.com/javase/7/docs/technotes/tools/share/wsimport.html

https://www.ibm.com/support/knowledgecenter/es/SSEQTP_9.0.5/com.ibm.websphere.base.doc/ae/twbs_jaxwsclientfromwsdl.html

https://www.ibm.com/support/knowledgecenter/es/SSEQTP_9.0.5/com.ibm.websphere.base.doc/ae/rwbs_wsimport.html

https://mkyong.com/webservices/jax-ws/jax-ws-wsimport-tool-example/

http://chuwiki.chuidiang.org/index.php?title=Ejemplo_sencillo_de_web_service_con_jax-ws


And more specific for Salesforce service:

https://stackoverflow.com/questions/2322953/jax-ws-adding-soap-headers

https://udby.com/archives/132

I recommend, java version it's the same for wsimport and JDeveloper configured for your JDE enviroment ( it can do directly with the java executable version in JDE machine or add java version path on the PATH operative system).


Execution example:

wsimport -b bindings.xjb -keep -B-XautoNameResolution -XadditionalHeaders -Xdebug OrganizationDEV.wsdl -clientjar SalesForceOrganizationDEVWSDLConnector.jar 

Donde

wsimport: java  command for class generation from wsdl

-b: specify link files jaxws/jaxb or additional schemes

bindings.xjb: link file or additional schemes

-keep: keep generated files 

-B-XautoNameResolution: JAXB instructions to automatically resolve names conflicts.

-XadditionalHeaders: generates header parameters in request methods

-Xdebug: print debug information

OrganizationDEV.wsdl: wsdl file with service information

-clientjar: make jar file with artifacts generated together WSDL metadata for call web service.

SalesForceOrganizationDEVWSDLConnector.jar: jar file will generate with all java class and wsdl to project import.

bindings.xjb file will depends from namespaces and transformations to do.

bindings.xjb

<?xml version="1.0" encoding="UTF-8"?>

<bindings

    wsdlLocation="wsdlcalidad.wsdl"

    xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"

    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"

    xmlns:xsd="http://www.w3.org/2001/XMLSchema"

    xmlns="http://java.sun.com/xml/ns/jaxws">

    <bindings node="//xsd:schema[@targetNamespace='urn:sobject.enterprise.soap.sforce.com']">

      <jaxb:globalBindings generateElementProperty="false" underscoreBinding="asCharInWord"/>

    </bindings>

</bindings>


Other example:

<?xml version="1.0" encoding="UTF-8"?>

<bindings

    wsdlLocation="INTProducto_JDE.wsdl"

    xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"

    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"

    xmlns:xsd="http://www.w3.org/2001/XMLSchema"

    xmlns="http://java.sun.com/xml/ns/jaxws">

    <bindings node="//xsd:schema[@targetNamespace='http://soap.sforce.com/schemas/class/INTProducto_JDE']">

      <jaxb:globalBindings generateElementProperty="false" underscoreBinding="asCharInWord"/>

  <jaxb:schemaBindings>

        <jaxb:nameXmlTransform>

          <jaxb:typeName suffix="Type" />

        </jaxb:nameXmlTransform>

      </jaxb:schemaBindings>

    </bindings>

    <bindings node="//xsd:schema[@targetNamespace='http://soap.sforce.com/schemas/class/INTResponse']">

      <jaxb:globalBindings generateElementProperty="false" underscoreBinding="asCharInWord"/>

  <jaxb:schemaBindings>

        <jaxb:nameXmlTransform>

          <jaxb:typeName suffix="Type" />

        </jaxb:nameXmlTransform>

      </jaxb:schemaBindings>

    </bindings>

    <enableWrapperStyle>false</enableWrapperStyle>

    <enableAsyncMapping>false</enableAsyncMapping>

</bindings>

And finally, you import jar file to project, adding libraries for deploy and start to use classes and method to call service.

I hope it is useful for you friend.

Best regards.




jueves, 29 de julio de 2021

[JD Edwards - BSSV] Integración JDE - Salesforce: Crear proxy paquete JAVA con WSIMPORT

 Hola amigos,

Recientemente he realizado una integración de JDE con Salesforce Cloud, a través de BSSV tanto de entrada como de salida con Soap. Salesforce utiliza Apex para las integraciones.

Integración JDE - Salesforce

Uno de los problemas principales que me encontré fue al generar el proxy client, ya que el WSDL de Organization que se genera tiene una gran cantidad de métodos (éste servicio es el principal, y se utiliza para todo lo relacionado con el acceso: login, logout, sessions, userinfo, etc), y además al generar el proxy client en JDeveloper 12c (12.2.1.3.0) daba errores por conflictos en los namespaces.

Así que, decidí utilizar un camino alternativo, utilizando la herramienta de JAVA wsimport el cual a partir del archivo o dirección WSDL nos generará un paquete java .jar con las clases y métodos del servicio, el cual podremos importar a nuestro proyecto como una librería externa y trabajar cómodamente.

Podéis encontrar mucha información acerca del uso de ésta herramienta java:

https://docs.oracle.com/javase/7/docs/technotes/tools/share/wsimport.html

https://www.ibm.com/support/knowledgecenter/es/SSEQTP_9.0.5/com.ibm.websphere.base.doc/ae/twbs_jaxwsclientfromwsdl.html

https://www.ibm.com/support/knowledgecenter/es/SSEQTP_9.0.5/com.ibm.websphere.base.doc/ae/rwbs_wsimport.html

https://mkyong.com/webservices/jax-ws/jax-ws-wsimport-tool-example/

http://chuwiki.chuidiang.org/index.php?title=Ejemplo_sencillo_de_web_service_con_jax-ws


Y más específicos para servicios de Salesforce:

https://stackoverflow.com/questions/2322953/jax-ws-adding-soap-headers

https://udby.com/archives/132

Os recomiendo, que la versión java que utilicéis para wsimport sea la misma que utilice la versión del JDeveloper configurado para vuestro JDE (esto podréis hacerlo directamente con el ejecutable de la versión java instalado o añadiendo la ruta de la versión java sobre el PATH del sistema operativo).


Ejemplo ejecución:

wsimport -b bindings.xjb -keep -B-XautoNameResolution -XadditionalHeaders -Xdebug OrganizationDEV.wsdl -clientjar SalesForceOrganizationDEVWSDLConnector.jar 

Donde

wsimport: comando java para la generación de clases a partir de wsdl

-b: expecifica archivos de enlace jaxws/jaxb o esquemas adicionales

bindings.xjb: archivo de enlace o esquemas adicionales

-keep: mantiene los archivos generados

-B-XautoNameResolution: instrucción de JAXB para automáticamente resolver conflictos de nombres

-XadditionalHeaders: genera parámetros de cabecera en los métodos de la peticiones

-Xdebug: imprime la información de depuración

OrganizationDEV.wsdl: archivo wsdl con la información del servicio

-clientjar: crea el archivo jar de los artefactos generados junto con los metadatos WSDL necesarios para llamar al servicio web.

SalesForceOrganizationDEVWSDLConnector.jar: archivo jar a generar con todas las clases java y wsdl para importar al proyecto.

El archivo bindings.xjb dependerá de los namespaces y transformaciones a realizar.

bindings.xjb

<?xml version="1.0" encoding="UTF-8"?>

<bindings

    wsdlLocation="wsdlcalidad.wsdl"

    xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"

    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"

    xmlns:xsd="http://www.w3.org/2001/XMLSchema"

    xmlns="http://java.sun.com/xml/ns/jaxws">

    <bindings node="//xsd:schema[@targetNamespace='urn:sobject.enterprise.soap.sforce.com']">

      <jaxb:globalBindings generateElementProperty="false" underscoreBinding="asCharInWord"/>

    </bindings>

</bindings>


Otro ejemplo:

<?xml version="1.0" encoding="UTF-8"?>

<bindings

    wsdlLocation="INTProducto_JDE.wsdl"

    xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"

    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"

    xmlns:xsd="http://www.w3.org/2001/XMLSchema"

    xmlns="http://java.sun.com/xml/ns/jaxws">

    <bindings node="//xsd:schema[@targetNamespace='http://soap.sforce.com/schemas/class/INTProducto_JDE']">

      <jaxb:globalBindings generateElementProperty="false" underscoreBinding="asCharInWord"/>

  <jaxb:schemaBindings>

        <jaxb:nameXmlTransform>

          <jaxb:typeName suffix="Type" />

        </jaxb:nameXmlTransform>

      </jaxb:schemaBindings>

    </bindings>

    <bindings node="//xsd:schema[@targetNamespace='http://soap.sforce.com/schemas/class/INTResponse']">

      <jaxb:globalBindings generateElementProperty="false" underscoreBinding="asCharInWord"/>

  <jaxb:schemaBindings>

        <jaxb:nameXmlTransform>

          <jaxb:typeName suffix="Type" />

        </jaxb:nameXmlTransform>

      </jaxb:schemaBindings>

    </bindings>

    <enableWrapperStyle>false</enableWrapperStyle>

    <enableAsyncMapping>false</enableAsyncMapping>

</bindings>

Y por último, importar el archivo .jar al proyecto, añadirlo a las librerías para el despliegue y empezar a utilizar las clases y métodos para la llamada al servicio.

Espero os sea útil.

Un saludo.




jueves, 25 de febrero de 2021

[JD Edwards - BSSV] Importar librería JAVA externa (ESP)

 Hola amigos,

En ocasiones, nos encontramos con la necesidad de extender la funcionalidad de nuestro JDE y muchas funcionalidades nos la encontramos en paquetes o librerías externas JAVA ya que es uno de los lenguajes y plataformas más extendidos. Por ejemplo, recientemente trabajé en un proyecto para implementar códigos bidimensionales QR. Entonces, ¿cuál es la solución?


Pues utilizamos una librería JAVA para facilitar la codificación, en éste caso una de IdAutomation que es de pago, pero hay otras de Google (Zxing) y otras muchas open source, depende cada caso y uso.
Pues bien, éste proveedor facilita una librería java en el cuál tiene una clase y un método que le pasamos el string a codificar y nos devuelve un array codificado. Posteriormente, a éste array le ponemos una fuente y ya tenemos nuestro código QR codificado. Fácil ¿verdad?

Entonces, generamos nuestro objeto BSSV (y no nos olvidemos nuestra BSFN en C para luego comunicarnos desde nuestro report o aplicación), con nuestra clase y método principal. Pero ¿Cómo importamos nuestra librería en nuestro entorno JDeveloper

1. Sobre nuestro proyecto, pulsamos botón derecho y en el menú Project Properties...:

2. Pulsamos sobre el menú en Libraries and Classpath, y dentro de éste sobre Add JAR/Directory:


3. Seleccionamos nuestra librería (recomiendo dejarla en la ruta JDE system\Classes (y luego explico el motivo)

4. Pulsamos sobre Open/Abrir, se nos añade a nuestro proyecto

5. Pulsamos OK, y guardamos el proyecto. Ya podremos utilizar las clases y métodos de la librería externa importándolas a nuestro código.

               boolean bestMask = true;           // Best pattern mask
               
               String resultQREncode = qre.FontEncode(dataToEncode, applyTilde, encodingMode, errorCorrectionLevel, version, bestMask);
               internalVO.setSzQREncodedData(resultQREncode);
               
               printMsg(context, "Encoded => ");
               printMsg(context, resultQREncode);

Y ya tendríamos todo listo en nuestro proyecto!

Para desplegar, tenemos que configurar a nivel de sistema que usamos una librería externa para que a la hora de compilar y que genere el paquete de despliegue, importe nuestra librería. Ésta configuración se realiza en el servidor Deploy (aunque yo también la configuro en mi cliente pesado).

1. Copiamos nuestra librería en la carpeta system\Classes de nuestra instalación:

2. Modificamos el fichero sbffoundation.ini dentro de la misma carpeta, en la sección [Foundation] y añadimos una línea con "LIB" + "siguiente secuencia" + "=" + "Nombre de nuestra librería"

Y con esto ya tendríamos nuestro proyecto de BSSV con una librería externa lista para desplegar!

PD: he utilizado librería externa también para código Datamatrix, para integrar con Webcenter Content a través de RIDC, y recientemente para crear un webservice proxy client a través de una librería externa con wsimport que pondré próximamente en un post.

Buen código JDE Friends!

martes, 5 de noviembre de 2019

[JD Edwards] Asign Icon to Cell Grid

Hi Friends,

When we show data in grid in application, it could be very cross and relevants, but often not very attractive. In JDE we can assign icons to cells to make it visually more attractive and to have a more global idea about the information shown.


How do we do this?

On the one hand, we use Set Grid Cell Icon system function, but attention! this function is only availabe in Business Functions NER type. This function has only 2 parameters:



  •  Image File: image selected to show. We position ourselves in the parameters, click on <Image Picker> and select an icon of the available Bitmaps of the system. ¿Could we add custom images? Of course, but for that we would have to add them previously to the system bitmaps.
  •  Icon Tooltip: as tooltip  we can pass a literal text or assign the description of a data dictionary text (type Error Message).


But, How do I assign it to a column?

The first thing we will have to do is modify in the properties of the same column in Display Style is assign Type Icon.

With this option an event is enabled in the column "Grid Cell Display Changed" where we will call our BSFN to display the icon. Of course, remember that it will only be displayed on the web.

Do I have to do this for each icon I want to display?

The answer is depends on how you put it, there are currently numerous standard functions where they are already implemented. As examples:
  • N43S003 - Load Grid Cell Icon
  • N3201990 - Message Center Icons
  • N0900730 - Set Delete Icon
  • N40G1240 - Set Edit Icon
  • N98220 - Set Grid Icon Web
  • N986110B - Set Grid Icon
  • etc
Must of these functions already have input parameters to show some icons or others depending on the input parameters, or else you can create your own BSFN NER Custom!!!

An example of mine to show attachments with a custom structure at the header level:
JD Ewards Grid Cell Icon
JD Ewards Grid Cell Icon

I hope it will be you useful!

Let's go!






[JD Edwards] Asignar Icono a Columna en Grid

Hola amig@s,

Cuando mostramos en una aplicación los datos en un grid, éstos pueden ser muy transcendentales y relevantes pero a menudo no muy atractivo. En JDE podemos asignar iconos a columnas para hacerlo visualmente más atractivo y poder tener de un vistazo una idea más global acerca de la información mostrada.

¿Cómo hacemos ésto?

Por un lado, utilizamos la función de sistema Set Grid Cell Icon, pero atención! ésta función sólo está disponible en Business Functions tipo NER. Ésta función sólo tiene 2 parámetros:



  •  Image File: imagen seleccionada para mostrar. Nos posicionamos en el parámetros, clickamos sobre <Image Picker> y seleccionamos un icono de los Bitmaps disponibles del sistema. ¿Podemos añadir imágenes personalizadas? Por supuesto, pero para ello tendríamos que añadirlas previamente a los bitmaps del sistema.
  •  Icon Tooltip: como tooltip podremos pasar un texto literal o asignar la descripción de un diccionario de texto (tipo Erro Message).


¿Pero cómo se lo asigno a una columna?

Lo primero que tendremos que hacer es modificar en las propiedades de la misma columna en Display Style asignar tipo Icon.

Con ésta opción se nos habilita un evento en la columna "Grid Cell Display Changed" donde llamaremos a nuestra BSFN para mostrar el icono. Por supuesto, recordar que sólo se mostrará en web.

¿Tengo que hacer ésto para cada icono que quiera mostrar?

La respuesta es depende cómo lo plantees, actualmente existen numerosas funciones estándar donde ya están implementadas. Como ejemplos:


  • N43S003 - Load Grid Cell Icon
  • N3201990 - Message Center Icons
  • N0900730 - Set Delete Icon
  • N40G1240 - Set Edit Icon
  • N98220 - Set Grid Icon Web
  • N986110B - Set Grid Icon
  • etc
La mayoría de éstas funciones ya tienen parámetros de entrada para mostrar unos iconos u otros en función de los parámetros de entrada, y sino puedes montarte tu propia BSFN NER Custom!!!

Un ejemplo mío para mostrar anexos con una estructura custom a nivel de cabecera:
JD Ewards Grid Cell Icon
JD Ewards Grid Cell Icon

Espero les sea de utilidad!

Let's go!






jueves, 4 de enero de 2018

[JD Edwards BI Publisher] External Image

Hi friends, happy new year!!! This year I have proposed to write more posts, for work and projects last year I had't sufficient time to write much posts...

In this post I want to comment how publish a external image as URL in BI Publisher, as example, QR Code, a logo, etc. This problem is very common, and with standard Word image is not possible.

For it, we use XSL-FO with the next syntax:

<fo:block>
<fo:external-graphic src="https://chart.googleapis.com/chart?chs=200x200&cht=qr&chl=bidi_test"/>
</fo:block>

Simply with block we'll add URL of extenal image in the source of extenal-graphic tag, and it will be responsible for rendering the image in our template. The source is in XML attribute, assigned in same variable, etc.

We can add other properties as "height", "width", etc. for custom the image.

Thus, we could generate dynamic images!!

I hope you find it useful!

Let's go!

[JD Edwards BI Publisher] Imagen Externa

Hola amigos, feliz año!!! Éste año me he propuesto escribir más posts, ya que por motivos laborales y de proyectos no tuve el suficiente tiempo para postear más...

En éste post quiero comentar cómo publicar en BI Publisher una imagen externa a través de una URL, por ejemplo un código QR, un logo, etc. Ésta problemática es muy común y con las imágenes estándar de word no es posible.

Para ello tenemos podemos usar XSL-FO con la siguiente sintaxis:

<fo:block>
<fo:external-graphic src="https://chart.googleapis.com/chart?chs=200x200&cht=qr&chl=bidi_test"/>
</fo:block>

Simplemente con un bloque añadimos en el source de la etiqueta external-graphic la URL de la imagen externa y éste se encargará de renderizar en nuestro template. El source lo tendremos en nuestras propiedades del XML, o podemos asignar alguna variable, etc.
Podemos añadir otras propiedades como "height", "width", etc para personalizar la imagen.

De ésta forma, podremos generar imágenes de manera dinámica!

Espero os sea de utilidad.

Let's go!