Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Problem with implementing Maven into WBS(UI components not recognized by JDeveloper)

Robert ŠajinaMay 11 2017 — edited May 11 2017

Hi,

I am having trouble implementing Maven into work breakdown structure.

I have tried working with JDeveloper libraries and dependencies which worked fine, but i want to work with Maven as JDeveloper has support for it, and it would be easier to maintain library and dependencies.

My problem is that when i "install" subsystem and include the subsystem library in my master project i don't see my subsystem task flows. Also happens with templates in Common work space which i can't use in any other project (Master or Subsystem).

I' m not having problems in the Model(Business Components) project where if i create an entity in Common Model i can easily see it in my Subsystem work space when creating View Objects. So the problem only occurs in the view controller project.

I have a declarative component which i included in subsystem and to make it visible in the Components Pallet i had to manually add it in Facelets Tag Libraries (ViewController->Project Properties->Facelets Tag Libraries). When using pure JDeveloper library management it is automatically added.

So i am wonder there is a workaround for templates or task flows, or am I missing something?

I have done some researching and found this post which is similar to my problem, but its not quite clear to me how to make it work.

jsf - Using Maven dependencies in JDeveloper 12c - Stack Overflow

My JDeveloper version is 12.2.1.2.0. with JDeveloper build in Maven 3.2.5.

Comments

aroumeli

Hi,
We require the same: returning raw json from pl/sql procedure. Did you find a solution?

Aaron L.

Hope an amateur like me can help......
To POST json to a clob column we do the following:

INSERT INTO js_table
 (js_column)
VALUES
 (blob_to_clob(:body));

oracle-base.com has a version of the blob_to_clob sql
If you just want to return the json clob, the SELECT-statement User_Z87BQ works for us.
We have pl/sql that build the json by using something like the following:

BEGIN
  APEX_JSON.OPEN_OBJECT;
  APEX_JSON.WRITE('result','success');
  APEX_JSON.WRITE('message','hello world');
  APEX_JSON.CLOSE_OBJECT;
END;
thatJeffSmith-Oracle

just print it with htp.p

image.png

aroumeli

That's brilliant Jeff, thank you!
I'm using:
OWA_UTIL.mime_header('application/json', TRUE);
in order to set the correct content-type. Is this the correct way to go?

User_2JVWU

For anyone having the same issue: you could simply return the column which holds JSON as a plain JSON type by using a column name like "{}columnname", see:

SELECT id,
       json "{}json"
  FROM table_with_json

ref: https://www.thatjeffsmith.com/archive/2017/09/ords-returning-raw-json/

User_2JVWU

For anyone having the same issue: you could simply return the column which holds JSON as a plain JSON type by using a column name like "{}columnname", see:

SELECT id,
       json "{}json"
  FROM table_with_json

ref: https://www.thatjeffsmith.com/archive/2017/09/ords-returning-raw-json/

Olafur T

Create GET handler, type PL/SQL
Some examples of creating output:

begin
  owa_util.status_line(201, '', false);
  owa_util.mime_header('application/json', true);
  htp.prn('{"status": "Item created successfully"}');
end;

--

begin
  owa_util.status_line(200, '', false);
  owa_util.mime_header('application/json', true);
  htp.prn('{"items":[');
  for i in (select rownum as rn, object_Type, object_name, status from all_objects where owner = 'ORDS_METADATA' fetch next 10 rows only) loop
    if i.rn > 1 then
      htp.prn(',');
    end if;
    htp.prn('{"type": "' || i.object_type || '"');
    htp.prn(',"name": "' || i.object_name || '"');
    htp.prn(',"status": "' || i.status || '"}');
  end loop;
  htp.prn(']}');
end;

--

declare
  l_arr json_array_t := json_array_t();
begin
  for i in (select object_Type, object_name, status from all_objects where owner = 'ORDS_METADATA' fetch next 10 rows only) loop
    declare
      l_obj json_object_t := json_object_t();
    begin
      l_obj.put('type', i.object_type);
      l_obj.put('name', i.object_name);
      l_obj.put('status', i.status);
      l_arr.append(l_obj);
    end;
  end loop;
  owa_util.status_line(200, '', false);
  owa_util.mime_header('application/json', true);
  apex_util.prn(l_arr.to_clob);
end;

Regards
Oli

Olafur T

And for posting your CLOB, Jeff has already shown how to do a GET media resource.
This is an alternative way to do POST in PL/SQL, I'm assuming it's an array, change as needed:

 begin
  owa_util.status_line(200, '', false);
  owa_util.mime_header('application/json', true);
  htp.prn('{"items":');
  for i in (select jsonclob from mytable where id = :id) loop
    apex_util.prn(i.jsonclob);
  end loop; 
end;

of course under production, this would be a select into with a no_data_found handler

1 - 8
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Jun 8 2017
Added on May 11 2017
4 comments
157 views