Quantcast
Channel: Oracle Blog : apex
Viewing all 142 articles
Browse latest View live

How to get ORE to work with APEX

$
0
0

This blog post will bring you through the steps of how to get Oracle R Enterprise (ORE) to work with APEX.

The reason for this blog posts is that since ORE 1.4+ the security model has changed for how you access and run in-database user defined R scripts using the ORE SQL API functions.

I have a series of blog posts going out on using Oracle Text, Oracle R Enterprise and Oracle Data Mining. It was during one of these posts I wanted to show how easy it was to display an R chart using ORE in APEX. Up to now my APEX environment consisted of APEX 4 and ORE 1.3. Everything worked, nice and easy. But in my new APEX environment (APEX 5 and ORE 1.5), it didn't work. This is the calling of an in-database user defined R script using the SQL API functions didn't work. Here is the error message that is displayed.

NewImage

So something extra was needed with using ORE 1.5. The security model around the use of in-database user defined R scripts has changed. Extra functions are now available to allow you who can run these scripts. For example we have an ore.grant function where you can grant another user the privilege to run the script.

But the problem was, when I was in APEX, the application was defined on the same schema that the r script was created in (this was the RQUSER schema). When I connect to the RQUSER schema using ORE and SQL, I was able to see and run this R script (see my previous blog post for these details). But when I was in APEX I wasn't able to see the R script. For example, when using the SQL Workshop in APEX, I just couldn't see the R script.

NewImage

Something strange is going on. It turns out that the view definitions for the in-database ORE scripts are defined with

owner=SYS_CONTEXT('USERENV', 'SESSION_USER');

(Thanks to the Oracle ORE team and the Oracle APEX team for their help in working out what needed to be done)

This means when I'm connected to APEX, using my schema (RQUSER), I'm not able to see any of my ORE objects.

How do you overcome this problem ?

To fix this problem, I needed to grant the APEX_PUBLIC_USER access to my ORE script.

ore.grant(name = "prepare_tm_data_2", type = "rqscript", user = "APEX_PUBLIC_USER")

Now when I query the ALL_RQ_SCRIPTS view again, using the APEX SQL Workshop, I now get the following.

NewImage

Great. Now I can see the ORE script in my schema.

Now when I run my APEX application I now get graphic produced by R, running on my DB server, and delivered to my APEX application using SQL (via a BLOB object), displayed on my screen.

NewImage


Oracle Developers Tour Latinoamerica 2016 - Call for Papers is Open!!

$
0
0

The Call for Papers for the Oracle Developers Tour Latino America 2016 is now open!!
Speakers, we encourage you to submit yours presentations into the form that the ODT organization team has made for all the countries that participate of the Tour.

Make a clic over the image or in this link to access the Call for Papers form:

http://www.oracleapextour.com/en/oracle-developer-tour-2016-call-for-papers/

Call for Papers will end on October 10th.

Creating an APEX plugin for an Oracle JET component - Part 2

$
0
0
In my previous blogpost I showed how you can embed an Oracle JET component in your APEX application. Now it is time to make a plugin out of the wisdom we gained doing so.
First of all a disclaimer. My intention is to make this plugin and the inner workings as simple as possible. So you can add a lot more functionality, checks etc and therefore add complexity. But this is intended to be as simple as possible.

The plugin consists of three parts: a PL/SQL render function, a snippet of JavaScript and a PL/SQL ajax function.

The render function is defined as :

function render 
( p_region                in  apex_plugin.t_region
, p_plugin                in  apex_plugin.t_plugin
, p_is_printer_friendly   in  boolean 
) return apex_plugin.t_region_render_result 
is

  c_region_static_id      constant varchar2(255)  := apex_escape.html_attribute( p_region.static_id );

begin
  -- Add placeholder div
  sys.htp.p (
     '<div class="a-JET-PictoChart" id="' || c_region_static_id || '_region">' ||
       '<div class="a-JET-PictoChart-container" id="' || c_region_static_id || '_chart"></div>' ||
     '</div>' );
     
  -- Load the JavaScript library   
  apex_javascript.add_library 
  ( p_name      => 'pictoChart'
  , p_directory => p_plugin.file_prefix
  );
  
  -- Initialize the chart
  apex_javascript.add_onload_code
  ( p_code => 'jet.picto.init('||
                  '"#'||c_region_static_id||'_chart", '          || -- pRegionId
                  '"' || apex_plugin.get_ajax_identifier ||'"'   || -- pApexAjaxIdentifier
                 ')'
  );
  
  return null;
end render;

So what it does in these three steps is :
1. Generate a DIV placeholder, just as we saw in that previous post
2. Load the JavaScript file "pictoChart.js",
3. Execute the JavaScript function "jet.picto.init" providing two parameters, the regionId of the DIV and the (internal) identifier of the PL/SQL ajax function.

The contents of the JavaScript file is :

