This discussion is archived
8 Replies Latest reply: Sep 30, 2013 11:26 AM by Jonathan Hult RSS

executing a service to read values from DB

886436 Newbie
Currently Being Moderated

Hello!

 

I have a rather basic question, but I seem not to get to be able to figure this out :

 

I have a custom table EUM_DIV.  I have three columns: EUM_1, EUM_2, EUM_3.

I also have created a View based on this table, so that when I call this view like this below, it returns all the necessary information

<$HttpCgiPath$>?IdcService=GET_SCHEMA_VIEW_FRAGMENT&schViewName=EUM_Division_Abbr_View&IsSoap=1';

 

My task is that I need to extract the value of EUM_3 column based on the EUM_1 value.  I need to then save the extracted value from EUM_3 into a variable for future purposes.  (And this is where I am stuck) How can I call this service from an IntraDoc resource?  This whole sequense needs to happen when the user select a certain value from a meta-field option list.  I am sure the answer must be very streightforward!

 

Thank you for you help!

Anya

  • 1. Re: executing a service to read values from DB
    Jonathan Hult Pro
    Currently Being Moderated

    You can call a service from Idoc Script (which is server side) using the function executeService: http://docs.oracle.com/cd/E21043_01/doc.1111/e10726/c08_config_ref066.htm

     

    If you need to call a service in response to JavaScript (which is client side), then you would need to use AJAX to call the service. Here is an article that should help with this: http://bexhuff.com/2010/06/oracle-ucm-jquery-plugin-for-ajax

     

    Jonathan

    http://jonathanhult.com

  • 2. Re: executing a service to read values from DB
    886436 Newbie
    Currently Being Moderated

    Thank you Jonathan!  The second one sounds really interesting - I will actually try it out immediately Monday when back in the office!.  For the first suggestion - executeService - I guess the ResultSet that will be available to me when calling my custom service will be based on my custom query, where I select everying from my custom table?  According to documents, this method does not accept parameters, so my resultset will be ALL table. I will then have to filter all necessary information. Is this correct?

     

    Thank you a lot!

    Anya

  • 3. Re: executing a service to read values from DB
    886436 Newbie
    Currently Being Moderated

    In the AJAX example - how can I get to the "FIELD" entry, if the rows are empty?

     

     

     

     

    886436 wrote:

     

    Thank you Jonathan!  The second one sounds really interesting - I will actually try it out immediately Monday when back in the office!.  For the first suggestion - executeService - I guess the ResultSet that will be available to me when calling my custom service will be based on my custom query, where I select everying from my custom table?  According to documents, this method does not accept parameters, so my resultset will be ALL table. I will then have to filter all necessary information. Is this correct?

     

    Thank you a lot!

    Anya

  • 4. Re: executing a service to read values from DB
    886436 Newbie
    Currently Being Moderated

    Sorry, here the example XML that I need to use to read values from: DOCS_GESGESGESDOCS_GES

  • 5. Re: executing a service to read values from DB
    jiri.machotka Guru
    Currently Being Moderated

    Have you considered the option to do it in two steps/forms? In the first step, the value of EUM_1 would be selected (the form submitted) and in the second step only filtered values for EUM_3 would appear. Also, how big the table really is? (you could return the whole resultset, and do filtering client-side without calling any service, but the size of the table must be reasonable, then)

  • 6. Re: executing a service to read values from DB
    886436 Newbie
    Currently Being Moderated

    Hello - the table is relatively small, and the AJAX call using Bex's jquery library had also worked - I am now able to read the info from the tables.  I think this will be similar to what you described above - without need for any services, I will do an AJAX call to my custom view, and then extract all necessary values via client scripting. In case you have better ideas, here is my use case.  We are using ACLs for security, which are using UserList and GroupList.  We also have a custom metadata field EDiv (Division code).  My case is that once a user selects a particular EDiv for the document, the ACL has to be automatically updated with Groups assigned to this division.  There are several business reasons for this in our very controlled DM world over here, but that is another story.  My (not ideal) design, is to allow Admins enter a list of Groups in my custom view for Divisions in order to control this structure.  My Ajax call will then grab those group entries and populate ACL (almost working).  Unfortunately, our groups and divisions change very often.  I wish I could come up with a more dynamic approach, but now Admins will have to keep views/tables in synch manually - if one of the groups is removed/disabled, the admin will have to manually change this in the Division view.  I don't like this, but yet cannot come up with a more dynamic approach.  Any ideas? THank you! Anya

  • 7. Re: executing a service to read values from DB
    jiri.machotka Guru
    Currently Being Moderated

    I see, so the other field is actually not a custom one, but ACL.

     

    Actually, we've done here something similar: EDiv were accounts - not divisions, but courts, and we have thought long if we should go with ACLs or not - in some use cases, e.g. an attorney needs an access to a subset of a case's file, and this access must be granted even if the file moves to a higher court instance - and we finally decided not to use them at all. We have created a separate application where the special security cases (in fact, exceptions) were implemented via the superuser identity.

     

    If you want to hear the lesson I learned from our case: this is not a question of accounts vs. ACLs, or calling a service. This is a question how the security should work as such, which should be considered knowing all the use cases. If you write your table is relatively small (in our case we could easily end up with millions of ACLs), your table approach might be the optimal one. Overall, divisions are something that should be defined somewhere (LDAP?), so I'd probably start from this angle. Don't be limited by technology too soon - certainly not unless you consider alternatives and know what you sacrifice if you choose one of them.

  • 8. Re: executing a service to read values from DB
    Jonathan Hult Pro
    Currently Being Moderated

    executeService uses any variables/ResultSets that have already been defined on your page before calling executeService. This means you can set variables beforehand and those become the service parameters.

     

    Jonathan

    http://jonathanhult.com

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points