Create Named Search with Java API

Hi,
is it possible to create or modify a named search with the Java API?
Best regards,
Roman

Hi Olof,
You can use the below code for searching a value in lookup table:
               ResultDefinition objResultDefinition = new ResultDefinition(Lookup Table Id);
               objResultDefinition.addSelectField(Lookup Field ID);
               StringValue [] objStringValue = new StringValue[1];
               objStringValue[0] = new StringValue("Value to search");
               RetrieveRecordsByValueCommand objRetrieveRecordsByValueCommand = new RetrieveRecordsByValueCommand(objConnectionAccessor);
               objRetrieveRecordsByValueCommand.setSession(strUserSessionID);
               objRetrieveRecordsByValueCommand.setResultDefinition(objResultDefinition);
               objRetrieveRecordsByValueCommand.setFieldId(lookup field id);
               objRetrieveRecordsByValueCommand.setFieldValues(objStringValue);
               objRetrieveRecordsByValueCommand.execute();
               RecordResultSet objRecordResultSet = objRetrieveRecordsByValueCommand.getRecords();
Now using the objRecordResultset in a loop you can get the record id by calling the getRecord(i).getId() method.
Hope this helps!!
Cheers,
Arafat

Similar Messages

  • Named Searches and Java API

    Hi All,
    Does anyone know if its possible to execute Named Searches using the Java API?  If so, how would you set up that call?
    Best Regards,
    Mark

    Hello Mark,
                     SAP does provide with some methods related to Named Searches just have a look at these links
    1. <a href="https://help.sap.com/javadocs/MDM/current/com/sap/mdm/search/SearchDimension.html#NAMED_SEARCH">Named search</a>
    2. <a href="https://help.sap.com/javadocs/MDM/current/com/sap/mdm/security/AccessPermission.html#NAMED_SEARCH_OBJECT">Named Search Object</a>
    3. <a href="https://help.sap.com/javadocs/MDM/current/com/sap/mdm/search/NamedSearchSearchDimension.html#NAMED_SEARCH_SEARCH_DIMENSION">Named Search Search Dimension</a>
    I hope this solves ur problem.
    Regards Dollar Man

  • Attaching/Detaching libraries with Java API

    Hello,
    In my forms (Forms10g), sometimes, libraries had been attached in lower case although files are in upper case. This causes compilation errors on UNIX systems.
    I'm trying to detach these libraries with Java APIs and then reattach them in upper case.
    But I get an error when I want to save the module.
    Here is my code :
    public class UpperPll {
         public UpperPll (String formName) {
              try
                   FormModule form = FormModule.open("C:/AttachPll/" + formName);
                   System.out.println("Form Name is " + form.getName());
                   JdapiIterator AttachPll = form.getAttachedLibraries();
                   while(AttachPll.hasNext())
                        try
                             JdapiObject jo = (JdapiObject)AttachPll.next();
                             System.out.println(jo.getName());
                             if (jo.getName().toLowerCase().equals(jo.getName()))
                                  AttachedLibrary.find(form,jo.getName().toUpperCase()).detach();
                                  System.out.println(jo.getName().toUpperCase());
                                  new AttachedLibrary(form,jo.getName().toUpperCase());
                        catch (JdapiIllegalStateException jdise)
                             jdise.printStackTrace();
                   form.save("C:/AttachPll/New/" + form.getName() + ".fmb");
                   Jdapi.shutdown();
              catch (JdapiException jde)
                   jde.printStackTrace();
         public static void main (String[] args) {
              try {
                   FileReader r = new FileReader( "C:/AttachPll/listemodule.txt" );
                   BufferedReader br = new BufferedReader( r );
                   try {
                        String module;
                        while ( ( module = br.readLine() ) != null ) {
                             new UpperPll(module);
                   } finally {
                        r.close();
              } catch (FileNotFoundException fnfe) {
                   fnfe.printStackTrace();
              } catch (IOException ioe) {
                   ioe.printStackTrace();
    And here are the errors I get :
    An unexpected exception has been detected in native code outside the VM.
    Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x2FBBDCB
    Function=icobad+0xB
    Library=C:\DevSuiteHome_1\bin\frmcom.dll
    Current Java thread:
         at oracle.forms.jdapi.BaseAPI._jni_save_form(Native Method)
         at oracle.forms.jdapi.FormModule.save(Unknown Source)
         at UpperPll.<init>(UpperPll.java:39)
         at UpperPll.main(UpperPll.java:55)
    Dynamic libraries:
    0x00400000 - 0x0040B000      C:\DevSuiteHome_1\jdk\bin\javaw.exe
    0x7C910000 - 0x7C9C7000      C:\WINDOWS\system32\ntdll.dll
    0x7C800000 - 0x7C904000      C:\WINDOWS\system32\kernel32.dll
    0x77DA0000 - 0x77E4C000      C:\WINDOWS\system32\ADVAPI32.dll
    0x77E50000 - 0x77EE1000      C:\WINDOWS\system32\RPCRT4.dll
    0x77D10000 - 0x77DA0000      C:\WINDOWS\system32\USER32.dll
    0x77EF0000 - 0x77F37000      C:\WINDOWS\system32\GDI32.dll
    0x77BE0000 - 0x77C38000      C:\WINDOWS\system32\MSVCRT.dll
    0x62DC0000 - 0x62DC9000      C:\WINDOWS\system32\LPK.DLL
    0x753C0000 - 0x7542B000      C:\WINDOWS\system32\USP10.dll
    0x08000000 - 0x08139000      C:\DevSuiteHome_1\jdk\jre\bin\client\jvm.dll
    0x76AE0000 - 0x76B0F000      C:\WINDOWS\system32\WINMM.dll
    0x6BD00000 - 0x6BD0D000      C:\WINDOWS\system32\SYNCOR11.DLL
    0x10000000 - 0x10007000      C:\DevSuiteHome_1\jdk\jre\bin\hpi.dll
    0x00940000 - 0x0094E000      C:\DevSuiteHome_1\jdk\jre\bin\verify.dll
    0x00950000 - 0x00969000      C:\DevSuiteHome_1\jdk\jre\bin\java.dll
    0x00970000 - 0x0097D000      C:\DevSuiteHome_1\jdk\jre\bin\zip.dll
    0x02F60000 - 0x02F6F000      C:\DevSuiteHome_1\BIN\frmjapi.dll
    0x02F70000 - 0x02F8C000      C:\DevSuiteHome_1\bin\frmd2f.dll
    0x663D0000 - 0x66414000      C:\DevSuiteHome_1\bin\CA.dll
    0x66340000 - 0x6636A000      C:\DevSuiteHome_1\bin\mmc.dll
    0x64CA0000 - 0x64CB1000      C:\DevSuiteHome_1\bin\UTL.dll
    0x60730000 - 0x607DC000      C:\DevSuiteHome_1\bin\oracore10.dll
    0x608D0000 - 0x60963000      C:\DevSuiteHome_1\bin\oranls10.dll
    0x62B40000 - 0x62B53000      C:\DevSuiteHome_1\bin\oraunls10.dll
    0x60C40000 - 0x60C47000      C:\DevSuiteHome_1\bin\orauts.dll
    0x719F0000 - 0x71A07000      C:\WINDOWS\system32\WS2_32.dll
    0x719E0000 - 0x719E8000      C:\WINDOWS\system32\WS2HELP.dll
    0x774A0000 - 0x775DD000      C:\WINDOWS\system32\ole32.dll
    0x616B0000 - 0x61891000      C:\DevSuiteHome_1\bin\oraclient10.dll
    0x62B60000 - 0x62B66000      C:\DevSuiteHome_1\bin\oravsn10.dll
    0x60D30000 - 0x60DE8000      C:\DevSuiteHome_1\bin\oracommon10.dll
    0x60300000 - 0x60720000      C:\DevSuiteHome_1\bin\orageneric10.dll
    0x629C0000 - 0x629D2000      C:\DevSuiteHome_1\bin\orasnls10.dll
    0x62B80000 - 0x62C86000      C:\DevSuiteHome_1\bin\oraxml10.dll
    0x02F90000 - 0x02FA1000      C:\WINDOWS\system32\MSVCIRT.dll
    0x607E0000 - 0x608CC000      C:\DevSuiteHome_1\bin\oran10.dll
    0x62000000 - 0x6202C000      C:\DevSuiteHome_1\bin\oranl10.dll
    0x62030000 - 0x62042000      C:\DevSuiteHome_1\bin\oranldap10.dll
    0x62090000 - 0x62184000      C:\DevSuiteHome_1\bin\orannzsbb10.dll
    0x61E10000 - 0x61E52000      C:\DevSuiteHome_1\bin\oraldapclnt10.dll
    0x61F30000 - 0x61F47000      C:\DevSuiteHome_1\bin\orancrypt10.dll
    0x71A10000 - 0x71A1A000      C:\WINDOWS\system32\WSOCK32.dll
    0x76D10000 - 0x76D29000      C:\WINDOWS\system32\iphlpapi.dll
    0x770E0000 - 0x7716C000      C:\WINDOWS\system32\OLEAUT32.dll
    0x621A0000 - 0x621D7000      C:\DevSuiteHome_1\bin\oranro10.dll
    0x621F0000 - 0x621FC000      C:\DevSuiteHome_1\bin\orantcp10.dll
    0x61F70000 - 0x61F76000      C:\DevSuiteHome_1\bin\oranhost10.dll
    0x61F20000 - 0x61F26000      C:\DevSuiteHome_1\bin\orancds10.dll
    0x62210000 - 0x62216000      C:\DevSuiteHome_1\bin\orantns10.dll
    0x60970000 - 0x60C31000      C:\DevSuiteHome_1\bin\orapls10.dll
    0x62500000 - 0x62507000      C:\DevSuiteHome_1\bin\oraslax10.dll
    0x627B0000 - 0x628B3000      C:\DevSuiteHome_1\bin\oraplp10.dll
    0x618B0000 - 0x61905000      C:\DevSuiteHome_1\bin\orahasgen10.dll
    0x622B0000 - 0x622E6000      C:\DevSuiteHome_1\bin\oraocr10.dll
    0x622F0000 - 0x62315000      C:\DevSuiteHome_1\bin\oraocrb10.dll
    0x6FEE0000 - 0x6FF34000      C:\WINDOWS\system32\NETAPI32.dll
    0x76BA0000 - 0x76BAB000      C:\WINDOWS\system32\PSAPI.DLL
    0x62A80000 - 0x62AF6000      C:\DevSuiteHome_1\bin\orasql10.dll
    0x662F0000 - 0x66320000      C:\DevSuiteHome_1\bin\mmi.dll
    0x64F10000 - 0x64F21000      C:\DevSuiteHome_1\bin\UIIM.dll
    0x64CE0000 - 0x64DBD000      C:\DevSuiteHome_1\bin\UIW.dll
    0x64CD0000 - 0x64CD7000      C:\DevSuiteHome_1\bin\UTC.dll
    0x64CC0000 - 0x64CC9000      C:\DevSuiteHome_1\bin\UTJ.dll
    0x72F50000 - 0x72F76000      C:\WINDOWS\system32\WINSPOOL.DRV
    0x58B50000 - 0x58BE7000      C:\WINDOWS\system32\COMCTL32.dll
    0x64ED0000 - 0x64EF6000      C:\DevSuiteHome_1\bin\UIOLE.dll
    0x76340000 - 0x7638A000      C:\WINDOWS\system32\comdlg32.dll
    0x77F40000 - 0x77FB6000      C:\WINDOWS\system32\SHLWAPI.dll
    0x7C9D0000 - 0x7D1F3000      C:\WINDOWS\system32\SHELL32.dll
    0x64AD0000 - 0x64C05000      C:\DevSuiteHome_1\bin\VGS.dll
    0x64E30000 - 0x64E93000      C:\DevSuiteHome_1\bin\UIREM.dll
    0x659A0000 - 0x659EE000      C:\DevSuiteHome_1\bin\ROS.dll
    0x66250000 - 0x6627E000      C:\DevSuiteHome_1\bin\mmw.dll
    0x662A0000 - 0x662B0000      C:\DevSuiteHome_1\bin\mmv.dll
    0x73AA0000 - 0x73AB7000      C:\WINDOWS\system32\AVIFIL32.dll
    0x77BB0000 - 0x77BC5000      C:\WINDOWS\system32\MSACM32.dll
    0x75BA0000 - 0x75BC1000      C:\WINDOWS\system32\MSVFW32.dll
    0x662C0000 - 0x662DF000      C:\DevSuiteHome_1\bin\mms.dll
    0x66810000 - 0x66A2B000      C:\DevSuiteHome_1\bin\DE.dll
    0x627A0000 - 0x627AF000      C:\DevSuiteHome_1\bin\oraplc10.dll
    0x64F50000 - 0x64F66000      C:\DevSuiteHome_1\bin\UICC.dll
    0x64FB0000 - 0x64FDA000      C:\DevSuiteHome_1\bin\UCOL.dll
    0x02FB0000 - 0x030CA000      C:\DevSuiteHome_1\bin\frmcom.dll
    0x66380000 - 0x66389000      C:\DevSuiteHome_1\bin\mma.dll
    0x64FF0000 - 0x65003000      C:\DevSuiteHome_1\bin\UAT.dll
    0x66220000 - 0x6623C000      C:\DevSuiteHome_1\bin\nn.dll
    0x64F70000 - 0x64F94000      C:\DevSuiteHome_1\bin\UIA.dll
    0x64F30000 - 0x64F45000      C:\DevSuiteHome_1\bin\UIDC.dll
    0x030D0000 - 0x03194000      C:\DevSuiteHome_1\bin\frmdig.dll
    0x031A0000 - 0x0324D000      C:\DevSuiteHome_1\bin\frmdug.dll
    0x66210000 - 0x66215000      C:\DevSuiteHome_1\bin\obs.dll
    0x77390000 - 0x77492000      C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2180_x-ww_a84f1ff9\comctl32.dll
    0x5B090000 - 0x5B0C8000      C:\WINDOWS\system32\uxtheme.dll
    0x74690000 - 0x746DB000      C:\WINDOWS\system32\MSCTF.dll
    0x76BE0000 - 0x76C0E000      C:\WINDOWS\system32\WINTRUST.dll
    0x779E0000 - 0x77A76000      C:\WINDOWS\system32\CRYPT32.dll
    0x77A80000 - 0x77A92000      C:\WINDOWS\system32\MSASN1.dll
    0x76C40000 - 0x76C68000      C:\WINDOWS\system32\IMAGEHLP.dll
    0x72C70000 - 0x72C79000      C:\WINDOWS\system32\wdmaud.drv
    0x72C60000 - 0x72C68000      C:\WINDOWS\system32\msacm32.drv
    0x77BA0000 - 0x77BA7000      C:\WINDOWS\system32\midimap.dll
    0x5D3F0000 - 0x5D491000      C:\WINDOWS\system32\DBGHELP.dll
    0x77BD0000 - 0x77BD8000      C:\WINDOWS\system32\VERSION.dll
    Heap at VM Abort:
    Heap
    def new generation total 576K, used 35K [0x10010000, 0x100b0000, 0x104f0000)
    eden space 512K, 6% used [0x10010000, 0x10017c90, 0x10090000)
    from space 64K, 7% used [0x10090000, 0x10091348, 0x100a0000)
    to space 64K, 0% used [0x100a0000, 0x100a0000, 0x100b0000)
    tenured generation total 1408K, used 122K [0x104f0000, 0x10650000, 0x14010000)
    the space 1408K, 8% used [0x104f0000, 0x1050e930, 0x1050ea00, 0x10650000)
    compacting perm gen total 4096K, used 1642K [0x14010000, 0x14410000, 0x18010000)
    the space 4096K, 40% used [0x14010000, 0x141aaac8, 0x141aac00, 0x14410000)
    Local Time = Wed Apr 12 10:35:49 2006
    Elapsed Time = 5
    # The exception above was detected in native code outside the VM
    # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode)
    # An error report file has been saved as hs_err_pid3184.log.
    # Please refer to the file for further information.
    Can anyone help me ?
    Message was edited by:
    dbouchier

    We do something very simular. We rename everything to lowercase for the same reasons. I've pasted a snippet of the code we're using at the end of this post.
    To get the full source code of our converter have a look at http://www.oratransplant.nl/2005/05/30/custom-built-forms-migration-assistant/#comment-642
    Here is the code snippet:
    while (attachedLibs.hasNext()) {
    AttachedLibrary attachedLib = (AttachedLibrary)attachedLibs.next();
    String attachedLibLocation = attachedLib.getLibraryLocation();
    out("Found attached library " + attachedLibLocation, logLevel,
    false);
    if (attachedLib.getName().equalsIgnoreCase("obsolete_forms6")) {
    obsoleteAttached = true;
    if (attachedLib.getName().equalsIgnoreCase("webreports")) {
    webReportsAttached = true;
    // converted name of attached lib to lowercase
    if ((!attachedLibLocation.equals(attachedLibLocation.toLowerCase())) &&
    lowerLib) {
    out(attachedLib,
    "Converting filename to lowercase (" + attachedLibLocation.toLowerCase() +
    ")", logLevel + 1, true);
    attachedLibLocation = attachedLibLocation.toLowerCase();
    pllChanged = true;
    // attachedLibLocation = attachedLibLocation.toUpperCase();
    pldText.append(".attach LIBRARY " + attachedLibLocation +
    " END NOCONFIRM\n");
    out("Re-attaching library " + attachedLibLocation, logLevel + 1,
    false);
    }

  • How to do exact word search using Java API

    Hi,
    Can someone tell me how can I write a search query using Ultra Search Java API to return data containing a full word that is sent as a search
    parameter. e.g. If I want to search for a word 'Dictionary' I need to get all the results conatining full word Dictionary for example if I
    have following 4 records
    1. Dictionary
    2. English Dictionary
    3. French Dictionary
    4. AllDictionary
    How can I write a query that returns me first 3 records only as they contain the word 'Dictionary' and not the fourth record as it's not a word.
    Here is what I need to get back and ordered in that way as the 'Dictionary' needs to be first record because the search is on Dictionary.
    1. Dictionary
    2. English Dictionary
    3. French Dictionary
    Any help is appreciated.
    Thanks

    Looks like we can not do an exact word search using Java API.

  • Read "Qualified Range Key Generation" with Java API.

    Hi guru,
    I use MDM 5.5 SP6.
    In MDM Console I read Qualified Range Key Generation it in "ADMIN -> Remote Systems -> Qualified Range".
    I have to get "Qualified Range Key Generation" with Java API.
    It's possible?

    Hi Rocco,
    I am also thinking  of same scenario.I thought it is possible in Java Apis by calling the webservices for MDM.there is a service of "get key mapping" where we can pass this "Qualified key range" as  parameter.In MDM we have to define a look up table for that key ranges .We will access that table through JAVA API and then link it with the key mapping service .
    If u find any solution to apply this ,please share.
    thanks and regards
    Ank

  • Creating Taxonomy with Java API

    Hi all,
      I am trying to add a Taxonomy structure like the collowing with the java API. But i am unable to add the structure, only the first folder is added.
    /taxonomy/countries/us
                       /en
                       /fr
    I am using the following code:
    IClassificationIndex index = (IClassificationIndex)indexService.getIndex(indexName);
    index.addTaxonomy("countries/us", new ResourceContext(user)) ;
    Any help would be very nice.

    I'd also be interested to know how to do this.
    I found this code section to sort by date, but couldn't change it to get it to work to sort alphabetically.
    private void sortResouceListByDate(IResourceList resourceList) throws Exception {
    // create property names to index properties
    IPropertyName iPropSort = new PropertyName("http://sapportals.com/xmlns/cm", "modified");
    //create a comparator to order the resource list
    ResourcePropertyComparator rRPC = new ResourcePropertyComparator(iPropSort, false);
    //order the resource list
    resourceList.sort(rRPC);
    Link where code was found:
    https://forums.sdn.sap.com/thread.jspa?forumID=42&threadID=148468&messageID=1670970#1670970
    We are using:
    Portal 6.0.15.0.0
    KM 6.0.15.4.0
    Thanks!!

  • MDM - Create a named-search with an active one

    Hi MDM experts,
    Is there any possibility to activate a Named-Search and save another with another active search criteria?
    I mean:
    I choose Named-Search A
    I activate another field for filtering.
    Then I need to save this result as Named-Search B.
    I can't find this option available (only in display mode). Any experience how this can be done?
    Thanks,
    LM

    SAP Note 1345702

  • Restoring NamedSearch with Java API

    Hi,
    I tried to restore a NamedSearch with the following code:
        RestoreNamedSearchCommand restoreNamedSearchCommand = new RestoreNamedSearchCommand(context);
        restoreNamedSearchCommand.setSession(session);
        restoreNamedSearchCommand.setTableId(namedSearchTableId);
        restoreNamedSearchCommand.setRecordId(searchRecord.getId());
        restoreNamedSearchCommand.execute();
        Search namedSearch = restoreNamedSearchCommand.getSearch();
    But I always get the following error: Server error (0xffaa0310)
    No matter which NamedSearch I try to read.
    Has anybody encountered that error before and knows what it means?
    Or has someone succesfully restored a NamedSearch via the Java API?
    Many thanks,
    Martin

    Hi Martin,
    Here is a quote from the MDM API JavaDoc:
    A command to restore a named search. A named search is a search criteria that has been saved.
    Note: Not all named search can be restored by the API.
    It seems you may be in one of those occasions where the named search cannot be restored.
    There is, fortunately a workaround.  The following piece of code will add a named search to an MDM Search object, and will always work in returning the correct records when used in a RetrieveLimitedRecordsCommand (or any other command that takes a search object).
    // Step 1: Create a SearchDimension
    SearchDimension sd = new NamedSearchSearchDimension();\
    // Step 2: Create an array of MdmValue and add the NamedSearch ID to the array
    MdmValue [] mdmValues = new MdmValue[1];
    mdmValues[0] = new LookupValue(new RecordId(namedSearchId));
    // Step 3: Create a PicklistSearchConstraint and add the array of lookup values
    PicklistSearchConstraint sc  = new PicklistSearchConstraint(mdmValues);
    // Step 4: (Optional, but advised) Create a SearchParameter
    SearchParameter sp = new SearchParameter(sd, sc);
    // Step 5: If you do not already have a search object, create a new one
    Search search = new Search( mainTableId );
    // Step 6: Add the search parameter to the search
    search.add( sp );
    // Now use the search in a retrieve command
    Hoping this solves your problem,
    Walter

  • Create Word document with Java

    I want to create a Word Document with Java. But I don't know how can I insert text in a Word document.

    I searched and found JXWord (probably limited to Windows): http://www.geocities.com/picmapicma/
    I'm interrested to know if it works fine...:)

  • Purge a queue with JAVA API

    Hi,
    Is it possible to purge a queue with the JAVA API ?
    I have not found anything ...
    I am also trying to browse archived messages (state 2), the "browseQueue" method does only browse the ready messages (state 0).
    Is it possible to browse archived messages ?? (in java)
    Thanks in advance.

    found it, I had to write
    "ormi://<some-ip>:12401/orabpel" for java.naming.provider.url

  • CREATING A SEARCH IN JAVA USING MYSQL QUERY

    How do i create a seach in java using mysql queries. The search need to be like a good type one, whereby a category is typed and the results obtained via the search system using jtable.
    Thank you.

    Read the tutorial on [url http://java.sun.com/docs/books/tutorial/]JDBC Database Access.
    Read the tutorial on [url http://java.sun.com/docs/books/tutorial/uiswing/components/table.html]How to Use Tables.
    Put the two together and you come up with something like [url http://forum.java.sun.com/thread.jsp?forum=57&thread=497641]this.

  • How do I resolve connection error with Java API listener?

    I have created a listener using the new Java API (see How do I implement a listener using new MDM Java API? for background). When I run it, I get this error message
    Mar 19, 2008 3:57:58 PM com.sap.mdm.internal.net.ConnectionImpl finalize
    INFO: Disconnect was not called. Cleaning up connection in finalize.
    This message is triggered whenever I generate a data event that I would otherwise expect to be captured and handled by the listener. I have tried a number of things, including setting the connection to NO_TIMEOUT and trying SimpleConnection versus ConnectionPool, but always with the same result.
    Here is some sample code for the listener:
    public class DataListenerImpl implements DataListener {
         public void recordAdded(RecordEvent evt) {          
              System.out.println("===> Record Added Event");
              System.out.println(evt.getServerName());
         public void recordCheckedIn(RecordEvent evt) {
              System.out.println("===> Record Checked In Event");
              System.out.println(evt.getServerName());          
         public void recordCheckedOut(RecordEvent evt) {
              System.out.println("===> Record Checked Out Event");
              System.out.println(evt.getServerName());               
         public void recordModified(RecordEvent evt) {
              System.out.println("===> Record Modified Event");
              System.out.println(evt.getServerName());
    And here is the code for the Event Dispatcher:
    public void execute(Repository repository) {
         DataListener listener = new DataListenerImpl();
         try {
              EventDispatcherManager edm = EventDispatcherManager.getInstance();
              EventDispatcher ed = edm.getEventDispatcher(repository.getServer().getName());
              ed.addListener(listener);
              ed.registerDataNotifications(SystemProperties.getUserName(), SystemProperties.getPassword(),
                        repository.getIdentifier(), repository.getLoginRegion());
              ed.registerRepositoryNotifications(SystemProperties.getUserName(), SystemProperties.getPassword(),
                        repository.getIdentifier());
              ed.registerGlobalNotifications();
              while (true) {
                   Thread.yield();
                   try {
                        Thread.sleep(1500);
                   } catch (InterruptedException ex) {
                        System.out.println("Interrupted Exception: " + ex.getMessage());
         } catch (ConnectionException e) {
              e.printStackTrace();
         } catch (CommandException e) {
              e.printStackTrace();
    Has anyone else encountered this message? Could it be related to a TCP configuration on the server? Or is this a bug in the Java API?
    As I mentioned in the forum posting linked to above, I have not encountered this problem with the MDM4J API.
    Any help is greatly appreciated.

    I resolved it. We are switching over to SP6, Patch 1 and the listener code works fine with this version of the Java API.
    Just one thing to note, though: make sure that you register data notifications through MetadataManager in your initialization code:
    metadataManager.registerDataNotifications(userSessionContext, repositoryPassword);
    For information on the changes to the SP6 Java API, especially with regard to connecting to MDM with the UserSessionContext, please review Richard LeBlanc's [presentation|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/20073a91-3e8b-2a10-52ae-e1b4a10add1c].

  • Sort  Hierarchy with Java API

    Hi Mdm guru,
    I have to sort the getHierarchy results.
    In the MDM Data Manager is possible "Sort Entire Branch" (in the context menu).
    My question: there is a method in the Java Api for this funtionality?
    Best Regards

    Hi Rocco,
    It depends upon <i>which</i> API you are using.  The API <b>mdm4j</b> has a function
    CatalogData.GetChildren()
    which has a parameter for defining the sort field.  So you can create your own recursive function which drills down through a hierarchy, creating each level sorted.
    The class <b>SortDefinition</b> belongs to the "new" API <b>MDMJavaAPI</b>, but at present I do not see a way of gettting a sorted hierarchy with this API.
    Walter

  • Insert Value(s) in Lookup Flat Multi-valued Table with Java API

    I've been looking in MDM Java API Library Reference Guide, MDM SP4 API JavaDoc, and SDN Forums for information on how to Insert/Update different values in a field in the Main Table of a given repository that belongs to a Lookup Flat Multi-valued Table using the Java API with no success.
    I also haven't been successful in adding this values in the same way that I'll add a single value, using the MDM Java API, in a single-value Lookup Table (a2iFields.Add(new A2iField(FIELD_CODE,FIELD_VALUE)) for each value I want to add, like for example:
    a2iFields.Add(new A2iField("Country","USA")
    a2iFields.Add(new A2iField("Country","Mexico")
    a2iFields.Add(new A2iField("Country","Germany")
    Can anybody point me to the correct documentation that I need to read to fulfill this task? Or, even better, if someone can post a piece of code, I'll be more thankful.
    Thanks for your help.

    HI,
    little code example, where you add existing lookup values based on there record id:
         int USA = 1;
                        int GERMANY = 2;
                        A2iValueArray countryArray = new A2iValueArray();               
                        countryArray.Add(new Value(USA));
                        countryArray.Add(new Value(GERMANY));
                        A2iFields record = new A2iFields();
                        record.Add(new A2iField("Country", new Value(countryArray)));
    Please reward points if helpful.
    Regards,
    Robert

  • Bursting with JAVA APIs / MultiThreading / Errors Handling

    We are trying to use the bursting JAVA APIs 10.1.3.3.1 Standalone) to burst huge XML files and generate PDF Files from RTF templates. Here are a list of our issues with this feature:
    1. We have some problems catching the errors when bursting. We have tried to use the "oracle.apps.xdo.common.log.Logger" class, but it is not always reacting like we think it should. Could you please give us an exemple of a clean bursting error catching or a brief description of how we could do it. We have a lot of difficulties to find information about using the JAVA APIs of BIP.
    2. Is it a clean way of catching the bursting errors to use the "oracle.apps.xdo.common.log.Logger" class?
    3. When using the 10.1.3.3.1 DocumentProcessor JAVA API, the process gets killed when the RTF template is not where the control file specified it. Even when using a finally clause containing the document processor, we can't fetch the error from the "oracle.apps.xdo.common.log.Logger" class. We did not find a way to catch this error which make our program crash.
    4. How can we enable multi-threading that is included in the DocumentProcessor JAVA APIs so it can take advantage of the multi-processors environnements?

    1. Check tim d. blog, you can use the bursting listners to get the errors. It's also in the documentation.
    First, on every exception, the Bursting APIs are dumping the error in the Logger. So I can't see how we can use the listeners to catch these. We can check the hasExceptions on the Logger but still, we have some problems with this. When we deploy our application as a MDB (Message driven bean), it seems that once the hasException flag has been raised, if we call the MDB again, it is still up. Is there documentation about that Logger class? Also, I'm worried that we won't be able to call our MDB twice to run simultaneously 2 different bursting process since it seems the Logger is something static, keeping every exception in memory... That's bad.. And show me where you have found documentation about this. All I see in documentation is how to call the DocumentProcessor in a couple of lines. I don't see anything about a clean way to catch errors.
    2. Yes/No/Depends. I think it's fine. If your changing the logger options in your program that could come back to haunt you.
    I guess so, I'm not changing anything and its already haunting me...
    3. When using the 10.1.3.3.1 DocumentProcessor JAVA API, the process gets killed when the RTF template is not where the control file specified it. Even when using a finally clause containing the document processor, we can't fetch the error from the "oracle.apps.xdo.common.log.Logger" class. We did not find a way to catch this error which make our program crash.
    Even worst, when we deploy the component has an MDB, when the error happens, it kills the whole oc4j container... please correct this quick.
    4. How can we enable multi-threading that is included in the DocumentProcessor JAVA APIs so it can take advantage of the multi-processors environnements?
    We got an answer from the dev team which is to add two properties to the document processor, something like:
    enable-multithreading: true
    thread-count: >2
    We did that and what we got is that the process started and it got stuck in a dead lock at the first document processing. How nice! :)
    We got a milestone in March and I'm really worried about all those problems... Not enough documentation, a pretty bad error handling, errors making crash the whole oc4j container, Logger seems not to be handling simultaneous calls/ threads, not even handling two subsequent calls... etc.
    If anyone has the magic answer, it would be pretty welcomed!
    Thanks

Maybe you are looking for

  • A question about updating metadata files in plug in

    Hello I 'm trying to monitor my stand alone java app. I read the chaper Target Types and Default Collections ( my app exposes jmx beans) all seems to work ok ( i mean the part wherre it says .. emctl register oms metadata -service targetType -file fu

  • Locating Ref Cursors in SGA

    We use a lot of ref cursors. These are unnamed, explicit cursors. How can we visualize them in the SGA? None of the existing views show them, because they are unnamed. We need to be able to determine if they're open (to trap memory leaks), how much P

  • Entourage question

    Forgive me if this question is answered elsewhere. I just bought my first Mac a week ago, the mac book pro. I was reading other posts about contacts, etc and several people reference entourage.. what is that? Is that a software for mac? Sorry if this

  • Is it possible to get KM change file permissions event?

    Hi, I would like to get in my code events when file permissions are changed. Please could you answer or to advice some workaround if it's not possible? Thanks.

  • Can anyone help me with this error?

    http://prntscr.com/5uou9e Getting this error trying to use an intro template. Help?