! function (jet, $, server, util, debug) {
    "use strict";
    requirejs.config({
        baseUrl: apex_img_dir + "oraclejet/js/libs",
        paths: {
            "jquery": "jquery/jquery-2.1.3.min",
            "jqueryui-amd": "jquery/jqueryui-amd-1.11.4.min",
            "ojs": "oj/v2.0.0/min",
            "ojL10n": "oj/v2.0.0/ojL10n",
            "ojtranslations": "oj/v2.0.0/resources",
            "promise": "es6-promise/promise-1.0.0.min"
        },
        shim: {
            jquery: {
                exports: ["jQuery", "$"]
            }
        }
    }), jet.picto = {
        init: function (pRegionId, pApexAjaxIdentifier) {
            require(["ojs/ojcore", "jquery", "ojs/ojpictochart"], function (oj, $) {
                server.plugin(pApexAjaxIdentifier, {}, {
                    success: function (pData) {
                        $(pRegionId)
                            .ojPictoChart(pData);
                    }
                });
            });
        }
    }
}(window.jet = window.jet || {}, apex.jQuery, apex.server, apex.util, apex.debug);
// To keep ThemeRoller working properly:
define("jquery", [], function () {
    return apex.jQuery
});

The first function call (requirejs.config) is again the same is we did earlier. Please note that the paths mentioned in here might differ in your environment. You could define those paths as (Application level) Component Settings, but for simplicity I keep them hardcoded in this example.
Notice there is a "jet" namespace defined and within that namespace a nested "picto" namespace. So we could easily extend this file (after renaming it) to other chart types. The "init" method defines the required files and then calls apex.server.plugin passing the PL/SQL ajax function as a parameter. After this ajax function is called, the result - a JSON object - is passed to the ojPictoChart function.
On the last line, as Kyle Hu correctly commented in my previous post, we have to define jquery in order to make ThemeRoller work (again).
So in fact, the JavaScript is very straightforward: in the end just an ajax call passing the result into the ojPictoChart function.

So what is the magic of the last piece, the ajax PL/SQL function? Here it is::

function ajax
( p_region    in  apex_plugin.t_region
, p_plugin    in  apex_plugin.t_plugin 
) return apex_plugin.t_region_ajax_result
is
  c       sys_refcursor;
  l_query varchar2(32767);
begin  
  l_query := p_region.source;
  open c for l_query;
  apex_json.open_object;
  apex_json.write('items', c);

  -- add settings
  apex_json.write('animationOnDisplay' , p_region.attribute_01);
  apex_json.write('columnCount'        , p_region.attribute_02);
  apex_json.write('layout'             , p_region.attribute_03);

  apex_json.close_object;
  return null;
end ajax;

Thus it just takes the region source - a SQL statement -, executes it returning a JSON object. And to these results three of the available options, defined as plugin attributes, are added. Again, as simple as possible. So no validation on the correctness of the SQL (as all APEX Developers can write a correct SQL statement, right). And just a minor part of the available options are exposed in the plugin.

When you create a region based on this plugin you have to provide it with a correct SQL statement - one that will return a valid JSON object according to the pictoChart docs. For example:

select ename||' - '||job||'@'||dname "name"
,      'human' "shape"
,      1 "count"
,      case job
       when 'PRESIDENT' then 'black'
       when 'ANALYST'   then 'blue'
       when 'CLERK'     then 'green'
       when 'MANAGER'   then 'red'
       when 'SALESMAN'  then 'yellow'
       end "color"
from   emp
       join dept on emp.deptno = dept.deptno
order by 2 desc, 4

And if you set the settings as :


You'll get as a beautiful result:
So knowing this, it wouldn't be hard to rebuild the plugin by yourself. But for the lazy readers out there, you can download it here too.
Or probably build another plugin for another JET component!

APEX 5.1 Early Adopter 2 coming

$
0
0

If you've been working with APEX 5.1 early adopter 1 (EA1) at http://apexea.oracle.com, you should have received notification from Oracle that it will be shutting down soon. As we were told when signing up, there is no way to transfer applications from EA1 into anything else, so there isn't really anything you need to do at this time. 

I'm looking forward to early adopter 2 - the interactive grid in APEX 5.1 is a big step forward. For a first impression of it, refer to my Wiki article. There are many features not part of EA1, so I'm eagerly awaiting EA2. 

How to Display a BLOB image in an APEX Report

$
0
0

Do you want to display an image on a report in APEX ?

Is the image stored as a BLOB data type in your schema or the blob is returned by some functions?

If so, then displaying the BLOB is not a simple or straight forward task.

Actually it is a simple and straight forward task, as long as you know "the trick" you need to create/defined in your APEX report.

The following steps outlines what you need to do to create a report with a BLOB images. Most of these are the standard steps, except for Step 4. That is the important one.

1. Create the Report using the APEX wizard

Create a new report. In my example here I'm going to create a classic report.

NewImage Enter a title for the report, and accept the default settings NewImage

Create as new navigation menu entry

NewImage

2. Define the Table or Query for the Report

Select the table or view that contains the data or define the SQL Query to return the results. It might be best to select this later option as it will make things clearer and easier to change in Step 4.

NewImage

Click next on the next 2 screens of the wizard and then click the Create button.

3. Set the BLOB attribute settings

When you run the report you will get something like the following being displayed. As you can see it clearly does not display the BLOB image.

NewImage

Next we need to setup the BLOB attribute settings. As shown in the following.

Screenshot 2016 08 26 13 59 30

When we run the report now, we now get an error message.

NewImage

4. Change the report query to return the length of the BLOB

Now this is the magic bit.

To get the image to display you need to go back to the Report level and change the query in the SQL Query box, to contain function below that get the length of the image in the BLOB attribute, dbms_lob.getlength() (in my example this attribute is call IMAGE)


