Is it possible to change Allowed Values (csv) in a property through an API?

Hi everyone
I would like to enable end users to change the Allowed Values (csv) in a property without giving them access to the system administration > system configuration part of the portal. Actually I would like to create a simple iview which could show the list from the Allowed Values (csv) entry of a specific property and let certain users maintain the values from that iview instead of through system administration.
Do any of you know if its possible to develop this in some way? We have not been able to identify possible ways to change the Allowed Values (csv) entry through the KM API.
Any help will be awarded.
Best regards,
Martin Søgaard

Hi Martin,
This is possible..
try out below code..
public void onActionUpdateProperty(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
    //@@begin onActionUpdateProperty(ServerEvent)
     String strPropName =  wdContext.currentContextElement().getPropertyName();
     String strCurrentProp =  wdContext.currentContextElement().getCurrentProp();
     String strSelectedProp =  wdContext.currentContextElement().getSelectedProp();
     String namespace = "";
     boolean isNotSaved = false;
     //isPropertySaved = true;
     com.sapportals.wcm.service.propertyconfig.IMetaModel metaModel = null;
          //     IPropertyConfigurationService configService=null;
               IMutableConfigurable imConf = null;
                    try
                         IConfigurationAccess icAccess = Configuration.getInstance();
                         IWDClientUser wdcu = WDClientUser.getCurrentUser();
                         com.sap.security.api.IUser sapUser = wdcu.getSAPUser();
                         IUser user = WPUMFactory.getUserFactory().getEP5User(sapUser);
                         IConfigClientContext confContext = IConfigClientContext.createContext(user);
                         IConfigManager icManager = icAccess.getConfigManager(confContext);
                         IConfigPlugin icPlugin = icManager.getConfigPlugin(ConfigurationProxy.CFG_PLUGIN_CM_SERVICES_PROPERTIES_METADATA);
                         IMutableConfigurable[] mcs = icPlugin.getConfigurables();
                         String propertyUniqueID = "";
                         String propertyNameSpace = "";
                         for (int i = 0; i < mcs.length; i++) {
                           IMutableConfigurable mc = mcs<i>;
                           if (mc.getPropertyValue("property_id").equals(strSelectedProp)) {
                              propertyUniqueID = mc.getPropertyValue("unique_id");
                              break;
                         try {
                              imConf = icPlugin.getAndLockConfigurable(propertyUniqueID, 0, 0);
                              imConf.setPropertyValue("values",<b>strCurrentProp</b>);
                         } catch (RuntimeException e1) {
                                   e1.printStackTrace();
                         icPlugin.replaceConfigurable(imConf);
                    catch (Exception e)
                         wdComponentAPI.getMessageManager().reportException(e.getLocalizedMessage(), false);
                    finally
                         if (imConf != null)
                              try
                                   imConf.unlock();
                              catch (LockConfigException e)
                                   wdComponentAPI.getMessageManager().reportException(e.getLocalizedMessage(), false);
    //@@end
strCurrentProp is the value that is being set.
Regards,
Vikas

Similar Messages

  • Where it is possible to change the value separator in Custom Field?

    Hello,
    This is a question around the "Custom Fields" and "Lookup Table"
    I linked a "Custom Field" to a "Lookup Table".
    I select the option "Allow multiple values to be selected from lookup table"
    When I used this "Custom Field" in a view, the selected values are separated by a comma ",".
    Where it is possible to change this value?
    I saw another project server where the character is a semi-column ";" and I would like to test with ";".
    Thank you in advance
    Pascal Jean

    Hi,
    This will be triggered by your regional settings.
    Hope this helps,
    Guillaume Rouyre, MBA, MVP, P-Seller |
    Hello,
    Thank you for the answer.
    Do you mean the "local regional settings"?
    Because, depending on the PWA site I'm connected to I don't have the same values. I'm obviously using the same workstation.
    Regards

  • Is it possible to change the value of "maxdatafiles" after creating a db??

    Hi, all.
    Is it possible to change the value of the followings after creating a database??
    -maxdatafiles
    -maxinstances
    -maxlogfiles
    -maxlogmembers
    -maxloghistory
    Thanks and Regards.

    Hi Chris,
    Thanks for updating that but here's what in Oracle Doc:
    From Oracle Documentation (Oracle® Database New Features Guide 10g Release 2 (10.2))
    Eliminate Control File Re-Creation
    With the control file enhancements, there is no longer a requirement to re-create the control file when changes in the configuration parameters are made. These include the MAXLOGFILE, MAXLOGMEMBERS, MAXLOGHISTORY, MAXDATAFILES, and MAXINSTANCES parameters.
    This feature eliminates database downtime when a configuration parameter change is made in the control file
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14214/chapter1.htm#sthref12
    Regards

  • Is it possible to change the values of fields In Me21n tansaction?

    I Have to put in some logic to change the values of already existing Shipping condition field in the SHIPPING subscreen at the Line item level in ME21n transaction.
    I searched for the user exit to do soo. Did not find anything to do this. I would like to know if it is possible through some other way.
    thanks
    shubha

    Hi Shubha!
    You might use BAPI_PO_CHANGE. Even if there would be a user exit / BADI, then execution is not sure.
    You said: 'already existing shipping field' -> exits of a transaction are only executed during maintenance, not afterwards.
    So maybe you have to make your changes completely outside of PO.
    Still have a look at BADI ME_PROCESS_PO_CUST, there are a lot of methods and one might help you.
    Regards,
    Christian

  • Is it possible to change the PDF document on my website through in-browser editing after I've published my website?

    I've uploaded site but want to change PDF asset through in browser editing. Is this possible?

    Hi,
    It is not possible to change the PDF asset using IBE.
    Regards,
    Aish

  • Change the value of a variable used in a View query

    I am using JDeveloper 11g to develop a simple portlet application which displays data loaded from database. I am displaying the data by dragging the ViewObject from the AppModuleDataControl to the View.jspx page and selecting the option ADF Read-only Table. My ViewObject has a single variable :empId. Now is it possible to change the value of this variable with a value that comes from the request object. On the internet I found the following code:
            FacesContext facesContext = FacesContext.getCurrentInstance();
            Application app = facesContext.getApplication();
            ExpressionFactory elFactory = app.getExpressionFactory();
            ELContext elContext = facesContext.getELContext();
            ValueExpression valueExp =
            elFactory.createValueExpression(elContext, "#{data.AppModuleDataControl.dataProvider}",
            Object.class);
            ApplicationModule am = (ApplicationModule)valueExp.getValue(elContext);
            ViewObject emplVO;
            emplVO = am.findViewObject("EmployeeView1");
            emplVO.setNamedWhereClauseParam("empId", "1");I have put this code in the public void processAction(ActionRequest request, ActionResponse response) method. However this does not work when I deploy it.
    Does anyone know if the above code is correct in this case and if there is a better way how I can set this up?

    Hi there:
    Did you add a break point and debug the code to see what is the value for the :empid parameters passed in to your view object?
    If you are sure you have passed in the correct value for ":empid" parameter, then do the following:
    String amDef = "yourAmDef";
    String config = "yourConfig";
    ApplicationModule am =
    Configuration.createRootApplicationModule(amDef,config);
    ViewObject emplVO;
    emplVO = am.findViewObject("EmployeeView1");
    emplVO.setNamedWhereClauseParam("empId", "1");
    empVO.executeQuery();
    which will execute your view object with the new bind variable value and refresh the view.
    Please mark my answer as 'Correct' if it solves your problem, or 'Helpful' if it does.
    Thanks,
    Alex
    Edited by: Alexbie on 27-Aug-2010 8:52 AM

  • How to change the value in an Integer object?

    Hi,
    Is it possible to change the value that is contained in an Integer object.
    I know Integer objects are immutable. So it might not be possible to chage to value in an integer object once its been initalized a value @ the time of construction.
    Also does autoboxing and unboxing feature of 1.5 help acheive this?
    Please let me know of any other alternative
    Thanks
    Deepak

    Tried the autoboxing and unboxing feature doesnt
    help.It doesn't help in general. But in this special case it doesn't help because it doesn't anything to do with it. Do you really know what you're doing?
    So across the function its not changing the value.
    As I have created an object of Integer class and
    passed a reference of that object into the chage()
    ,So any changes should have been reflected
    acrosss method calls.?Since you let the newly created parameter-reference a point to a new Integer object: no. Why? You have two references to I(31). Then you move one reference to I(33). Why should 31 get another value?
    Does the the java compiler creates a new Integer
    object each time it does autoboxing Not necessarily. Some values are pooled. Actualy, the JVM does it. The compiler never creates any object.
    so that the value
    is lost across method calls?That's not the compiler's or the JVM's fault. It's all a misconception of yours.
    Is there any means to achieve this?What for?
    int a = 0;
    a = change(a);
    int change (final int i) {
      return i + 12;
    }Does exactly what you want, without side-effects.

  • Change "choiseListe" values with javascript

    Dear,
    Is it possible to change "choiseListe"  values  with javascript.
    Exemple il have a choseListe :
         Country //// Values
          USA            us
          France         fr
          Spain           sp
    When il click in a botton i whant to change this choceListe :
         Country //// Values
          Morocco           ma
         Portugal           pt
    Thanks

    Hi,
    Listboxes and dropdowns can be scripted against without too much difficulty.
    You would need something like this in the click event of the button:
    listbox1.rawValue = null; //clear previous choice
    listbox1.clearItems(); //clear the list items
    listbox1.addItem("Moocco", "ma"); //add new list items
    listbox1.additem("Portugal", "pt");
    Hope that helps,
    Niall

  • Is it possible to Change the pooling interval time in XI3.0 or XI3.1

    Hi,
    For every 15 sec the CMS will check the scheduled jobs status and act accordingly ,by default the value will be 15 sec now We want to change the pooling interval time to 1 min.
    -- Where do i have to change the pooling interval time.
    -- Is it possible to change the value or not.
    Please help..
    Thanks.

    Hi Collin,
    Could you le me know the resolution
    Regards
    Alan

  • How to change the value of a Wrapper object?

    Is there any way to change the primitive value inside a wrapper class object like Boolean?
    Or else if its not possible any work arounds are available?
    Thanks

    No it is not possible to change the values, they are 'imutable'.If you want mutable versions then it is simple enough to write your own! You can use the source of Boolean etc as a starting point!

  • Retrieving Allowed Values of a property.

    Hi,
    I created a custom property and have like 5 or 6 values assigned to it.
    From the API, as mentioned below, I could only find a way to get these values if they are set to a resource and if the property is a multi-valued.
    String namespace = "http://com.sap.netweaver.bc.rf.sample/xmlns/sample";
    String name = "property";
    IPropertyName propertyName = new PropertyName(namespace, name);
    IProperty property = resource.getProperty(propertyName);
    if( property.isMultivalued() ) {
        // property is multi valued
        List values = property.getValues();
    If the property is not Multi-Valued and not set to a resource, is there any way to retrieve all the "Allowed Values" for that particular property.
    I appreciate if anyone can throw some light on it.
    Thanks,
    Ravi.

    You might not need all this code (depending on what you are doing, and what items you may already have),
    the part relevant to fething the allowed values is at the bottom:
    IResource fileresource=//however you're getting it.
    IPropertyConfigurationService propConfigService = (IPropertyConfigurationService) ResourceFactory.getInstance().getServiceFactory().getService(
    "PropertyConfigurationService");
    IMetaModel mm = propConfigService.getMetaModel();
    metaContext = mm.createEmptyMetaContext();
    metaContext.setResource(fileresource);
    metaContext.setResourceContext(fileresource.getContext());
    IMutablePropertyMap propertymap = fileresource.getProperties().getMutable();
    metaContext.setPropertyMap(propertymap);
    propName = new PropertyName("yourNamespace", "yourPropertyName");
    IMetaName metaname = propConfigService.getMetaModel().searchByPropertyName(propName);
    IMetaValueListIterator iml = metaname.allowedValueIterator( metaContext );
    while (iml.hasNext()) {
         IMetaValue vl = iml.next();
         String myvalue = vl.getValue();
    //... do something with it
    [email protected]

  • How to get all the allowed values of a property?

    Hi all,
    I want to read all the allowed values of a property. I have created a new custom property and given 3 values as allowed values.
    What i want to do is programtically read all the allowed values of that particular property.
    Regards
    Rajeev

    Hi guys,
    I'm trying to do exactly the same, i need a list with all the KM properties, i'm using the very same code thar Romano putted on his post, and i'm getting this:
    InitialConfigException: The configuration service locator could not be initialized for any of the environments. The configuration framework is not available.#
    On this sentence:
    IConfigurationAccess icAccess =  Configuration.getInstance();
    I'm developing a  Webdynpro application on server A and i'm using the KM libraries through an EJB inside a Webservice on server B.
    Do you have any suggestions?
    Thanks in advance

  • Changing the Default meta data field property required into not required.

    Hi,
    Is it possible to change the default meta data field property values in UCM server.
    For example consider the meta data Revision field which property required is true, then how to change this property required into not required.
    Is this possible or not?
    Thanks
    Hari

    Hari,
    in your case (if you don't want to use versioning) I'd rather recommend to change it to hidden than not required. You should be able to do it with standard profiles (the field name, I believe, is dRevision)
    I don't think you can have the field empty (in case someone deletes the content).

  • Is it possible to monitor State change of a .CSV file using powershell scripting ?

    Hi All,
    I just would like to know Is it possible to monitor State change of a .CSV file using powershell scripting ? We have SCOM tool which has that capability but there are some drawbacks in that for which we are not able to utilise that. So i would like
    to know is this possible using powershell.
    So if there is any number above 303 in the .CSV file then i need a email alert / notification for the same.
    Gautam.75801

    Hi Jrv,
    Thank you very much. I modified the above and it worked.
    Import-Csv C:\SCOM_Tasks\GCC2010Capacitymanagement\CapacityMgntData.csv | ?{$_.Mailboxes -gt 303} | Export-csv -path C:\SCOM_Tasks\Mbx_Above303.csv;
    Send-MailMessage -Attachments "C:\SCOM_Tasks\Mbx_Above303.csv" -To “[email protected]" -From “abc@xyz" -SMTPServer [email protected] -Subject “Mailboxex are above 303 in Exchange databases” -Body “Mailboxex are above 303 in Exchange databases" 
    Mailboxex - is the line which i want to monitor if the values there are above 303. And it will extract the lines with all above 303 to another CSV file and 2nd is a mail script to email me the same with the attachment of the 2nd extract.
    Gautam.75801

  • Is it possible to programmatically change the value of a LV8.2 project symbol at runtime?

    I need to programmatically change what a conditional disable structure will execute at runtime. (See this thread for more details if you're interested.)  As far as I can tell the only way to do this is to change the value of a project symbol at runtime.
    I've tried to find a property that allows me to do this but so far it eludes me.
    Anyone know how to do it?
    Troy
    CLDEach snowflake in an avalanche pleads not guilty. - Stanislaw J. Lec
    I haven't failed, I've found 10,000 ways that don't work - Thomas Edison
    Beware of the man who won't be bothered with details. - William Feather
    The greatest of faults is to be conscious of none. - Thomas Carlyle

    This is definetly not possible. When the conditional disable structure is compiled, only the actual case is compiled. The other cases don't even have to have valid code, they can have broken wires or bad VI's in them!
    Like Mike suggested, you need to load VI's that do the task dynamically.
    Regards,
    Wiebe.

Maybe you are looking for

  • Failed to start hibernate.target: Access denied

    I upgraded my machine yesterday and  the Hibernate item in kmenu->Leave are missing. also "systemctl hibernate" dont work: $ systemctl hibernate Failed to execute operation: Sleep verb not supported Failed to start hibernate.target: Access denied log

  • I want to create a new Apple ID and delete my old one, what about my purchases?

    I've purchased some subscriptions that I did not mean to and I would not like them to show up on my iTunes purchase history. While I know we can hide the app from saying purchased, the subscriptions seem to be under my account permanently, even the e

  • Change sold to party in sales order

    hi all. can anyone help me out in changing the sold to party in sales order where can we change Thanks sridhar

  • Idle in transaction

    Hi to everyone, My situation With Netbeans 6.1 I developed a java application to manage data which uses jre 6u7 and jdbc4 to connect to a postgres 8.2.5 database, in the code I use entity manager and persistence unit. All fine, BUT apparently randoml

  • Avoid users can change Short Text of Material Id in Purchase Requisitions

    Hi We have a problem with purchase requisitions. Users create a purchase requisition. In the field material,   type the ID of the Material but then, change the description in Short Text, for example Material 1000 is a Bearing, and the user can change