8 Replies Latest reply: Jul 29, 2013 4:27 PM by 1008651 RSS

    Data not updating in Metadata with Select options that come from a view

    Amit Brahmbhatt, 3Di
      Hi All,
      I have a similar problem.
      I have a view called "contractnumberview" created in UCM that gets a "contractnumber" from database table called "Contracts"
      The view is used as options list for a metadata called "xContractNumber".
      The data is inserted in the "Contracts" table from an ADF Application.
      Problem:
      After a new contract number is inserted into the Contracts table from the adf application, the new contract number does not show up in the check-in form drop down of the xContractNumber metadata field.
      If i open the "contractnumberview" from configuration manager, the new contractnumber is listed there.

      Is there anything special required to be done so that the contract number is published in the check-in forms also.

      Thanks
      Amit
        • 1. Re: Data not updating in Metadata with Select options that come from a view
          Bunty
          Admin Applets --> Configuration manager --> Options --> Publish Schema
          • 2. Re: Data not updating in Metadata with Select options that come from a view
            Amit Brahmbhatt, 3Di
            Hi Bunty,
            The problem is that I dont want the administrators to do the publish schema manually for the view data to be available in the check-in form.
            The ContractNumber is created from a WebCenter Spaces interface and updated in a Table created in UCM Schema.

            I read in the post Schema Publishing issue in Oracle UCM 11g about subject Notify. Not sure how is this used or will be helpful in my case.

            Thanks in Advance.
            Amit
            • 3. Re: Data not updating in Metadata with Select options that come from a view
              William Phelps
              The post to which you refer solves your issue.

              From your ADF page, apparently you are simply doing some type of sql insert statement. That process simply won't work if you need to have the schema list updated properly - Content Server is unaware of changes to database tables that are performed by an external process.

              You will have to invoke the same service that Configuration Manager uses to update items in a schema table, rather than simply doing a database insert. The service has the necessary definition and configuration to properly "notify" the Content Server that a table in schema has changed.
              • 4. Re: Data not updating in Metadata with Select options that come from a view
                Amit Brahmbhatt, 3Di
                Is there any other workaround to update the schema.
                I am thinking of using CONTROL_SCHEMA Service using RIDC from my adf application code that inserts the contract number in the database.
                The Administration --> Admin Actions: publish schema configuration and data uses the below and the data is published in the view.
                http://hostname:port/cs/idcplg?IdcService=CONTROL_SCHEMA&PublishSchema=1&UserPublishingRequest=1&publishOperation=full

                Do you have any better options than the Control_Schema service?

                Thanks and Regards,
                Amit
                • 5. Re: Data not updating in Metadata with Select options that come from a view
                  William Phelps
                  Amit Brahmbhatt, 3Di wrote:I am thinking of using CONTROL_SCHEMA Service using RIDC from my adf application code that inserts the contract number in the database.
                  If you are going that far, why not just capture the details of the service that does the data insert for Configuration Manager, and use that instead? Turn on system tracing, do an update of the table via Configuration Manager, and look at the trace for the necessary parameters to pass to the service.
                  • 6. Re: Data not updating in Metadata with Select options that come from a view
                    Bunty
                    Amit-
                    you can try EDIT_SCHEMA_VIEW_VALUES service to add/update/delete schema view values.
                    The same service has prepareRedirect as last action...so you can construct redirect URL for PUBLISH_SCHEMA or CONTROL_SCHEMA and use it (I haven't tried the second part...but should work logically).
                    I can help you with the input parameters for EDIT_SCHEMA_VIEW_VALUES, if you need.
                    • 7. Re: Data not updating in Metadata with Select options that come from a view
                      1008651

                      Hi Bunty,

                       

                      Could you please help me use EDIT_SCHEMA_VIEW_VALUES service?

                      I´m trying use the above java code:

                       

                      DataBinder dataBinder = idcClient.createBinder();

                      dataBinder.putLocal("IdcService", "EDIT_SCHEMA_VIEW_VALUES");

                      dataBinder.putLocal("schViewName", "C_LISTA_LEILOES");

                      dataBinder.putLocal("editViewValueAction", "add");

                      dataBinder.addResultSet("resultset", resultSet);

                      serializer.serializeBinder (System.out, dataBinder);

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

                       

                      But I´m not sure how is the way to pass the resultset and the correct parameters for editViewValueAction

                       

                      Thanks for any help.

                       

                      LCruz

                      • 8. Re: Data not updating in Metadata with Select options that come from a view
                        1008651

                        Hi Everybody,

                        I Discovered how to ADD or Delete intens in java class, but now would like to update Title value.

                        The code is:

                                    List fields = new ArrayList(2);

                                    fields.add(new DataResultSet.Field("dDocName"));

                                    fields.add(new DataResultSet.Field("dDocTitle"));

                                    DataResultSet resultSetNovo = new DataResultSetImpl();

                                    resultSetNovo.setFields(fields);

                                  

                                    List leilaoRow = new ArrayList(2);

                                    leilaoRow.add("SOME_EXISTENT_ID");

                                    leilaoRow.add("SOME_EXISTENT_DESCRIPTION");

                                    resultSetNovo.addRow(leilaoRow);

                                   

                                    IdcClient idcClient1 = manager.createClient ("idc://host:port");

                                    IdcContext userContext1 = new IdcContext ("user","password");

                                    HdaBinderSerializer serializer1 = new HdaBinderSerializer ("UTF-8", idcClient1.getDataFactory ());

                                    DataBinder dataBinder1 = idcClient1.createBinder();

                                    dataBinder1.putLocal("IdcService", "EDIT_SCHEMA_VIEW_VALUES");

                                    dataBinder1.putLocal("schViewName", "C_LISTA_LEILOES");

                                    //add/update/delete

                                    dataBinder1.putLocal("editViewValueAction", "update");

                                    dataBinder1.addResultSet("LeiloesCadastrados", resultSetNovo);

                                    serializer1.serializeBinder (System.out, dataBinder1);

                                    ServiceResponse response1 = idcClient1.sendRequest(userContext1,dataBinder1);

                                    DataBinder responseData1 = response1.getResponseAsBinder();

                         

                        The error is:

                        Unable to edit view values for view 'C_LISTA_LEILOES'. The key CCEE_54321 could not be added due to a primary key constraint violation in the LeiloesCadastrados table.

                         

                        And the consoel messages during the process is:

                         

                        @Properties LocalData

                        IdcService=EDIT_SCHEMA_VIEW_VALUES

                        UserTimeZone=UTC

                        UserDateFormat=iso8601

                        schViewName=C_LISTA_LEILOES

                        editViewValueAction=update

                        @end

                        @ResultSet LeiloesCadastrados

                        2

                        dDocName

                        dDocTitle

                        CCEE_54321

                        SOME_DIFERENT_TEST

                        @end

                         

                        Im my table the column dDocName is the primary key and I´m trying to change only the dDocTitle column

                         

                        Any help will be appreciated

                         

                        Thanks for everybody.

                         

                        LCruz