select ID,
dbms_lob.getlength(image) image
from V_DOCUMENT_TM_IMAGE
Screenshot 2016 08 26 14 07 59

5. The BLOB object now appears :-)

That's it. Now when you run your report the image will be displayed.

NewImage

So now you know how to display a BLOB image in an APEX Report.

(Thanks to Roel and Joel for the help in working out how to do this)

Lista Estática en APEX con Imagen Personalizada

$
0
0

Hace unos días me hicieron la siguiente consulta, si se podía colocar imágenes personalizadas en lugar de iconos para nuestras listas en Apex.

Para contestar esta pregunta he querido hacer este demo y que de ese modo puedan aprender como poder colocar sus propias imágenes en las Listas de su aplicación.

Ante todo quiero mencionar que el Tema Universal trabaja con Font Awesome esa es la librería de iconos que está disponible cuando se carga Oracle Application Express.

Primero de todo vamos a crear una lista estática que la llamaremos por ejemplo: “Lista con Imágenes”, en Componentes Compartidos que tenga las siguientes entradas: APEX, MySQL, PL/SQL, SQL, BI.

Posteriormente vamos a cargar las imágenes personalizadas que queremos colocar en nuestra lista, yo he creado cada imagen con un tamaño de 50px de ancho y 50px de alto.

Ingresamos a Componentes Compartidos y en la sección Archivos, seleccionamos “Archivos de Aplicación Estáticos” (podemos usar la otra opción si queremos que las imágenes estén disponibles para todas las aplicaciones del workspace, en caso contrario, usamos la opción mencionada).

Ahora viene la parte interesante :)

Necesitamos editar el template de Lista que vamos a usar, para ello primero hacemos una copia del template original y le colocamos un nombre, en este ejemplo voy a trabajar con el template Media List.

En Componentes Compartidos, vamos a la sección Interfaz de Usuario --> Plantillas:

Se abre la lista de plantillas disponibles del Tema Universal, buscamos la plantilla Media List y realizamos una copia del mismo colocando el nombre Media List with Image.

En el recuadro verde vemos la plantilla original y en el recuadro rojo la copia de la plantilla.

Hacemos clic en el enlace Media List with Image para editar la plantilla:

En la sección Plantilla de Lista Actual, necesitamos reemplazar la etiqueta <span></span> por la etiqueta <img/>

Buscamos el siguiente código:

<span class="t-Icon #ICON_CSS_CLASSES#" #IMAGE_ATTR#></span>

Y lo reemplazamos por:

<img src="#IMAGE#" #IMAGE_ATTR#/>


De igual manera lo hacemos para la sección de “Plantilla de Lista No Actual” y guardamos los cambios.

Regresamos a Componentes Compartidos y seleccionamos la Lista Estática que hemos creado para editarla, para ello hacemos clic en el primer elemento APEX.

En la casilla Imagen/Clase ingresamos: #APP_IMAGES#mi-imagen.jpg

Donde mi-imagen.jpg es la imagen que nosotros queremos asignarle a este elemento, en mi caso es: apex-50.jpg, hacemos lo mismo para cada una de las entradas de la lista:


Ahora ingresamos a una página de nuestra aplicación y creamos una región de tipo Lista y que el origen sea la lista que hemos creado “Lista con Imágenes”.

Hacemos clic en Atributos de la región de Lista y seleccionamos en Plantilla de Lista la plantilla que hemos creado llamada Media List with Image:

Guardamos los cambios y ejecutamos la página para ver los resultados:

De igual modo podemos trabajar con los demás tipos de plantillas de lista, siempre haciendo una copia para mantener el original y de ahí podemos personalizar a nuestro gusto.

Espero les sea de utilidad este artículo y nos vemos pronto!

Lista Dinámica con Imagen Personalizada en APEX 5.0

$
0
0

En esta oportunidad quiero mostrarte cómo puedes crear una lista dinámica y que use imágenes personalizadas localizadas dentro de tu espacio de trabajo.

En un anterior artículo explico cómo crear una Lista Estática con imagen personalizada. Que te servirá para cuando tienes una lista que no necesitas tener sus entradas en una tabla de tu base de datos.

Trabajaremos con las mismas imágenes del artículo anterior para este ejemplo de Lista Dinámica, teniendo las siguientes referencias:

#APP_IMAGES#apex-50.jpg

#APP_IMAGES#bi-50.jpg

#APP_IMAGES#mysql-50.jpg

#APP_IMAGES#plsql-50.png

#APP_IMAGES#sql-50.png

 

Ahora vamos a crear una tabla que tendrá la información de cada una de las entradas de la lista:

Ejecutamos el siguiente script en nuestro Taller de SQL:

CREATE TABLE "LISTA"

   ( "ID" NUMBER(8,0) NOT NULL ENABLE,

     "NOMBRE" VARCHAR2(15),

     "NOMBRE_IMG" VARCHAR2(25),

     CONSTRAINT "LISTA_PK" PRIMARY KEY ("ID")

USING INDEX ENABLE

   )

/

CREATE OR REPLACE EDITIONABLE TRIGGER "BI_LISTA"

before insert on "LISTA"              

for each row

begin  

if :NEW."ID" is null then

   select "LISTA_SEQ".nextval into :NEW."ID" from sys.dual;

end if;

end;

/

