Set the values of metadata properties from java

Hi everybody,
I created a metadata property "Category" in System Admin - System Config - KM - Global Services - Property Metadata.
My requirements:
When a user creates a document (upload or new txt file, etc.) in folder X the value of this metadata propery should also automatically be set to value X. So that the user doesn't need to set this value himself.
This way we can have more reliability on the accuracy of the metadata of this field.
Can anybody help me on how to set this property automatically in the screen for the creation of upload of a new file?
Thanks
Kind regards
Wouter

Hi Robert,
It's been a while but I'm back
We finally decided which way to go for this development (as it was on hold untill now) and we decided to go with the KM Repository service.
I already started implementing this service and So far it reacts on the creation of new documents (CREATE_CHILD event).
public void received(IEvent event)
   try{
       if(event instanceof IResourceEvent)
          IResourceEvent resevent = (IResourceEvent)event;
          switch(resevent.getType())
             case ResourceEvent.CREATE_CHILD:
                     IResource res = resevent.getResource();
                     break;
The resource (res) I get from the resourceEvent (resevent) is the parrent resource of the newly created resource. What I need is the newly created resoruce itself.
Do you happen to know if there is an interface or method somewhere through which I can get access to this new resource?
Otherwise the only way to do this would be to loop over the children of the parent folder and get the newest one. But this would just kill the performance as the folders keep on growing...

Similar Messages

  • Setting the value of a textbox from another page

    Hi Everyone,
    I have a multi paged application (multiple xib, multiple controllers)
    In my selection view, the view that holds the UIViewPicker control, I need to populate the page that called the selector page...
    I have the code to identify what page called the selector, and when the page is dismissed, I need to fill in the field from the calling page.
    I have included the header of the calling view in my selector view, and now I need to be able to fill in a readonly textbox in the calling view....
    Do I need to setup a property for each of the textboxes in the calling view, or can I populate them directly??
    thanks
    tony

    alt-088 wrote:
    I am sorry, but I am lost in this implementation....
    How exactly do I tell the self.parentViewController what control will receive the new text value??
    Ooooops!! I'm the one who needs to be sorry, Tony:
    // from previous post
    - (void)setTextInParent:(NSString* textValue) {
    // assume that every possible parent controller has a "textbox" object
    // which is a member of some class that has a writable 'text' property
    [previousViewController setValue:textValue forKey:@"text"]; // <-- * Idiot alert *
    Looks like another one of my senior moments. As you pointed out, we need the value of the 'textBox' property before we can set the value of the 'text' property.
    To your question on how I am displaying the second view, it is called via
    [self presentModelViewController:screen animated:YES]
    from a button click event
    Cool. That means we already have the address of vc1 in the 'parentViewController' ivar of vc2, so we don't need to add the 'previousViewController' ivar shown in my example.
    So here's a corrected and maybe more relevant example--this one has been tested (Duh!), btw:
    - (IBAction)done {
    // get the currently selected string
    NSInteger row = [pickerView selectedRowInComponent:0];
    NSString *selection = [dataArray objectAtIndex:row];
    NSLog(@"%s: selection=%@", _func_, selection);
    // set text in textBox property of parent controller
    [self.parentViewController setValue:selection forKeyPath:@"textBox.text"];
    [self dismissModalViewControllerAnimated:YES];
    I have tried to implement this code
    [self.parentViewController setValue:21 forKey:@"test"];
    but it is generating an error stating
    passing argument 1 of 'setValue:forKey:' makes pointer from integer without a cast
    Yeah, referring to the doc, [setValue:forKey:|http://developer.apple.com/iphone/library/documentation/Cocoa /Reference/Foundation/Protocols/NSKeyValueCodingProtocol/Reference/Reference.html#//appleref/occ/instm/NSObject/setValue:forKey:] wants an id type (pointer to an object of any Obj-C class) for the first arg. Since 21 is an int, i.e. a scalar value, the compiler doesn't like it (and the runtime system would like it even less).
    However when you want to use KVC to set a scalar property, the methods are actually smart enough to extract an int if you provide a NSNumber object (see "Setting Attribute Values Using Key-Value Coding" under [Key-Value Coding Fundamentals|http://developer.apple.com/iphone/library/documentation/Cocoa/Conc eptual/KeyValueCoding/Concepts/BasicPrinciples.html#//apple_ref/doc/uid/20002170 ] in the Key-Value Coding Programming Guide). So if 'test' is an int ivar of the parent controller, something like this should work:
    [self.parentViewController setValue:[NSNumber numberWithInt:21] forKey:@"test"];
    Does that cover your questions? Sorry again for the bad code. Most of the examples I post are pasted directly from working, tested code, and I usually add a disclaimer if it's just something I keyed into the forum. But when I"m having a senior moment all bets are off.
    - Ray

  • Can you set the value of a div from a select statment?

    Hi all
    I have a div that is used as Tool tips for a cell in a table, is there an easy way to set the text in that div to the result of a select statement?
    Appreciate the Help
    LT

    select ename, '<div '||style||'>'||htf.escape_sc(description)||'</div>' description
    from some_table
    was this what your asking. You need to not escape special characters so the div tag acts as HTML in your report. The data is escaped using a PL/SQL function.
    Is this what your asking?
    Mike

  • How to set the value in SelectManyChoice

    Hi,
    My problem is i m trying to set the value which is coming from the Iterator in select may choice as:
    DCIteratorBinding viewReportIter = getBindingsForDCB().findIteratorBinding("SelectedSQIRSuppliersVO1Iterator");
    ArrayList list = new ArrayList();
    Row datRow = viewReportIter.getRowAtRangeIndex(0);
    programDesc = datRow.getAttribute(1).toString();
    list.add(programDesc);
    suppliers.setValue(list.toString());
    but is is not set the value.
    Is there any other method to set the value.
    Thanks,
    Neha

    Passing array in selectedindices
    To select default value as ALL the following code is used .
    int rowCount = (int)vo.getEstimatedRowCount();
    stateIndex =new int[rowCount];
    for(int i=0;i<rowCount;i++){
    stateIndex[i] = i;
    BindingContext bctx = BindingContext.getCurrent();
    BindingContainer bindings = bctx.getCurrentBindingsEntry();
    JUCtrlListBinding list=(JUCtrlListBinding) bindings.get("ViewObject");
    list.setSelectedIndices(stateIndex);
    To select default value other than all .
    BindingContext bctx = BindingContext.getCurrent();
    BindingContainer bindings = bctx.getCurrentBindingsEntry();
    JUCtrlListBinding list=(JUCtrlListBinding) bindings.get("ViewObject");
    list.setSelectedIndex(arg0);
    arg0 - The row which you want to set checked by default

  • Scope issue: Trying to set the value of a variable in a calling (upper) script from a called (lower) script

    Hi,
    I have a basic scope question . I have two .ksh scripts. One calls the other.
    I have a variable I define in script_one.ksh called var1.
    I set it equal to 1. so export var1=1
    I then call script_two,ksh from script_one.ksh.  In script_two.ksh I set the value of var1 to 2 . so var1=2.
    I return to script_one.ksh and echo out var1 and it still is equal to 1.
    How can I change the value of var1 in script_two.ksh to 2 and have that change reflected in script_one.ksh when I echo var1 out after returning from script_two.ksh.
    I've remember seeing this I just can't remember how to do it.
    Thanks in advance.

    Unfortunately Unix or Linux does not have a concept of dynamic system kernel or global variables.
    Environment variables can be exported from a parent to a child processes, similar to copying, but a child process cannot change the shell environment of its parent process.
    However, there are a few ways you could use: You can source execute the scripts, using the Bash source command or by typing . space filename. When source executing a script, the content of the script are run in the current shell, similar to typing the commands at the command prompt.
    Use shell functions instead of forking shell scripts.
    Store the output of a script into a variable. For instance:
    #test1.sh
    var=goodbye
    echo $var
    #test2.sh
    var=hello
    echo $var
    var=`./test1.sh`
    echo $var
    $ ./test2.sh
    hello
    goodbye

  • How to set the value of something in a component from the main application?

    Hi,
    Maybe I've been working on this too long, but I can't figure
    out how to set the value of the text property of a text input field
    in a component from my main application in an mx:Script block. I
    have a component called Login in the components folder, and I need
    to set the text value of empNum. In my mxml declaration at that the
    top, I've declared these components as xmlns:c="components.*" So
    logically, the property I'm trying to set is c.Login.empNum.text. I
    can't figure out the correct syntax to get this to work, and I've
    tried everything I can think of. Does anyone have any suggestions?
    I'm thinking this should be an easy one, and I'm just missing
    something.
    Thanks!
    Holli

    Did you try giving it an id ?
    <c:MyLogin id="loginScreen" /c>
    So later you can do loginScreen .empNum.text = "my text"
    Laurent,

  • How can I set the value to a session bean from backing bean

    Hi Experts,
    How can I set the value to a session bean from backing bean where I have created getter and setter
    methods for that variable.
    Basically I am using ADFUtils class where I am able to get the value from session bean
    using following expression
    String claimType =
    (String)ADFUtil.invokeEL("#{ClaimValueObj.getClaimType}");
    Thanks
    Gayaz

    Gayaz,
    Wrong Post !!
    Post in JDeveloper and ADF
    Thanks
    --Anil                                                                                                                                                                                                                               

  • Set the value of a CWNumEdit Control from within the code

    I am trying to update a CWNumEdit Control with data created during program execution.  I am using the set_Text function but it does not seem to be working.  I was wondering if there is something that I am missing to get this functionality to work.  Please help.
    I am developing a VS .NET 2003 WinForm GUI and am Using Measurement Studio 8.1.1.

    Hello mtd32610,
    I noticed this question was already posted on this forum.  We like to
    keep all questions related to a single issue confined to one forum, so
    please direct all future replies to one post or the other.
    As Jervin_J mentioned in the previous post, the standard method for
    updating a CWNumEdit control is to set the Value property of the
    CNiNumEdit object that is associated with this control.  You do not
    need to call the set_Text function, in fact I am not familiar with any
    set_Text function, so I think you may be calling this method on the
    wrong class altogether.
    You should have an object associated with your CWNumEdit control that
    you can set the Value property for.  As mentioned in the reply from
    Jervin_J, the normal way to populate the control is to use:
    <control>.Value = <numeric_value>;
    Regards,
    Marty H.
    National Instruments

  • Setting the value of a java variable in javascript function

    How can i set the value of a java variable in a javascript function?
    <%
    String fName = "";
    %>
    now i want to define a javascript function which can set the value of fName to the value it has been passed.
    <script language="javascript">
    function setJValue(val)
    </script>
    Thanks

    The only way you could simulate this, would be call the same page inside the Javascript function, and send it the parameter that was passed. Then you would have your Java code retrieve this parameter by request.getParameter("value");, and set the variable accordingly.

  • How to prevent numericstepper from setting the value to the defined Maximum when a number greater than maximum is entered in by keyboard and user hits the "Enter" key.

    I need to set the Maximum so that the use can use the mouse to change the value of numericstepper (and not go over a certain number), but at the same time I have to allow the user to enter their value by typing in the text field. When the user enters a number greater than the Maximum, I disable the "Ok" button of the dialog and show a red warning(error message). The issue is that the user can hit "Enter" and numeric stepper would set the value to the Maximum and the dialog box would close and the rest of code would run. I want the numericstepper not to change the value and keep showing the warning even if the user hits the "Enter".
    Note: Setting maxChar does not help since my maximum is 1000, and user might enter 5555
    I would appreciate the help.

    Thanks for trying to help, But
    The issue is that if I set the maximum value of stepper 1 greater than the max value that I want, then the user can select an invalid value(of myMax + 1) when he clicks on the UP arrow of the numeric stepper(which is not acceptable for what I am working on).
    I need to preserve the users invalid number, while not letting the user to select an invalid number by clicking UP key.
    I noticed that when the user enters a number greater than the Maximum, and then click on the down arrow, it would set the value to 1 less than the maximum. This is not acceptable either.

  • Set the value of an adf number slider with java script

    Hi,
    i develop a adf 11 webapplication with JDeveloper 11.
    in one page i use the number slider component and i wish to set the value with a clientlistern in javascript.
    is this possible??
    thanks,
    hannes

    Hi,
    did you try
    slider = AdfPage.PAGE.findComponent("<sliderId>");
    slider.setProperty("value",<your value>);
    Frank

  • HOW to set the value attribute of FORM INPUT data to a variable in a JSP

    eg. Registration.jsp
    The data is accessed from an hidden field called course
    for example, if I have "Java programming" in the field course, and I use
    an expression to access the value from the hidden field.
    **My problem is that the data gets truncated to "Java" , I need "Java Programming"to display. The code looks like this
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <INPUT TYPE="text" SIZE=12 NAME="course"
    VALUE=<%=getParameter("course") %>
    IS there ANY OTHER WAY to set the value of VALUE to a variable?

    Instead of value=<%=request.getParameter("course")%>
    Use double codes
    value="<%=request.getParameter("course")%>"

  • Setting the value of a field based on a dropdown list

    I am using the latest production release of JHeadstart 10.1.3.0.91. I am trying to set the value of a field based on selecting the value of another field (drop down list). The drop down list field has the following attributes set autoSubmit="true" immediate="true" valueChangeListener="#{jhsPageLifecycle.updateModelValue}".
    The other field has the partialtrigger set to the first field. ie "depends on" selection from JHeadStart file. The value of the second field is set in the setter of the VO RowImpl java file.
    The value of that field is only populated on the screen if it is set to disabled="true". This seems a bit bizzare behaviour. Can you explain why it cannot set the value of the field when it is not disabled.

    Worked out that if i set the "Clear/Refresh value" attribute on the field that i want updated then it will work ok
    Alan

  • How i can set dropDown item to 6th item from java code ?

    Hi
    Thank you for reading my post.
    how i can set dropDown item to 6th item from java code ?
    i have the value field of database and i can use it to set selected item of DropDown.
    so : can i use value field to set the selected item ?
    Thank u.

    Hi,
    Please go through the following thread which discusses about setting teh selected item for a dropdown:
    http://swforum.sun.com/jive/thread.jspa?forumID=123&threadID=50697
    Hope it helps
    Cheers
    Giri

  • Loading a file and setting the values in a Jtextfield

    Hi all,
    I've created a save and open menu option for my application. The save option works as it writes to file using jFileChooser. However when using the open file option the program opens the correct file and stores the strings read into a string variable, however when I go to set the value stored in the variable to a specific textfield using settext method, it doesn't do anything. Please can someone give me some suggestions on what I am doing wrong. The following is the code snippet that accesses the file and reads from it:
    try
    int result = jFileChooser1.showOpenDialog(this);
    if ( result == JFileChooser.APPROVE_OPTION )
    String str1 = jFileChooser1.getCurrentDirectory() +
    System.getProperty("file.separator") + jFileChooser1.getSelectedFile().getName() ;
    FileReader f = new FileReader( str1 );
    BufferedReader b = new BufferedReader(f);
    while((text1 = b.readLine()) != null)
    //text2 = b.readLine();
    jTextArea1.append("\ntext1: "+text1+"\nsize: "+size);
    if(text1 == "// System Configuration")
    text1 = b.readLine();
    size = text1.length();
    //text2 = text1;
    jSampleRate.setText(text1);
    text1 = b.readLine();
    size = text1.length();
    //text2 = text1;
    jFrequency.setText(text1);
    text1 = b.readLine();
    size = text1.length();
    //text2 = text1;
    jVoltage.setText(text1);
    text1 = b.readLine();
    size = text1.length();
    text2 = text1;
    jFSVoltage1.setText(text1);
    /*if((text = b.readLine()) == "// Phase Selection")
    // READ INFORMATION LOOKING FOE THE SPECIFIC TAGS
    b.close();
    jFileChooser1.cancelSelection();
    Any suggestions wpould be very much appreciated. Thanks in advance.

    this is the result from the read in information:
    text1 is the string variable that is used to store the information read in from the file, while size is the variable used to obtian the size of the string. Does the readline() method have any properties which would affect what is being read in?
    text1: |=========================================================================================
    size: 0
    text1: | File Name: C:\CsoundTest\walid3
    size: 0
    text1: | Last Modified: 30-01-2003 11:25:11
    size: 0
    text1: | Warning: Do not modify the information stored in this file. If modified the inforamtion
    size: 0
    text1: | may not be retrieved correctly when loading the file into the main program.
    size: 0
    text1: |==========================================================================================
    size: 0
    text1:
    size: 0
    text1: // System Configuration
    size: 0
    text1: 500
    size: 0
    text1: 50
    size: 0
    text1: 230
    size: 0
    text1: 300
    size: 0
    text1:
    size: 0
    text1: // Phase Selection
    size: 0
    text1: 1VIncN
    size: 0
    text1:
    size: 0
    text1: // Duration
    size: 0
    text1: 0
    size: 0
    text1: 00
    size: 0
    text1: 00
    size: 0
    text1:
    size: 0
    text1: // Disturbances
    size: 0
    text1:
    size: 0
    Regards
    walidr

Maybe you are looking for

  • Photoshop 13.1 for Creative Cloud Done with Errors. Error Code: U44M1P6

    Hi, this is the error I received when after trying to install the update through the update manager.  Has anyone seen this error?  How do I now get Photoshop to 13.1?

  • Error when using BAPI_ACC_DOCUMENT_POST...

    [code] Hello Experts, Iam using the said BAPI for the first time and I am not sure if I filled up the fields correctly. What I want to do is to post multiple debit entries(40) and a special G/L entry for vendor(posting key 39). I also need to generat

  • EDI Output ZB00 not getting determined in case of Split Deliveries.

    Hello All, A very Good Morning to you, Hope you are doing good, We have come across one critical Issue where the EDI Output ZB00 Dispatch Advice is not getting determined in case of few Split Deliveries in PROD. Issue : On a daily basis our Client is

  • File not showing up under "Purchased on Dave's iPhone"

    Only some of the purchases I made are showing up under the playlist "Purchased on Dave's iPhone".  I think this may be because I have two apple accounts.  I created a second account inadvertantly when I joined the mobile.me.  Could this be the proble

  • Doubts on BDC

    Hey guyz, here are some BDC queries. 1> Can we set call transaction in background????? I think with mode 'N' we can set it in SM36. But how to handle the errors (BDCMSGCOLL) in this case.    Normally this method is advisable in case of small number o