How to use ADD_METADEF to add a custom metadata field

Hi All,
I am trying to add a custom metadata field to check in profile, and this I want to do using RIDC library through my java program. I have tried the following code, but some how I could not see its getting added to Information Fields and also to Standard check in profile.
Can you let me know what am I missing?
            myIdcClient = myIdcClientManager.createClient("idc://XXXX:4444"); // just commented out
            IdcContext myIdcContext = new IdcContext("weblogic", "weblogic1");
            ServiceResponse myServiceResponse = null;
              DataBinder myRequestDataBinder = myIdcClient.createBinder();
                myRequestDataBinder.putLocal("IdcService", "UPDATE_OPTION_LIST");
                myRequestDataBinder.putLocal("dKey", "xLocationList123");
              myRequestDataBinder.putLocal("OptionListString", "Madrid\nTokyo\nLondon\nWashington");
                myServiceResponse = myIdcClient.sendRequest(myIdcContext, myRequestDataBinder);
                myRequestDataBinder = myIdcClient.createBinder();
                myRequestDataBinder.putLocal("IdcService", "ADD_METADEF");
                myRequestDataBinder.putLocal("dName", "xLocations123123");
                myRequestDataBinder.putLocal("dIsRequired", "0");
                myRequestDataBinder.putLocal("dOptionListKey", "xLocationList123");
                myRequestDataBinder.putLocal("dOptionListType", "choice");
                myRequestDataBinder.putLocal("dIsOptionList", "1");                    
                myRequestDataBinder.putLocal("dIsSearchable", "1");
                myRequestDataBinder.putLocal("dIsEnabled", "1");
                myRequestDataBinder.putLocal("dType", "Text");
                myRequestDataBinder.putLocal("FieldName", "xLocations123123");
                myRequestDataBinder.putLocal("dCaption", "Locations");
                myServiceResponse = myIdcClient.sendRequest(myIdcContext, myRequestDataBinder);
                myRequestDataBinder = myIdcClient.createBinder();
                //IdcService=UPDATE_META_TABLE
                myRequestDataBinder = myIdcClient.createBinder();
                myRequestDataBinder.putLocal("IdcService", "UPDATE_META_TABLE");
                myServiceResponse = myIdcClient.sendRequest(myIdcContext, myRequestDataBinder);
                myRequestDataBinder = myIdcClient.createBinder();
                myRequestDataBinder.putLocal("IdcService", "START_SEARCH_INDEX");
                myRequestDataBinder.putLocal("IsRebuild", "1");
                myServiceResponse = myIdcClient.sendRequest(myIdcContext, myRequestDataBinder);
                myRequestDataBinder = myIdcClient.createBinder();
                myRequestDataBinder.putLocal("IdcService", "PUBLISH_SCHEMA");
                myServiceResponse = myIdcClient.sendRequest(myIdcContext, myRequestDataBinder);
Thanks in advance.