ALTER TRIGGER "BI_LISTA" ENABLE

/

Cargamos cada registro como se ve en la siguiente imagen:

 

Tener especial cuidado de colocar el nombre de la imagen en la columna NOMBRE_IMG sin espacios ni adelante ni atrás. Los nombres son exactamente el mismo nombre utilizado en las referencias de imágenes de nuestro espacio de trabajo.

Lo siguiente que vamos a hacer es crear una copia de la plantilla Media List.

Desde Componentes compartidos vamos a la sección Interfaz de Usuario y hacemos clic en Plantillas, buscamos la plantilla Media List y realizamos una copia que la llamaremos Media Dynamic List with Image.

Podemos ver recuadrado en rojo la copia de la plantilla; recuadrado en verde la plantilla original y recuadrado en celeste la plantilla que trabajamos en el artículo de Lista Estática.

Hacemos clic en el enlace del nombre de la plantilla Media Dynamic List with Image para editarla:

En la sección Plantilla de Lista Actual reemplazamos el siguiente código:

<span class="t-Icon #ICON_CSS_CLASSES#" #IMAGE_ATTR#></span>

Por este otro código:

<img src="#APP_IMAGES##IMAGE#" #IMAGE_ATTR#/>

Estamos agregando el path de la ubicación de nuestras imágenes usando la variable de sustitución de la referencia, que en este caso es #APP_IMAGES# y luego añadimos la variable #IMAGE# el cual alberga el nombre de la imagen guardada en la tabla Lista.

Hacemos lo mismo para la sección Plantilla de Lista No Actual.

Guardamos los cambios.

Como siguiente paso vamos a crear una lista dinámica, desde componentes compartidos ingresamos a la sección Navegación y hacemos clic en Listas.

  1. Hacemos clic en el botón Crear
  2. Crear Lista: Nuevo
  3. Clic en Siguiente
  4. Nombre: Lista Dinámica con Imágenes
  5. Tipo: Dinámico
  6. Clic en Siguiente
  7. Consultar Tipo de Origen: Consulta SQL
  8. Consulta SQL:

SELECT

null lvl,

nombre label,

null targetvalue,

null is_current,

nombre_img imagevalue,

null imageattributevalue,

null imagealtvalue_alt,

null a01,

null a02,

null a03,

null a04

FROM

lista

ORDER BY 2

  1. Clic en Siguiente
  2. Clic en Crear

Nota: Si quieres conocer la sintaxis de la lista dinámica, puedes ver este artículo en el cual hago referencia a la misma cuando personalizamos la plantilla Cards y hacemos uso de los atributos adicionales de la plantilla el cual los cargamos en la tabla demo.

Cabe aclarar que en este ejemplo no estoy usando los atributos adiciones A01, A02, A03 y A04 que viene con la plantilla, nosotros podemos cargar esa información como columnas en la tabla si quisiéramos usarlo, como dije antes en este caso los valores son Null.

Finalmente vamos a crear una región de tipo Lista en nuestra página de Apex el cual le asignaremos la plantilla que hemos creado:

Hacemos clic en Atributos de la región de Lista para asignarle la plantilla que hemos creado Media Dynamic List with Image y en opciones de la plantilla seleccionamos span Horizontal:

Guardamos los cambios.

Ejecutamos la página para ver los resultados, en la parte superior esta la región con la lista estática que trabajamos en este artículo y en la parte inferior se muestra la lista dinámica ordenada por nombre.

De esta forma podemos incorporar nuestras propias imágenes para que se muestren en nuestras listas, tanto sea Estáticas como Dinámicas.

Espero te haya gustado este articulo y nos vemos pronto!!!

APEX 5.2 Early Adopter 2 is available

$
0
0

Oracle has quietly rolled out the APEX 5.1 early adopter 2 (EA2) on http://apexea.oracle.com. If you sign up today, you will get an APEX 5.1 EA2 workspace. 

Comparing the long list of missing features in EA1 with EA2, you can see that Oracle is much closer to being ready. The Interactive Grid is one of the main new features, and the list of missing functionality in EA1 contained 40 items, but in EA2, that list has been reduced to 8 items. 

Things that now work include

  • Dynamic Actions
  • Cascading LOVs
  • Computations
  • Control Breaks
  • Sort dialog

This makes it possible to start to get a real impression of what Interactive Grids can do for you.

The few features still listed as missing from Interactive Grid are:

  • Highlighting Dialog is functional but no rows or cells will be highlighted.
  • Edit: Submit Includes Selected Rows
  • Performance: Requires Filter
  • Pagination: Type option None - is not functioning correctly
  • Icon View: Icon Type - Does not support BLOB based icons
  • Column Filter: Required
  • Security: Restricted Characters
  • Some of these things only apply when the grid is editable but they are always shown: Width, Value Placeholder, Height

The full list of missing features and known issues can be found here

Oracle asks you to test it out and submit your feedback.


Cómo colocar Logo y Texto en simultaneo en nuestras aplicaciones en APEX 5.0

$
0
0

En este artículo sencillo te maestro cómo puedes colocar el logo y un texto al lado del logo en nuestras aplicaciones en Oracle APEX 5.0.

Si recuerdas, en la página de inicio de nuestra aplicación, tenemos el botón “Editar Propiedades de Aplicación” y en la ficha “Interfaz de Usuario” podemos seleccionar en la sección de Logotipo si queremos que el logo sea de tipo Imagen o de tipo Texto.

