Browsing "Older Posts"

Browsing Category "Tools"

Importing XML file with invalid character 22 (U+0016)

Von Tobias Arnhold → 1.15.2016
I have to import a set of XML files from time to time. Most of those XML files can be imported with out any problems. But at least one file includes a special character U+0016 which occurs randomly some where inside the file.

When I try to import that file I get this ORA- error message:
ORA-31011: XML-Parsing nicht erfolgreich
ORA-19202: Fehler bei XML-Verarbeitung
LPX-00217: Ungültiges Zeichen 22 (U+0016)
Error at line 39409 aufgetreten

Oracle JET Charts - Do we need alternatives anymore?

Von Tobias Arnhold → 11.11.2015
After I looked through the chart types supported by the new Oracle JET framework I asked myself if we need other chart plugins like D3JS or RaphaelJS in future APEX releases anymore?

The answer is: Yes in special cases.

My supposition is that we can use all available JET charts in one of the next versions of Oracle APEX.

Now I will describe the "special case" with two examples where other charting frameworks still make sense:

Was ist Oracle JET

Von Tobias Arnhold → 11.03.2015
Oracle JET ist das neueste Oracle Development Werkzeug mit dem Ziel moderne Webapplikationen auf Basis von Javascript zu bauen.

Die Grundlage dafür bildet ein eigens dafür entwickeltes JavaScript Development Framework das zusätzlich um mehrere mehr oder weniger bekannte OpenSource JS Frameworks (jQuery, RequireJS, Knockout und weitere) erweitert wurde.

Witzigerweise scheint Oracle JET nicht allein zu sein, denn die Abkürzung bezeichnet innerhalb des Oracle Toolsets zwei unterschiedliche Technologien.
Das neue Oracle JET (JavaScript Extension Toolkit) und das bestehende technisch komplett andere Oracle JET (Jumpstart Enterprise Toolkit).
Imho: Etwas unglücklich gelöst, da dadurch sehr viel Konfusion erzeugt wird. :)

Die JET Technologie richtet sich an erfahrene WEB Anwendungsentwickler die Erfahrung in Javascript besitzen müssen.

Fragen zur Lizenzierung werden hier beantwortet: Oracle JET FAQ

Oracle JET und APEX
Soweit mir bekannt, wird Oracle JET die neue Standard Charting Engine in APEX 5.1.  Wer sehen möchte wie diese Charts in Realität ausschauen, der findet hier sein Glück: Oracle JET Data Visualizations.
Außerdem können Oracle JET Lösungen in APEX Plugins verpackt werden und wären so leicht zugänglich für APEX Entwickler.

Weiterführende Links zum Thema:
Was ist JET I
Was ist JET II
Get Started
Elemente in JET
Demo Seite
Verwendete OpenSource Engines

Ps.: Auf der DOAG habe ich bisher keine Vorträge zu gesehen. Ich denke erste Erfahrungsberichte wird es auf der APEX Connect geben.
APEX-AT-WORK no image

SQL Developer Neue Version & Hidden Features

Von Tobias Arnhold → 9.22.2014

SQL Developer a great tool but...

Von Tobias Arnhold → 8.21.2013
Actually I'm impressed from the speed (even so it is a Java based application), the easy handling and the integration into APEX.
For example remote debugging possibilities inside an APEX application: http://www.oracle.com/webfolder/technetwork/de/community/apex/tipps/remote-debug/index.html

Currently there are two things I really don't like.

Autocomplete Feature when I open a table and checking the data. 
If I click on the autocomplete it sometimes adds it at the end of my text. Instead of dropping my text and replacing it with the autocompleted text.



View with Trigger
When I use a view with an InsteadOf-Trigger and later I need to update the view. With the SQL Developer View Editor actually it does delete my Trigger. Even the Fast DDL feature does not include the trigger. Hope this is fixed in the next version?
Example: http://www.apex-at-work.com/2013/03/apex-tabular-form-auf-basis-einer-view.html
My workaround is to add the Instead of Trigger as Comment behind my the sql of the view.

