Bueno, para aclarar mejor el procedimiento de instalación, he creado un
video que a la vez tiene la instalación de Oracle Data Base Express
Edition 11g y APEX 5.1.1 Oracle Application Express usando Embedded
PL/SQL Gateway.
Sin más, les dejo el link del video y el link de los
pasos de instalación.
En este post veremos la forma en como usar leaftlet (mapas) usando APEX ORACLE, y adicionalmente agregaremos la funcionalidad de obtener nuestra obicacion actual.
Pudes ver la demo en este link:
usuario: demo / pass: demo
Herramientas:
1.- Librerias de LeafLet , sitio principal aqui.
2.- JavaScript
3.- Apex Oracle
4.- Un poco de Css
5.-Permisos de navegador para usar la geolocalizacion , usar HTTPS
Procedimiento:
Primero crearemos haremos la declaracion de las variables que usa leaflet.
declare
l_xml clob;
l_blob blob;
l_lang_context integer :=DBMS_LOB.DEFAULT_LANG_CTX;
l_warning integer :=DBMS_LOB.WARN_INCONVERTIBLE_CHAR;
l_dest_offset integer :=1;
l_source_offset integer :=1;
l_name varchar2(250);
begindbms_lob.createtemporary(l_blob, true);
beginSelect FILE_BLOB,FILENAME
into l_blob,l_name
from BLOG_FILES
where rownum =1;
exception when others then RETURN;
--apex_application.stop_apex_engine; --owa_util.http_header_close;
end;
/*if l_blob is null then return; end if;*/htp.init;
-- Set the MIME typebranckowa_util.mime_header( 'application/octet-stream', FALSE,'UTF-8' );
-- Set the name of the file htp.p('Content-Disposition: attachment; filename="'||l_name||'"');
owa_util.http_header_close;
--package that provides an interface to download files (BLOBs and BFILEs)wpg_docload.download_file( l_blob );
--stop further processing and immediately exitapex_application.stop_apex_engine;
exception when others then
htp.prn('error: '||sqlerrm);
apex_application.stop_apex_engine;
end;
Paso 2 crear un boton en la misma pagina con un submit y un request "DOWNLOAD" el mismo que sera usado como server side condition por el proceso afterHeader.
Este ejemplo es muy util cuando tu necesitas trabajar con imagenes que se refresquen en cada momento.
Con este material puedes aplicar diferentes cambios de CSS para agrandar imagenes, poner etiquetas, cambiar el estilo de carrusel.
Este ejemplo esta basado en este original post, pero aqui he cambiado la forma para hacerlo mas dinamico y adicionalmente agrege una funcionalidad para que se pueda hacer el efecto de zoom en la imagen.
JQUERY / jcarousellite de su fuente original o puedes descargar directamente desde aqui here.
Ajax CallBack
JavaScript
Primero necesitamos descargar el plugin y subirlo en los archivos estaticos, necesitamos el que dice jcarouselLite.min.js , puedes descargar las flechas desde aqui tambien.
Crear un ItemGlobal de nombre: G_ID_FILE , cuidado con la sesion state
Crear un application processes de nombre : GET_IMG , pon este codigo, en el select cambialo por tu tabla de donde sacaras la imagen.
Crear un region estandar con ID, header y footer como la imagen.
Crear un boton que llame una accion dinamica y luego un javaScriptCode, aqui esta la diferencia del origal post donde ellos usan un PlSql dynamic content. Pero aqui usare ajax para llamar al proceso que creare las veces que necesite.
Note: "Refresh_image" es el nombre del proceso ajaxCallBack
#carousel-container es el id, de tu region que creamos un paso anterior
Console y alert, son solo de forma de prueba.
1: Download apex 5.1.1 from Oracle
2: Copy and compress the content in a directory easy access, for example D:\InstallApex
3: Open CMD and go for this directory and write SQLPLUS
4: Loged with "sys as sysdba", enter your password and continue...
5: Run apexins.sql
@apexins.sql APEX APEX TEMP /i/
or @apexins.sql SYSAUX SYSAUX TEMP /i/
6: Once complete, change the admin password by running the "apxchpwd.sql" scripts as the SYS user.
@apxchpwd.sql
7: Create the APEX_LISTENER and APEX_REST_PUBLIC_USER users by running the "apex_rest_config.sql" script.
@apex_rest_config.sql
8: Run the Embedded PL/SQL Gateway configuration (EPG)
@apex_epg_config.sql D:\InstallApex
Note: You can try add "\" or erase it , The command automatically recognize the APEX main folder
9: Update APEX directory images with those from the new release, it could take a lot of minutes:
@apxldimg.sql D:\InstallApex
10: Unlock the ANONYMOUS account.
ALTER USER ANONYMOUS ACCOUNT UNLOCK;
Note: Make sure that the following accounts are unlocked
ALTER USER xdb ACCOUNT UNLOCK;
ALTER USER apex_public_user ACCOUNT UNLOCK;
ALTER USER flows_files ACCOUNT UNLOCK;
11: Aditional Config:
11.1 Open XML DB Protocol Server.
EXEC DBMS_XDB.sethttpport(8080);
11.2 Update quantity of process
SHOW PARAMETER job_queue_processes ALTER system SET job_queue_processes=20 scope=both; SHOW PARAMETER shared_servers ALTER system SET shared_servers=5 scope=both; 11.3 Enable remote HTTP connections (optional):
DECLARE ACL_PATH VARCHAR2(4000); BEGIN -- Look for the ACL currently assigned to 'localhost' and give APEX_050100 -- the "connect" privilege if APEX_050100 does not have the privilege yet. SELECT ACL INTO ACL_PATH FROM DBA_NETWORK_ACLS WHERE HOST = 'localhost' AND LOWER_PORT IS NULL AND UPPER_PORT IS NULL; IF DBMS_NETWORK_ACL_ADMIN.CHECK_PRIVILEGE(ACL_PATH, 'APEX_050100', 'connect') IS NULL THEN DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE(ACL_PATH, 'APEX_050100', TRUE, 'connect'); END IF; EXCEPTION -- When no ACL has been assigned to 'localhost'. WHEN NO_DATA_FOUND THEN DBMS_NETWORK_ACL_ADMIN.CREATE_ACL('local-access-users.xml', 'ACL that lets users to connect to localhost', 'APEX_050100', TRUE, 'connect'); DBMS_NETWORK_ACL_ADMIN.ASSIGN_ACL('local-access-users.xml','localhost'); END; / COMMIT;
14: For the first installation you need create a new schema and workspace. for this you can log in as ADMIN.
Ing. Angel O. Flores Torres, soy Ingeniero de Sistemas e Ingeniero de Aplicaciones Oracle APEX, he trabajado con Oracle APEX desde el 2017, 5x, 18x, 20x En los ultimos años he desarrollado habilidades en CSS, JavaScript, Jquery y PlSql
, I specialize in Oracle APEX (Oracle Application Express )