Lo que vamos a hacer es que podamos mostrar los dos simultáneamente usando estilos CSS.

Primero de todo necesitamos crear nuestro logo teniendo en cuenta que debería estar con un fondo transparente, como lo vemos en la siguiente imagen:

La parte gris cuadriculada es el fondo transparente donde se inserta por encima el logo que tenemos creado.

Luego cargamos el log en nuestro espacio de trabajo, (debemos mantener la extensión png para que mantenga la transparencia).

La referencia que en mi caso obtengo es: #WORKSPACE_IMAGES#mi-logo-demo.png

Volvemos a la sección del Logotipo de nuestra aplicación:

Tipo de Logotipo: Texto

Logotipo: Mi Aplicación Demo

Atributos de Logotipo: style="display: block; margin-left: -12px; padding-left: 122px; background: url(#WORKSPACE_IMAGES#mi-logo-demo.png) -16px -16px no-repeat; background-size: 142px;"

Aplicamos los cambios.

Lógicamente que el CSS que tendrás que hacer para tu propio logo puede que tengas que adaptarlo del que te presento aquí.

El resultado es este:

De este modo podemos mostrar el logo de nuestra aplicación y además el título de la misma.

Hasta Pronto!

Ultimo día el 10 de Octubre para enviar tu propuesta para el Oracle Developer Tour 2016 - ODT!

$
0
0

SI quieres presentar en el ODT Latam 2016 no te pierdas la oportunidad y envía hoy mismo tus propuestas para ser speaker!!!

participarán los siguientes paices: Argentina, Brasil, México, Colombia, Guatemala, Costa Rica, Panamá.

Te dejo aqui el link: Call For Papers

Para aprender mucho sobre el desarrollo con Bases de Datos Oracle.

Favicon Personalizado para nuestras Aplicaciones en APEX 5.0

$
0
0

Si queremos personalizar aún más nuestras aplicaciones, en este artículo te muestro cómo puedes personalizar el favicon de tu aplicación.

Primero de todo el favicon es la pequeña imagen que se muestra en el título de la ventana de nuestro navegador web.

Si tenemos una nueva aplicación hecha veremos el favicon por defecto:

Y si abrimos una aplicación del paquete de aplicaciones podemos ver que todas ellas tienen su favicon asignado:

Ante todo necesitamos tener un favicon para nuestra aplicación, aquí te dejo un sitio web que te permite crear favicon a partir de una imagen: Favicon Generator

Yo tengo generado para este ejemplo el siguiente favicon:

Nombre: my-favicon.ico

Tamaño: 16x16

Necesitamos subir el favicon a nuestro web server o en mi caso lo subiré a “Archivos de Aplicación Estáticos”:

Referencia: #APP_IMAGES#my-favicon.ico

A continuación vamos a Componentes Compartidos y seleccionamos en la sección de “Lógica de la Aplicación” el primer enlace “Atributos de Definición de Aplicación”.

Nos dirigimos a la ficha sustituciones y agregamos la siguiente variable de sustitución:

CADENA DE SUSTITUCION: APP_FAVICONS

VALOR DE SUSTITUCION: <link rel="icon" sizes="16x16" href="#APP_IMAGES#my-favicon.ico">

Guardamos los cambios.

Ejecutamos la aplicación y podemos ver que nuestra aplicación ya muestra nuestro favicon personalizado:

Nota: Según parece que en la versión de Apex 5.1 se tiene planeado tener esta característica como un atributo declarativo en la Interfaz de Usuario, eso sería genial!

Algo que tenemos que tener en cuenta que el template de la página esté usando la variable de sustitución, si vemos en Templates y buscamos la plantilla activa de tipo página, en mi caso la de tipo Standard y la abrimos para editarla, podemos ver su código HTML y que arriba de la etiqueta </head> está la variable de sustitución #FAVICONS# junto con otras variables de sustitución.

De esta forma muy sencilla podemos ir personalizando cada vez más nuestras aplicaciones en APEX. Si quieres saber cómo personalizar la página de login de Apex te dejo este otro artículo que escribí sobre el tema.

Hasta pronto!

Maximum Achievable Benefit

$
0
0

Because I am an expert on Oracle development tools, I'm often asked for advice on technology migration projects, typically from Oracle Forms. Most of these projects originate in the IT department, and they often fail the simple test of business justification. Simply: Does the benefit justify the cost?

The maximum achievable benefit is limited by the difference between the current technology and the proposed new one.

Changing your application from Oracle Forms to Oracle APEX has a short technology distance: From one PL/SQL based, data-driven monolithic application to another. The only difference is that APEX will run in a browser without the Java plugin, for example in mobile. Because the technology distance is short, things can't change much and you can't justify much cost.

Changing your application from Oracle Forms to Oracle ADF has a longer technology distance: From a PL/SQL based, data-driven monolithic application to a Java-based, UI-driven, modular architecture. The technology distance is much greater, meaning that you can do completely different things with an ADF application than a Forms application. The potential upside is much greater. Whether you are able to realize it is a different matter.

On the importance of keeping algorithmic logic separate from display logic

$
0
0
On the PL/SQL Challenge, all times are shown in the UTC timezone. Weekly quizzes end on Friday, midnight UTC. So I recently decided that when I display the time that the quiz starts and ends, I should add the string "UTC".