Try calling the following code:
import static intradoc.shared.MetaFieldUtils.hasDocMetaDef;
import static intradoc.shared.MetaFieldUtils.updateMetaDataFromProps;
import intradoc.common.ServiceException;
import intradoc.data.DataBinder;
import intradoc.data.DataException;
import intradoc.data.Workspace;
    protected static void addMetadataFields(final Workspace workspace, final DataBinder binder) {
        traceVerbose("Start addMetadataFields");
        // Parameters for metadata field
        final String[] parameters = new String[] { "dsdComponentName", "dComponentName", "dsdVersion", "dType", "dIsRequired", "dIsEnabled", "dIsSearchable", "dIsOptionList", "dOptionListKey", "dOptionListType", "dDefaultValue", "dOrder", "dIsPlaceholderField", "dsdCheckFlag",
                "dsdDisableOnUninstall" };
        // Common values for primary and alternate field values
        final String[] values = new String[] { "ComponentName", ComponentName, "build_1_20131206", "BigText", "0", "1", "1", "0", "", "", "", "2500", "0", "", "" };
        // Primary file checksum field parameters and values
        final Properties field = new Properties();
        for (int i = 0; i < parameters.length; i++) {
            field.put(parameters[i], values[i]);
        // Setup primary file specific parameters
        field.put("dName", "Metadata field name");
        field.put("dCaption", "Metadata field caption");
        try {
            // Name of metadata field
            final String fieldName = field.getProperty("dName");
            trace("dName: " + fieldName);
            if (fieldName != null && fieldName.length() > 0 && !hasDocMetaDef(fieldName)) {
                try {
                    updateMetaDataFromProps(workspace, null, field, fieldName, true);
                    trace("Successfully added metadata field " + fieldName);
                } catch (final ServiceException e) {
                    warn("Metadata field " + fieldName + " was not installed.", e);
                } catch (final DataException e) {
                    warn("Metadata field " + fieldName + " was not installed.", e);
            } else {
                trace("Metadata field already exists; will not modify");
        } finally {
            traceVerbose("End addMetadataFields");
Jonathan
http://jonathanhult.com

Similar Messages

  • How to use *MonitorManager* to add custom messages in channel monitoring?

    Hi experts,
    How to use MonitorManager to add custom messages in channel monitoring for custom adapter development(Not in audit log).
    like
    Type   Time Stamp   Message ID   Explanation 
      6/25/11 6:39:47 AM 00199942-6e43-02df-96ca-8b538c63dd98 Message processing completed successfully
      6/25/11 6:39:47 AM 00199942-6e43-02df-96ca-8b538c63dd98 Message with ID 00199942-6e43-02df-96ca-8b538c63dd98 processed
      6/25/11 6:39:46 AM 00199942-6e43-02df-96ca-8b538c63dd98 Message processing started
      6/24/11 6:43:26 AM 00199942-6e43-02ef-96b1-7650f3495e03 Message processing completed successfully
      6/24/11 6:43:26 AM 00199942-6e43-02ef-96b1-7650f3495e03 Message with ID 00199942-6e43-02ef-96b1-7650f3495e03 processed
      6/24/11 6:43:24 AM 00199942-6e43-02ef-96b1-7650f3495e03 Message processing started
      6/23/11 6:45:52 AM 00199942-6e43-02df-9698-5be345a9ddf5 Message processing completed successfully
      6/23/11 6:45:52 AM 00199942-6e43-02df-9698-5be345a9ddf5 Message with ID 00199942-6e43-02df-9698-5be345a9ddf5 processed
      6/23/11 6:45:50 AM 00199942-6e43-02df-9698-5be345a9ddf5 Message processing started
      6/22/11 6:43:30 AM 00199942-6e43-02ef-95ff-2c03493dc078 Message processing completed successfully
    Edited by: SAP_PI_D on Jun 28, 2011 12:10 PM

    Solve by myself

  • How to use the bind variable in custom.pll

    Hi,
    How to use the bind variable in custom.pll.Its through error.
    any one gem me.
    very urgent.
    M.Soundrapandian.

    Hello,
    Please, ask this kind of questions in the e-business forum.
    Francois

  • How to use standard function keys as custom keys

    how to use standard function keys as custom keys.
    i have encountered that problem while developing a screen, there i'm supposed to use standard function key F2 ( which actually meant for choose) for clearing the screen fields where the cursor is present and f1 for saving data that entered in screen fields, etc...
    kindly help me out.

    Hi ,
    Solution to use SAP reserve function keys F1 .. F4 (mostly this requirement comes up for RF screens) can be acheived by assigning your new Function code using the Menu path Utilities --> F key Consistency in the Menu Painter (SE41) . Once you assign your cutom function code to the standard Fn keys the only remaining step is to make sure that you set a curson on any of the field on sceen by using the Key Word "SET CURSOR" .
    If you dont use the key word SET CURSOR in the PBO of the screen then you might not see any response for F4.
    Thanks

  • How to use two dimensional array in custom.pll

    HI
    How to use two dimensional arrays in custom.pll
    I tried by the following way .
    type ship_array is table of number index by binary_integer;
    type vc_array is table of ship_array index by binary_integer;
    But I am getting the error as that
    A plsql table may not contain a table or a record with composite fields.
    Please tell me the way how to use them

    which forms version are you using? two dimensional arrays are available in >= 9i if memory serves.
    regards

  • How to use BAPI to add a new version for a claim number in WTY transaction.

    How to use BAPI to add a new version for a claim number in WTY transaction.
    I am using  function module " BAPI_WARRANTYCLAIM_ADD_VERSION ".
    It needs to copy all contents of previous version to a new version.
    While doing so i am unable to copy fields like valic valoc etc. Any ways by which  i can copy this values.
    WTY will update PNWTYH , PNWTYV and PVWTY tables.
    Thanking you,
    Lokesh.

    Hi Vishnu,
    You can do that through EEWB. Please go through SAP Note 484597. You would get the details of using Easy Enhancement Work bench.
    Rewards point if you think this info is useful
    Regards,
    Dipender Singh

  • How to use advertisements and announcments in Customer UI iStore?

    hi,
    How to use advertisements and announcments in Customer UI iStore?
    Regards,
    Ashish

    Please check
    How To Setup And Use Tracking With Campaign Workbench Web Advertising Schedules (Doc ID 303508.1)

  • How to add a new metadata field to iPhoto where new field is calculated as age in years and month based on a specific date and the date photo was taken ? I want to calculate and display the age of my two kids on every photo.

    Hi
    How can I add 2 new metadata-fields to every photo in iPhoto ?
    The new fields should state the age of my kids in years and months based on the date that they were born and the date that photo is taken.
    Exampel:
    My son is born 01.01.2010
    My daughter is born 01.01.2012
    Photo taken by data
    Aage of son
    Aage of daughter
    01.07.2011
    1 year 6 month
    not born yet
    01.01.2014
    4 year 0 month
    2 year 0 month
    I would like to be able to search by kids age and get the info displayed when doing slideshows.
    How to do this in iPhoto ?
    Any alternatives to accomplish the same ?
    Kind regards

    It can't be done with iPhoto.  There are some DAM (digital asset management) applications that can write to other IPTC fields that iPhoto can't read. One such app is Media Pro 1.
    However you would have to calculate the age for each date and add it to one of the fields. There are online age calculators that can do that for you: Age Calculators
    If you go thru that much trouble then use iPhoto, make the calculations and add the age to the Description field.  Then you can use Smart Albums to search for 1year 6 month text.
    OT

  • How to rename Custom Metadata Field?

    I have some pics with custom metadata field "gadget brand", i with to rename the field name to "brand", how can i do that? I tried to rename in the custom metadata manager, but it doesn't apply the change.

    Don't believe you it will allow you to rename it.
    You're going to have to create a new field with the name you want and copy the data over. Unfortunately Aperture doesn't have any built in means of copying metadata from one field to another. Applescript however could do it fairly easily.

  • How to export custom metadata fields

    How do I export custom metadata fields (or even the DATE) to a text or spreadsheet? Why does Aperture have dozens of metadata choices, but only allows a few to be exported?

    You can try Automator which must be installed already in your computer. Create a new workflow, on the left pane select Aperture to see a list of actions, select "get selected items" and "extract metadata", and drag both to the right most pane. there you'll choose the Tag names to extract from the images already selected inside aperture and choose an output method, tabbed text should work fine for a spreadsheet. Hope it works.

  • How to hide custom metadata field in custom profies ??

    hi,
    how to hide custom metadata dropdown list in a custom profile based on choosing the security group.
    ex: if i choose xxx security group, custom metadata dropdown should not appeared, for remaining security groups it should be visible.
    so, Based on criteria, custom metadata should be hidden in custom profiles..
    how to achieve it ?? where and how to configure ??
    Detail guidance should be required
    Thanks in advance

    You cannot do this through profiles alone if I understand you correctly.
    If I load a check in page, choose a security group and at this moment want a custom metadata field to disappear then you are beyond what profiles offers.
    Rules evaluation can only be based on information that is know at the time the page is requested. That means in order for this to work you would need to make security group an non editable field and have a set of profiles for each security group.
    The alternative is to customize the UI with soem DHTML or AJAX
    Tim

  • Select Button beside custom metadata field on Check In Form

    Hi
    In Oracle Content Server 10gR3, is there a way to add a "Select" button to User Alias Applet for a new Meta data field on New Check In Form? I tried creating a component but I don't see a select button being shown up. The button does shows up if it's a standard metadata fields but not for the custom one. Here is the component code. Any idea what I am doing wrong and how to fix it.
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>
    CustomMetaData htmlIncludeOrString
    </title>
    </head>
    <body>
    <@dynamichtml std_meta_fields@>
    <textarea name="xClbraAliasList" rows=3 cols=40 wrap=virtual></textarea>
    <input type="button" value="Select..."
    onClick="popupSelectAlias(document.Checkin);">
    <script language="JavaScript">          
         var aliasForm;
         function popupSelectAlias(frm)
              var selUser = document.selectAliasApplet;
              aliasForm = frm;
              selUser.createFrame();
         function setAliasString(val)
              if (val.length == 0)
                   return;
              var str = aliasForm.xClbraAliasList.value;
              str.trim;
              if (str.length > 0)
                   str += ",";
              str += val;
              aliasForm.xClbraAliasList.value=str;
         </script>
         <applet name="selectUserApplet"
        code=com.intranetsol.utilities.SelectUserApplet.class
          codebase="/idc/common/"
         archive=suapplet.zip
        id=selectUser
        width=0
        height=0
         MAYSCRIPT>
              <param name=CGI-URL value="/idc/idcplg">
              <param name=JsDisplaySeparator value=",">
              <param name=IsPaged value="1">
              <param name=IsUserList value="1">
              <param name=JsFunction value="setUserString">
    </applet>
    <applet name="selectAliasApplet"
        code=com.intranetsol.utilities.SelectUserApplet.class
          codebase="/idc/common/"
         archive=suapplet.zip
        id=selectAlias
        width=0
        height=0
         MAYSCRIPT>
              <param name=CGI-URL value="/idc/idcplg">
              <param name=JsDisplaySeparator value=",">
              <param name=IsPaged value="1">
              <param name=IsAliasList value="1">
              <param name=JsFunction value="setAliasString">
    </applet>
    <@end@>
    </body></html>
    Then I tried using the same code as above but instead used the built-in dDocType to show a "Select" button. This works but the button obviously shows besides dDocType but when I try for custom metadata as shown above it doesn't. Here is the sample code for dDocType:<html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>
    CustomMetaData3 htmlIncludeOrString
    </title>
    </head>
    <body>
    <@dynamichtml std_doc_page_definitions@>
    <$include super.std_doc_page_definitions$>
    <$include custom_modify_comments_definitions$>
    <@end@>
    <@dynamichtml custom_modify_comments_definitions@>
    <$if isCheckin$>
    <$xComments:isHidden = 1$>
    <$xComments = "some preset and hidden comments"$>
    <$elseif isUpdate$>
    <$xComments:isInfoOnly = 1$>
    <$endif$>
    <@end@>
    <@dynamichtml compute_std_field_includes@>
    <$include super.compute_std_field_includes$>
    <$if fieldName like "dDocType"$>
    <$if isCheckin or isUpdate$>
    <$fieldEntryInclude = "custom_doc_type_popup_field_entry"$>
    <$endif$>
    <$endif$>
    <@end@>
    <@dynamichtml custom_doc_type_popup_field_entry@>
    <input type="text" name="dDocType" value="<$fieldValue$>">
    <input type="button" value="Select..."
    onClick="popupSelectAlias(document.Checkin);">
    <script language="JavaScript">          
         var aliasForm;
         function popupSelectAlias(frm)
              var selUser = document.selectAliasApplet;
              aliasForm = frm;
              selUser.createFrame();     
         function setAliasString(val)
              if (val.length == 0)
                   return;
              var str = aliasForm.xClbraAliasList.value;
              str.trim;
              if (str.length > 0)
                   str += ",";
              str += val;
              aliasForm.xClbraAliasList.value=str;
         </script>
    <applet name="selectAliasApplet"
    code=com.intranetsol.utilities.SelectUserApplet.class
         codebase="/idc/common/"
         archive=suapplet.zip
    id=selectAlias
    width=0
    height=0
         MAYSCRIPT>
              <param name=CGI-URL value="/idc/idcplg">
              <param name=JsDisplaySeparator value=",">
              <param name=IsPaged value="1">
              <param name=IsAliasList value="1">
              <param name=JsFunction value="setAliasString">
    </applet>
    <@end@>
    </body>
    </html>
    Can someone please let me know what is in my above code that I am missing that is preventing the button not being shown in-front of the custom metadata field.
    Any help would be greatly appreciated.
    Thanks
    Edited by: guest0012 on Aug 29, 2009 4:24 PM

    Interesting!
    You'll need a component. You already mentioned you had a custom metadata field. You will also need to add a counter to the counters table for your component. During a check in you will need to fetch the next value from the counters table, increment the counter and store the new number back in the table. The year portion of the id is easy, get the current year and grab the last two characters. Then, put this all togther to get the data for your metadata field.
    The big question now is where in the check in process will you do all this? You will need something called filters probably. Maybe addFiles, maybe validateStandard, there are several that this could work with.
    Check out the how-to-components:
    http://www.oracle.com/technology/products/content-management/ucm/samples/index.html
    -Jason
    http://www.corecontentonly.com

  • Custom metadata field with autonumbering sequence

    I have created a custom metadata field and I need it to be able to start a zero and then increase by one with each checkin. There were other qualifications for this particular field as well, which I have managed to do. Currently, the field is V99_99999 where V is a constant, and the 99 immendiately after the V is the current two digit year. all that works great. the issue I am having is with the second half of this. I have it going against the content_id currently, which is at 003856 right now, so when I check in my first content, it will look like V09_003857. what I need it to look like is V09_00001 and then increase by one with each checkin, and then for the really tricky part...when the year changes, on Jan 1, the counter needs to start over at all zeroes again.
    I am fairly new to UCM and this seems huge to me. I purchased a book called "The Definitive Guide to Stelelnt Content Server Development" hoping to find the answer, but am still struggling, so I am using another life line and reaching out to you all.
    Thanks,
    Patti

    Interesting!
    You'll need a component. You already mentioned you had a custom metadata field. You will also need to add a counter to the counters table for your component. During a check in you will need to fetch the next value from the counters table, increment the counter and store the new number back in the table. The year portion of the id is easy, get the current year and grab the last two characters. Then, put this all togther to get the data for your metadata field.
    The big question now is where in the check in process will you do all this? You will need something called filters probably. Maybe addFiles, maybe validateStandard, there are several that this could work with.
    Check out the how-to-components:
    http://www.oracle.com/technology/products/content-management/ucm/samples/index.html
    -Jason
    http://www.corecontentonly.com

  • Get value based on column names for custom metadata field of Webcenter Content

    In UCM, I created a custom metadata field of type Text.  I then enabled optlist in that field.  I populate values to the optList, I am using a View.  The View has three columns.  Let us call them ID, Key, Value.  OptList displays the Keys in its list.  I then create a Content (Content ID: MyContent) in Webcenter Content and choose values from OptList for my new metadata field (MyField).
    From Webcenter Portal, I am populating a selectOneChoice with values of MyField in the Content ID: MyContent.  Remember from previous step, the values populated in selectOneChoice is the list of values selected from optList field MyField.  This optList is in-turn populated from View.  After the user selects a value in selectOneChoice, in Javascript, I need to alert a message in this format "value chosen - corresponding value from View of optList that populates MyField"
    I think an example will be useful:
    Here is a View that I created in Configuration Manager applet in Admin Applets of Webcenter Content:
    ID | State | Capital
    1 | North Carolina | Raleigh
    2 | California | Sacramento
    3 | Illinois | Chicago
    Then, I create a Custom Field (Name: MyField).  MyField is an optList the values are populated from View created above.  The internal value and display value are both State.  Then I Check-In a new content with Content Id: MyContent.  For MyContent, I select these values from OptList for MyField: {North Carolina, Illinois}.
    In my Webcenter Portal application, I create a Content Presenter Taskflow.  I configure it as a single item content presenter.  I assign MyContent as Content Id.  Then, in templateView, I get all values of MyField in MyContent and display them as selectOneChoice.  I created a javascript function that would get the value that user selected in selectOneChoice.  In the View created in Webcenter Content's Configuration Manager (above), there is a value corresponding to each value displayed.  So, for the selected value, I need to get the corresponding Capital and display it in my alert message.
    From Javascript, how can I get the value of Capital, given I have the value of State.

    Hi.
    The idea to achieve your requirement is next:
    Create a helper manage bean that will be call as Map access: #{stateUtil['Calofironia']} (it will return Raleigh). This value will be get calling GET_SCHEMA_VIEW_VALUES IDC service using RIDC in your manage bean.
    Pass the result of #{stateUtil['statename']} to your JavaScript function using <af:clientAttribute.../>
    I hope this information help you.
    Regards,

  • Retrieve a list of different values of custom metadata field of an UCM connection

    Hi
    I am planning to create a custom search document functionality for my UCM and Portal integration. Basically, I am planing to create CMIS queries dynamically. In order to create the CMIS query, I need the possible values of custom metadata for the user to select from and through a backing bean construct the cmis query based on this selection.
    I have created a custom metadata field (lets say, 'KindOf'). So I want to show the user a list of all possible 'KindOf' values, so user selects the values he wants and I use those values to build the cmis query and show the results.
    What is the easiest, best practices, how would you do it, way of achieving this?
    I have little experience with UCM.
    Regards

    Hi,
    As rightly pointed out by jiri machotka, you want that option list .
    if you create a option list metadata, you have to publish schema to get the values. You can do it by two ways:
    1) Wait for the event which publish the schema automatically.
    2)Select "Publish schema" in the options menu of the Configuration Manager.
    Some good implementation info about searching can be found at - Students at Oracle: UCM: Creating search and check-in profiles with custom metadata
    and http://www.slideshare.net/heikim/effective-strategies-for-searching-oracle-ucm
    Otherwise if you want faceted search or something near to enterprise searching capabilities, then go for enterprise search engines.
    I have recently worked on Enterprise Search Engines on various CMS products for better,intuitive and relevant search results.
    Hope, above information can help you out.
    Regards,
    Hoque

Maybe you are looking for