APEX-AT-WORK no image

Creating an ExtJS tree with PL/JSON

Von Tobias Arnhold → 2.04.2010
I searched for a smoother way building ExtJS trees in APEX and found a great post from Anja Hildebrandt: Nice trees with ExtJS (Erstellung eines ExtJS-Baums…)

She used the PL/JSON Utility from Lewis Cunningham: PL/JSON by jkrogsboell, lewiscunningham

During the time now Lewis developed a new version of the utility and Anjas code didn't work anymore. I updated her source code with the new version of PL/JSON 0.8.6.

First I show how you build JSON output with the PL/JSON scripts:
Example - ex4.sql

SQL> declare
2 obj json;
3 procedure p(v varchar2) as begin dbms_output.put_line(null);dbms_output.put_line(v); end;
4 begin
5 p('you can also put json or json_lists as values:');
6 obj := json(); --fresh json;
7 obj.put('text', 'Audi');
8 obj.put('id', 100);
9 obj.put('leaf', json_bool(true));
10 obj.put('href', 'f?p=110:1:');
11 obj.put('children', json_list('[{"text": "A4"},{"text": "A5"}]'));
12 obj.print;
13 end;
14 /


you can also put json or json_lists as values:
{
"text" : "Audi",
"id" : 100,
"leaf" : true,
"href" : "f?p=305:1:",
"children" : [{
"text" : "A4"
}, {
"text" : "A5"
}]
}

PL/SQL procedure successfully completed

PL/JSON forum example
 
SQL>
SQL> DECLARE
2 resultset json;
3 row_list json_list := json_list();
4 columns1 json;
5 num_rows number := 2;
6 columns_length number := 3;
7 procedure p(v varchar2) as begin dbms_output.put_line(null);dbms_output.put_line(v); end;
8 BEGIN
9 p('Data:');
10 FOR i IN 1 .. num_rows
11 LOOP
12 columns1 := json();
13 columns1.put('rownum', i);
14 FOR x IN 1 .. columns_length
15 LOOP
16 columns1.put('column' || x, 'Testdata');
17 END LOOP;
18 row_list.add_elem(columns1.to_anydata);
19 END LOOP;
20 resultset := json();
21 resultset.put('ResultSet', row_list);
22 resultset.print;
23 END;
24 /


Data:
{
"ResultSet" : [{
"rownum" : 1,
"column1" : "Testdata",
"column2" : "Testdata",
"column3" : "Testdata"
}, {
"rownum" : 2,
"column1" : "Testdata",
"column2" : "Testdata",
"column3" : "Testdata"
}]
}

PL/SQL procedure successfully completed

SQL>

Updated tree package of Anja

create or replace package PKG_EXTJS_JSON is

-- Author : AHILDEBRANDT
-- : TARNHOLD
-- Created : 10.08.2009
-- Updated : 04.02.2010
-- Purpose : check if category has sub-categories
function hasChildren(i_cat_id in number) return boolean;

-- Purpose : create JSON-Object for category;
-- recursive
function getJsonObject(i_cat_id in number default 0) return json;

-- Purpose : function that calls getJsonObject and returns the result as string
function getTreeDataDynamic return varchar2;

end PKG_EXTJS_JSON;

create or replace package body PKG_EXTJS_JSON is
/*
-- Author : AHILDEBRANDT
-- : TARNHOLD
-- Created : 10.08.2009
-- Updated : 04.02.2010
-- Purpose : check if category has sub-categories
*/
function hasChildren(i_cat_id in number) return boolean is
v_count number:=0;
begin
select nvl(count(*),0) into v_count from tbl_categories where c_par_id=i_cat_id and c_active = 'YES';
if v_count>0 then
return true;
else
return false;
end if;
end;