Our quiz website is built in Oracle Application Express 5.0, so I opened up the process that gets the date and found this:

DECLARE
l_play_date DATE
:= qdb_quiz_mgr.date_for_question_usage (:p46_question_id);
BEGIN
:p46_scheduled_to_play_on := TO_CHAR (l_play_date, 'YYYY-MM-DD HH24:MI');

"OK, then," says Steven the Fantastic Developer to himself. "I know exactly what to do."

And I did it:

DECLARE
l_play_date DATE
:= qdb_quiz_mgr.date_for_question_usage (:p46_question_id);
BEGIN
:p46_scheduled_to_play_on :=
TO_CHAR (l_play_date, 'YYYY-MM-DD HH24:MI')
|| ' UTC';

Ah, PL/SQL and APEX - so easy to use! :-)

Now, there are lots of things you could say about the change I made above, but here's one thing that is undeniably true:
P46_SCHEDULED_TO_PLAY_ON will never by NULL.
Right? Right. Of course, right.

So that's fine, though. Because that's what I wanted: to have "UTC" always show up, and there's always going to be a date when the question is used in a quiz, right?

Well, no. In fact, this code is part of our Quiz Editor page, and on that page we offer a button that allows you to easily and quickly schedule a quiz for play.

But only if it hasn't already been scheduled. If it hasn't already been scheduled, then the date is, oh wait, um, NULL.

And that's why we have a condition on that button:

Applications > 10001 - Oracle Dev Gym > Lists > Quiz Editor Actions > Entries > Schedule
AttributeCondition Expression1 (Specifies an expression based on the specific condition type selected.)
Value
:P46_SCHEDULED_TO_PLAY_ON IS NULL
AND
NVL (:P46_IS_TEMPLATE, 'N') = 'N'

And that's why Eli Feuerstein, the fine fellow who does most of the work on the PL/SQL Challenge and it's cool new sister, Oracle Dev Gym, reported an issue with this page:
The Schedule button never appears on the page!
Awwwwwwwwwww......

So two lessons learned (re-learned, and learned again, then forgotten, then re-learned, then learned again....):

1. When I am about to make a change, ask myself: "What impact might this have?" 

In the world of APEX, it's pretty easy: search for the string "P46_SCHEDULED_TO_PLAY_ON" and see how it is used in the application. 

2. Keep completely separate the data (in this case, APEX items) that is used for algorithmic logic and the data that is used for display purposes.

I could create a separate item for display purposes, or a different item to be used in conditions and other PL/SQL blocks. 

But I should not use the same item for both.

FullCalendar y Vertical Scrollbar en Oracle APEX 5.0

$
0
0

En este artículo quiero contestar una duda que me han realizado y aprovecho para compartirlo con todos.

Me han preguntado cómo se puede deshabilitar el scrollbar en el Calendario.

Cuando queremos modificar propiedades del calendario podemos encontrar información muy útil en la documentación de FullCalendar el cual se basa el calendario de APEX.

Para este ejemplo podemos usar el calendario que hemos creado anteriormente un éste artículo.

Lo único que he eliminado de la página fue la región de la Ruta de navegación, de este modo tenemos nuestro calendario de esta forma:

Como podemos ver, el calendario se ajusta al tamaño de la página, ahora bien, que pasaría si necesitamos colocar el calendario en una región definida y que abarque por ejemplo un poco más de la mitad de nuestra página.

Para ver esto que digo vamos a crear un div que contenga el calendario, para ello primero de todo vamos a asignar el nombre al Identificador Estático de la Región del Calendario:

Identificador Estático = micalendario


Seleccionamos el nombre de la Página y en el panel de propiedades ingresamos en los CSS En Línea lo siguiente:

#micalendario {

width: 60%;

}

Guardamos y ejecutamos. Podemos ver que el Calendario se encuentra en un contenedor div que le hemos asignado que tenga un ancho de 60%, ahora sí podemos ver la barra de desplazamiento vertical, ya que en ese contendor no se visualiza todo el calendario.

En la imagen de abajo podemos ver la barra de desplazamiento de la región del Calendario (en rojo) y la barra de desplazamiento de la página (en verde).

Para que nuestro calendario se muestre completo en nuestra región, necesitamos colocar este código en la sección de JavaScript:

Ejecutar Cuando Se Carga la Página:

$("#<static_id>_calendar").fullCalendar('option','height','auto');

En nuestro caso reemplazamos el static_id con nuestro identificador estático:

$("#micalendario_calendar").fullCalendar('option','height','auto');

En la opción auto podemos ingresar también un valor fijo como por ejemplo 700.

De este modo cuando ejecutamos la página, podemos ver que la región del calendario se ajusta a la visualización de todo el mes.

Dependiendo la resolución de la pantalla o del dispositivos que estamos usando para ver la página puede pasar que se vea o no la barra de desplazamiento vertical de la página.

Si por alguna razón quisiéramos deshabilitar esta barra de desplazamiento vertical de la página, simplemente ingresamos al nombre de la página y en la sección de CSS En Línea colocamos la siguiente regla CSS:

#t_PageBody {

   overflow: hidden;

}

