This discussion is archived
1 2 Previous Next 16 Replies Latest reply: Jan 9, 2013 1:36 AM by 980743 RSS

GET_SCHEMA_VIEW_VALUES gives output null

980743 Newbie
Currently Being Moderated
Hi,

I am new to UCM. I am using below RIDC code:

dataBinder.putLocal("IdcService", "GET_SCHEMA_VIEW_VALUES");
dataBinder.putLocal ("schViewName", "SecurityGroups");

ServiceResponse response = idcClient.sendRequest (userContext, dataBinder);
DataBinder serverBinder = response.getResponseAsBinder();

DataResultSet resultSet = serverBinder.getResultSet("SecurityGroups");

for (DataObject dataObject : resultSet.getRows ())
          System.out.println (" Security Group : " + dataObject.get ("SecurityGroups") );


i want the list of security group as out put.
But the out put i am getting is as below:

Security Group : null
Security Group : null
Security Group : null
Security Group : null
Security Group : null
Security Group : null
Security Group : null
Security Group : null
Security Group : null
Security Group : null
Security Group : null
Security Group : null
Security Group : null
Security Group : null
Security Group : null

Please help me with what is wrong in the code.

Thanks.
  • 1. Re: GET_SCHEMA_VIEW_VALUES gives output null
    ryan sullivan Pro
    Currently Being Moderated
    You must use the correct object names:

    for (DataObject dataObject : resultSet.getRows ())
    {
    System.out.println (" Security Group Name: " + dataObject.get("*dGroupName*"));
    System.out.println (" Security Group Description : " + dataObject.get("*dDescription*"));
    }

    You can see that you get two fields per row. After checking what the field names are, you can pull them from the dataObject.

    I hope that this answer the question for you and provides enough info for you to find the answer next time!

    -ryan
  • 2. Re: GET_SCHEMA_VIEW_VALUES gives output null
    Srinath Menon Guru
    Currently Being Moderated
    Hi ,

    Try this and see :

    for (DataObject dataObject : resultSet.getRows ()) {
    System.out.println ("Security group: " + dataObject.get ("dGroupName"));
    }

    Thanks,
    Srinath
  • 3. Re: GET_SCHEMA_VIEW_VALUES gives output null
    980743 Newbie
    Currently Being Moderated
    Thanks Srinath & ryan

    Thanks a lot i got the list of security groups. :) Thank you very much.

    Now please, please help me with below requirement:

    with this list of security group i want the number of documents in each security group. How can i achieve this?

    Thanks in advance.
  • 4. Re: GET_SCHEMA_VIEW_VALUES gives output null
    ryan sullivan Pro
    Currently Being Moderated
    Don't forget to mark comments as helpful & answers to close the thread.

    For your second question, as I mentioned in your (i assume) other thread on this, I believe a custom query is the best way to accomplish this. a 'simple' aggregate query will allow you to group and sum documents based on security group.

    -ryan
  • 5. Re: GET_SCHEMA_VIEW_VALUES gives output null
    Srinath Menon Guru
    Currently Being Moderated
    Hi ,

    Not sure if this would suffice your requirement :

    SELECT count(*) FROM Revisions, DocMeta, Documents, RevClasses
    WHERE Revisions.dID=DocMeta.dID And Revisions.dID=Documents.dID And Revisions.dDocName = RevClasses.dDocName And dIsPrimary = 1 And dReleaseState IN ('Y', 'U', 'I') AND ((( dSecurityGroup LIKE '<sec group>' ))) ORDER BY dInDate Desc ;

    Hope this helps .

    Thanks,
    Srinath
  • 6. Re: GET_SCHEMA_VIEW_VALUES gives output null
    980743 Newbie
    Currently Being Moderated
    Hi Srinath,

    Thanks for the response.

    Please help me with How can i add this query in my above code?

    And i have one more query:

    From where i can find the data object names?
    example:
    dataObject.get ("*_dGroupName_*") );
    from where i will know that here i should write dGroupName and not SecurityGroups?

    Thanks
  • 7. Re: GET_SCHEMA_VIEW_VALUES gives output null
    980743 Newbie
    Currently Being Moderated
    Hi Srinath,

    Thanks for the response.

    Please help me with How can i add this query in my above code?

    And i have one more query:

    From where i can find the data object names?
    example:
    dataObject.get ("*_dGroupName_*") );
    from where i will know that here i should write dGroupName and not SecurityGroups?

    Thanks
  • 8. Re: GET_SCHEMA_VIEW_VALUES gives output null
    Srinath Menon Guru
    Currently Being Moderated
    Hi ,

    Execute any service from browser and append IsJava=1 to it . For eg :

    http://hostname:port/cs/idcplg?IdcService=GET_USER_PERMISSIONS&IsJava=1

    Now you will see entries which start with @ResultSet - these are the result set where the values for them will be stored .

    Search for @ResultSet SecurityGroups in the browser after executing it and there you will see :

    @ResultSet SecurityGroups
    2
    dGroupName
    privilege

    This means that for ResultSet SecurityGroup the values in output are :

    dGroupName - Security Group

    privilege - The access level for the group .

    Appending IsJava=1 with services from browser would give you the entire picture of what all result sets and values associated with them .

    Hope this helps .

    Thanks,
    Srinath
  • 9. Re: GET_SCHEMA_VIEW_VALUES gives output null
    ryan sullivan Pro
    Currently Being Moderated
    You can use the HowToComponents and the available SampleComponents (google searching will bring you to the download pages) to find samples of queries in components. The Developer doc also has sample query components.

    you have to use the available methods to find the names of the elements. You already found that the DataResultSet contains DataObjects. You just have to continue to drill down until you find the element (i.e., Field) names. You can quickly use the java debugger to crack open objects and see their contents. That's how to determine in any case, but in this case you knew what schema you were looking into. In that case, you should simply be able to check the schema/view in the config manager applet. Without even looking at the backing table, you can see that the Internal Column is dGroupName and the Visible Column is dDescription.

    Hope this helps,
    -ryan
  • 10. Re: GET_SCHEMA_VIEW_VALUES gives output null
    980743 Newbie
    Currently Being Moderated
    Hi Srinath,
    This ia very helpful. and it will definately help in future while working with other services.

    About my first doubt please help me with how i can use this query in my above RIDC code.

    Thanks
  • 11. Re: GET_SCHEMA_VIEW_VALUES gives output null
    970471 Explorer
    Currently Being Moderated
    Here are three articles that can help you use a query. You will need to create a new custom component which defines a query resource and a new service you can call.

    http://nileshphadnis.blogspot.com/2012/07/oracle-ucm-custom-component.html
    http://middlewarebylink.wordpress.com/2012/08/30/developing-components-adding-a-custom-idoc-script/
    http://jonathanhult.com/intradoc-api/DatabaseProvider/readme.htm

    Jonathan
    http://jonathanhult.com
  • 12. Re: GET_SCHEMA_VIEW_VALUES gives output null
    Bunty Journeyer
    Currently Being Moderated
    "with this list of security group i want the number of documents in each security group. How can i achieve this?"

    check your other thread
  • 13. Re: GET_SCHEMA_VIEW_VALUES gives output null
    980743 Newbie
    Currently Being Moderated
    Hi Bunty,

    In which thread? I checked my threads but i did't find it.

    Thanks
  • 14. Re: GET_SCHEMA_VIEW_VALUES gives output null
    970471 Explorer
    Currently Being Moderated
    I believe he means this thread: Re: How to retrive the list of Security groups From UCM

    Jonathan
    http://jonathanhult.com
1 2 Previous Next

Legend

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