/*
-- Author : AHILDEBRANDT
-- : TARNHOLD
-- Created : 10.08.2009
-- Updated : 04.02.2010
-- Created : 10.08.2009
-- Purpose : create JSON-Object for category;
-- recursive
*/
function getJsonObject(i_cat_id in number default 0) return json is
v_json json:=json();
v_row_list json_list := json_list();
v_arr_id NUMBER;
v_ele_id NUMBER;
begin

if i_cat_id = 1 then -- if category is root then set root-node
v_json.put(pair_name => 'id', pair_value => i_cat_id);
v_json.put(pair_name => 'text', pair_value => 'Root');
else -- else --> usual node; use category infos
for cat in (select * from tbl_categories where c_id=i_cat_id and c_active = 'YES') loop
v_json.put(pair_name => 'id', pair_value => i_cat_id);
v_json.put(pair_name => 'text', pair_value => cat.c_name);
end loop;
end if;

if not hasChildren(i_cat_id) then -- if node has no children
v_json.put(pair_name => 'leaf', pair_value => json_bool(true)); -- mark as leaf
v_json.put(pair_name => 'href', pair_value => 'f?p=110:1:'||v('APP_SESSION')); -- set a link if needed
-- v_json.put(pair_name => 'href', pair_value => 'javascript:show_cat('||i_cat_id|| ');'); -- set a javascript function
else -- sonst
v_json.put(pair_name => 'leaf', pair_value => json_bool(false)); -- mark as node with children
for child in (select * from tbl_categories where c_par_id=i_cat_id and c_active = 'YES') loop -- loop through all sub-categories
-- create JSON-object for sub-category using recursive call and the append to array
v_row_list.add_elem(getJsonObject(i_cat_id => child.c_id).to_anydata);
end loop;
v_json.put(pair_name => 'children', pair_value => v_row_list); -- add array for subcategories
end if;

return v_json;

end;

/*
-- Author : AHILDEBRANDT
-- : TARNHOLD
-- Created : 10.08.2009
-- Updated : 04.02.2010
-- Purpose : function that calls getJsonObject and returns the result as string
*/
function getTreeDataDynamic return varchar2 is
v_json json:=json();
begin
v_json:=getJsonObject(i_cat_id => 1);
return('['||v_json.to_char||']');
end;

end PKG_EXTJS_JSON;

Utilities like this makes developing much more faster!
APEX-AT-WORK no image

Create your own holiday dvd movie with freeware tools

Von Tobias Arnhold → 11.29.2009
This time my post has nothing to do with APEX nor Oracle.
You all know the situation. You are the one who knows everything about computers, at least thats is the opinion from family and friends. And of course creating a DVD movie from your last holiday should be as easy as a short *snap* with your fingers.
In case you are the one "WHO KNOWS" may this little collection of free picture/sound/video editing tools make your life easier. At least you don't have to google them now. :D

1. Download the pictures/videos from your camera to a local directory
2. Create MPG files from your video files (like AVI, FLV,...). Use the tool: Any Video Converter
3. Create a slideshow movie with DVD slideshow GUI
- Downloads and installs all necessary other tools like Avisynth, Imgburn, Xvid and ffdshow automatically.
- For movies DVD slideshow GUI requires MPG files
- Save the downloaded version of DVD slideshow GUI because it can be so that you wont be able to use your current project in newer versions of the tool.
4. Create a M2V file with ProjectX from your newly created MPG file
5. Create a audio file for your movie with Audacity
5.1 Download some music/sounds from Youtube which fits to your movie with DVDVideoSoft Free Studio Manager - Free Youtube to MP3 converter
5.2 Use the AC3 file which you created with ProjectX (4.)
5.3 At the end create a new AC3 file with Audacity.
5. Merge your newly created video and audio file with ImagoMPEG-Muxer
6. Create a new DVD (with layout and movie files) use GUI for dvdauthor or DVDStyler
- I would recommend to first create ISO images > less DVD trash
- As image loader use Virtual CloneDrive
- As DVD burner use ImgBurn
- As DVD player use VLC media player

Of course the handling will be tricky especially at the beginning. But the result will be a new level of presenting pictures and videos.