Y de ese modo desaparece dicha barra de la página. Ahora bien, es muy importante destacar que si achicamos la ventana o si se visualiza en diferentes resoluciones, no vamos a poder ver toda la información de la página porque tendríamos deshabilitada la barra de desplazamiento vertical de la página.

Cómo establecer un ancho de columna fijo en un Informe Interactivo en APEX 5

$
0
0

Si bien esto parece ser algo sencillo, es algo que habitualmente me preguntan, es por ello que he decidido escribir sobre este tema.

En Apex 5 podemos hacer uso del Identificador Estático de la columna del Informe Interactivo (IR) para indicarle el ancho fijo de la columna con CSS.

Por ejemplo tenemos un IR de una tabla, el cual tiene un campo con mucho texto, como vemos en la siguiente imagen:

Si nosotros quisiéramos que la columna de Observaciones tenga un ancho fijo más pequeño que el que está usando ahora, necesitamos primero colocar el Identificador Estático en la columna: observaciones


Colocamos la siguiente regla de CSS en propiedades de la página:

CSS --- En Línea:

th#observaciones,td[headers="observaciones"] {

   width: 30%;

}

En la cual estamos indicando que tanto el encabezado (th = es una celda que agrega negrita al texto contenido) como las celdas de la columna (td = es una celda normal que no modifica el texto contenido) tengan un ancho de 30%.

Para que quede más claro, veamos un ejemplo de una tabla HTML en el cual usamos las celdas th para las cabeceras y las celdas td para el resto de las celdas. Cada fila tr contiene varias celdas td que representan las columnas.

<HTML>
<HEAD>
<TITLE>Tablas HTML</TITLE>
</HEAD>
<BODY>

<H1>Mi Ejemplo</H1>

<TABLE BORDER="1">
<TR>
   <TH>Encabezado 1</TH>
   <TH>Encabezado 2</TH>
   <TH>Encabezado 3</TH>
</TR>
<TR>
   <TD>Dato A</TD>
   <TD>Dato B</TD>
   <TD>Dato C</TD>
</TR>
<TR>
   <TD>Dato D</TD>
   <TD>Dato E</TD>
   <TD>Dato F</TD>
</TR>
</TABLE>

</BODY>
</HTML>


Ahora bien si tenemos más de un informe interactivo en la página necesitamos colocar también el Identificador Estático del IR en el CSS, si por ejemplo lo llamamos IRID nuestra CSS sería:

#IRID th#observaciones,

#IRID td[headers=observaciones]{

width:30%

}

De ese modo podemos determinar el ancho fijo para cada columna que necesitemos.

Cabe aclarar que podemos usar cualquier unidad, ya sea píxeles, ems y porcentajes.

Además de las propiedades height y width, disponemos de las propiedades min-width / min-height y max-width / max-height que representan el mínimo y máximo. Es muy conveniente el uso de estas propiedades cuando se quiere hacer un diseño responsive y que se adapte a los dispositivos móviles. La única consideración es que estas propiedades no están soportadas en IE 7 y 6.

 


Sitios Web desarrollados con Oracle Application Express

$
0
0

Hola a todos!

Quiero compartir este sitio web que recopila todos los sitios web desarrollados en Oracle Application Express.

Ingresar al Sitio Web

Podemos ver en su página de inicio un listado en forma de galería de todas las aplicación que han sido enviadas, en la cual con alegría quiero contarles que estan publicadas dos de mis aplicaciones desarrolladas en APEX, una es la demo de los ejemplos de APEX y la otra es una aplicación cerrada que he desarrollado para recopilar la información del Oracle Developer Tour Latinoamérica 2016 que ha sido un evento en el que participaron 7 países de latinoamérica.

Si teines una aplicación desarrollada en APEX en la nube y la quieres compartir con la comunidad y el mundo puedes enviar la información haciendo clic en el menú "Suggest a site" y se abrirá una ventana modal que te permitirá ingresar la información de tu aplicación.

Lo interesante de este sitio web es que te muestra en que versión de APEX está desarrollado el sitio web o la aplicación y si se dispone de las credenciales de acceso o si la aplicación es pública.

Para todos los que trabajamos con Application Express es muy gratificante ver cómo cada vez mas empresas y desarrolladores utilizan Application Express para sus proyectos!!!

Si tienes un proyecto en APEX puedes compartirlo con la comunidad, haciendo uso de este sitio web!

apex.oracle.com será actualizado a la versión de Application Express 5.1 el día de hoy, 16 de Diciembre del 2016

$
0
0

Una gran noticia tenemos para contarte, a partir de hoy, Viernes 16 de diciembre de 2016, la instancia de evaluación de Oracle Application Express en https://apex.oracle.com se actualizará a una versión preliminar de Oracle Application Express 5.1.

Aqui les dejo el post que escribió Joel Kallman sobre la secuencia de la actualización:

One of the features of Oracle Application Express 5.1 is a "reduced downtime upgrade" (thanks to Christian Neumueller-Oracle).  This upgrade will happen in multiple phases:

Phase 1 (beginning at 0600 EST, 1100 UTC):  Installation of APEX 5.1 software with translations.  This won't be visible to end users

    1. Phase 2 (beginning at roughly 0800 EST, 1300 UTC):  Migration begins.  All APEX applications will continue to run, but you will not be able to change any application definitions or underlying APEX metadata (including saved Interactive Reports).
    2. Phase 3 (beginning at 2100 EST, 0200 UTC):  Complete outage.  https://apex.oracle.com will not be accessible.
    3. Phase 4 (estimated between 2200 EST and 2300 EST, 0300 UTC and 0400 UTC):  https://apex.oracle.com will be fully accessible again.  Non-critical log information will be migrated forward to APEX 5.1, but in the background.

Beginning Thursday evening EST, December 15, 2016, you will not be able to request or provision new workspaces on apex.oracle.com, until the upgrade to APEX 5.1 is complete.

A esperar ansiosamente todo lo que la versión preliminar 5.1 de APEX tiene para mostrarnos!!!

APEX 5.1 ahora está disponible en apex.oracle.com!

$
0
0

Desde ayer 16 de Diciembre, la instancia de prueba de apex.oracle.com ya está disponible la versión de APEX 5.1 para que empecemos a probarla y maravillarnos con las nuevas funcionalidades que trae esta nueva versión.

A lo largo de los siguientes días estaré presentando diferentes artículos donde iremos navegando y aprendiendo lo nuevo que APEX nos trae en esta versión.

Como por ejemplo el informe de Tipo Grilla que es la combinación de un Informe Interactivo con un Informe de tipo Pantalla Tabular, además veremos las nuevas características del tema Universal como la nueva forma de visualización de datos basado en Oracle JET.

Si aún no tienes un Espacio de Trabajo de APEX para probar todo lo nuevo y aprender a realizar aplicaciones web para la base de datos Oracle en forma muy rápida y moderna, no esperes más y visita apex.oracle.com y solicita allí un Espacio de Trabajo GRATIS!

Desde ya te cuento que ahora disponemos de más estilos de colores en el tema Universal, como por ejemplo ahora podemos tener nuestra aplicación con el estilo rojo que a mi tanto me gusta :).

Preparémonos para el nuevo año y sigamos aprendiendo con esta herramienta tan fácil de usar y que nos permite crear aplicaciones realmente robustas!!! Me encanta APEX y a ti?

Nuevas mejoras en el uso del elemento de tipo "Explorador de Archivos..." en Oracle APEX 5.1

$
0
0

En la versión de Oracle APEX 5.0 en la sección de configuración del ítem teníamos estas opciones:

  • Tipo de Almacenamiento:
    • Table APEX_APPLICATION_TEMP_FILES: Almacena los archivos cargados en una ubicación temporal a la que puede acceder con la vista APEX_APPLICATION_TEMP_FILES. Application Express eliminará automáticamente los archivos al final de la sesión o al final de la solicitud de subida, dependiendo de lo que seleccionemos en “Depurar Archivo en”.
    • BLOB column specified in ítem Source attribute: almacena el archivo cargado en la tabla utilizada por el proceso Procesamiento Automático de Filas (DML) y la columna especificada en el atributo fuente del elemento. La columna debe ser del tipo de datos BLOB. Si se descarga el archivo, se utiliza el nombre de tabla del proceso de búsqueda automática de filas.
  • Depurar Archivo en:
    • End of Session
    • End of Request

Ahora en la versión de APEX 5.1 tenemos varias mejoras en el uso del elemento “Explorador de Archivos…” como la posibilidad de:

  • Permitir Múltiples Archivos: SI / NO
  • Tipos de Archivos: (Aquí colocamos la extensión de los archivos permitidos por ejemplo: image/png,application/pdf

De esta forma podemos configurar fácilmente nuestro elemento de tipo Explorador de Archivos.

Si quieres conocer cómo funciona este elemento te aconsejo que descargues la app de ejemplo “Sample File Upload and Download” de las aplicaciones empaquetadas y aprendas cómo implementar éste elemento en tus aplicaciones desarroladas con APEX.

Hasta Pronto!

Acaba de salir la nueva directiva para APEX 5.2!!!

$
0
0
David Peake, Product Manager de Application Express compartió la nueva directiva para Apex 5.2.
Estas serán serán las mejoras que se realizarán!!!

Oracle Application Express 5.2

Oracle Application Express 5.2 will focus on both new features and enhancements to existing functionality, and is planned to incorporate the following:
  • Remote SQL Data Access ‐ Extend common components such as Interactive Grids, Classic Reports and Charts to interface with data stored in remote databases using ORDS and REST.
  • REST Service Consumption ‐ Provide declarative methods to define references to external REST APIs and generic JSON data feeds and to use these references as data sources for Interactive Grids, Reports and Forms.
  • Declarative App Features ‐ Introduce a new Create App Wizard that allows for adding components and app features to new and existing applications.
  • Interactive Grid enhancements ‐ Add additional reporting capabilities such as Group-By and Pivot, support for subscriptions and computations, flexible row height and general UI improvements.
  • Page Designer ‐ Provide client-side wizards for the creation of more complex components like Dynamic Actions, Forms and Shared Components, User interface improvements.
  • Upgrade Oracle JET and jQuery ‐ Adopt the most recent versions of the integrated JavaScript libraries to take advantage of new Data Visualizations such as Gantt charts and new Form widgets and controls.
  • New REST Workshop ‐ Provide declarative methods to support the development of ORDS enabled REST web services, taking advantage of the latest features and functionality of ORDS.
  • Packaged Applications ‐ Improved framework and enhancements to the packaged applications.

Para descargar la directiva lo puedes hacer desde este link.

Viewing all 142 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>