How to handle node with in a node of component controler context

I want to create node within a node in the context of component controller. Now in the doInit method of the Component Controller I want to populate the node structure. How to do that? because in the parent node I can populate its attribute but there is no setter method for the child node , by which I can set the child to the parent node. can anybody help me ..
I have tried by using the setAttribute method of the parent to add the child. for that two parameter I have passed one are child node name and the other one is the child node object(populated one)
rgds,
Soumen

Hi Soumen,
When we create the node itself, we need to associate it with the parent node. The following lines of code will help you to create a node(singleton, 1..1 cardinality) under a parent node:
Assumptions for the following code are:
1) The name of the parent node is 'parent_node'.
2) The cardinality of 'parent_node' is 1..1 or 1..n. If you set the cardinality starting from zero, you need to explicitly create an element and then set the leadselection before using this code.
IWDNodeInfo NodeInfo = wdContext.nodeParent_node().getNodeInfo().addChild("child_node",null,true,true,false,false,false,true,null,null,null);
IWDAttributeInfo info = NodeInfo.addAttribute("child_Attribute" , "ddic:com.sap.dictionary.string");
wdContext.nodeParent_node().getChildNode("child_node",wdContext.nodeParent_node().getLeadSelection()).getCurrentElement().setAttributeValue("child_Attribute","Test Value");
wdComponentAPI.getMessageManager().reportSuccess(" The value set is ::"+wdContext.nodeParent_node().getChildNode("child_node",wdContext.nodeParent_node().getLeadSelection()).getCurrentElement().getAttributeValue("child_Attribute"));
Hope this helps,
Best Regards,
Nibu.

Similar Messages

  • How to handle dbms_xmldom with no data values.(no_data_found error in dom)

    hi,
    i have below block,
    DECLARE
    doc dbms_xmldom.DOMDocument;
    node dbms_xmldom.DOMNode;
    elem dbms_xmldom.DOMElement;
    cur_node dbms_xmldom.DOMNode;
    root_elem_data dbms_xmldom.DOMElement;
    root_elem_tab dbms_xmldom.DOMElement;
    root_node_data dbms_xmldom.DOMNode;
    mode_elmn dbms_xmldom.DOMElement;
    mode_node dbms_xmldom.DOMNode;
    mode_text dbms_xmldom.DOMText;
    doc1 DBMS_XMLDOM.DOMDOCUMENT;
    root_node_data1 DBMS_XMLDOM.DOMNODE;
    child_document DBMS_XMLDOM.DOMDOCUMENT;
    child_rootnode DBMS_XMLDOM.DOMNODE;
    V_CLOB CLOB;
    v_doc CLOB;
    v_EMP CLOB;
    v_output_filename VARCHAR2(300) := 'SPOOL_DIR/'||'EMP_XML_FILE.xml';
    l_xmltype XMLTYPE;
    BEGIN
    doc := dbms_xmldom.newDOMDocument;
    node := dbms_xmldom.makeNode(doc);
    dbms_xmldom.setversion(doc, '1.0');
    dbms_xmldom.setCharset(doc, 'UTF8');
    elem := dbms_xmldom.createElement(doc, 'PartnerInfo');
    dbms_xmldom.setAttribute(elem,'xmlns','EMP');
    cur_node := dbms_xmldom.appendChild(node, dbms_xmldom.makeNode(elem));
    mode_elmn := dbms_xmldom.createElement(doc, 'EMPLOYEE');
    mode_node := dbms_xmldom.appendChild(cur_node,dbms_xmldom.makeNode(mode_elmn));
    BEGIN
    SELECT value(e) INTO l_xmltype
    FROM TABLE(XMLSequence(Cursor(SELECT * FROM EMP1 where EMPNO=7501))) e;
    child_document := DBMS_XMLDOM.newDOMDocument(l_xmltype);
    root_node_data1 := dbms_xmldom.importNode(doc,dbms_xmldom.makeNode(dbms_xmldom.getDocumentElement(child_document)),TRUE);
    root_node_data1 := DBMS_XMLDOM.appendChild(root_node_data, root_node_data1);
    EXCEPTION
    WHEN OTHERS THEN
    Dbms_Output.Put_Line('Error in SELECT stmt(UC_PARTNER_MS):::'||'error::'||SQLERRM);
    END;
    dbms_lob.createtemporary(v_doc, true);
    dbms_xmldom.writeToClob(doc,v_doc,'UTF8');
    v_EMP:= v_doc;
    dbms_xmldom.writeToFile(DOC,v_output_filename,'UTF8');
    dbms_xmldom.freeDocument(doc);
    --Dbms_Output.Put_Line('THE OUTPUT IS::'||V_EMP);
    EXCEPTION
    WHEN OTHERS THEN
    Dbms_Output.Put_Line('Error in SELECT stmt(UC_PARTNER_MS):::'||'error::'||SQLERRM);
    END;
    The xml file is 'EMP_XML_FILE.xml'
    <empno>U++kYmcVuGchxbh+++++++++++++++1+</empno>
    <empname>J</empname>
    suppose the empno 7501 is not available in our emp table,
    i got error
    ORA-03113: end-of-file on communication channel
    how to handle xmldom with no data values.
    by
    siva

    hi,
    please give the solution
    by
    siva

  • Some basic questions how to handle Exceptions with good style

    Ok I have two really basic Exception questions at once:
    1. Until now I always threw all exceptions back all the way to my main method and it always worked well for me but now I am sitting at a big project where this method would explode the programm with throwings of very many exceptions in very many methods. So I would like to know if there is a more elegant solution.
    2. What do I do with exceptions that will never occur?
    Lets say I have a method like this:
    void main() {calculate();}
    void calculate()
    sum(3,5);
    void sum(int a,int b)
    MathematicsA.initialise("SUM"); // throws AlgorithmNotFoundException, will never occur but has to be handled
    }So what is the most elegant way?:
    h4. 1. Ignore because it will not happen
    void sum(int a,int b)
    try {MathematicsA.initialise("SUM");}
    catch(AlgorithmNotFoundException) {}
    }h4. 2. Print stacktrace and exit
    void sum(int a,int b)
    try {MathematicsA.initialise("SUM");}
    catch(AlgorithmNotFoundException e)
    e.printStackTrace();
    System.exit();
    }h4. 3. throw it everywhere
    void main() throws AlgorithmNotFoundException, throws ThousandsOfOtherExceptions  {}
    void calculate()  throws AlgorithmNotFoundException, throws HundretsOfOtherExceptions
    sum(3,5);
    void sum(int a,int b) throws AlgorithmNotFoundException
    MathematicsA.initialise("SUM");
    }h4. 4. Create special exceptions for every stage
    void main() throws MainParametersWrongException
    try {calculate();}
    catch(Exception e)
      throw new MainParametersWrongException();
    void calculate()  throws SumInternalErrorException
    try {sum(3,5);}
    catch (SumInternalErrorException)    {throw new CalculateException();}
    void sum(int a,int b) throws SumInternalErrorException
    try
    MathematicsA.initialise("SUM");
    } catch (AlgorithmNotFoundException e) {
    throw new SumInternalErrorException();
    }P.S.: Another problem for me is when a method called in a constructor causes an Exception. I don't want to do try/catch everytime I instantiate an object..
    Example:
    public class MySummation()
         Mathematics mathematics;
         public MySummation()
                 mathematics.initialise("SUM"); // throws AlgorithmNotFoundException
         void sum(int x,int y)
              return mathematics.doIt(x,y);
    }(sorry for editing all the time, I was not really sure what I really wanted to ask until i realised that I had in fact 2 questions at the same time, and still it is hard to explain what I really want to say with it but now the post is relatively final and I will only add small things)
    Edited by: kirdie on Jul 7, 2008 2:21 AM
    Edited by: kirdie on Jul 7, 2008 2:25 AM
    Edited by: kirdie on Jul 7, 2008 2:33 AM
    Edited by: kirdie on Jul 7, 2008 2:34 AM

    sphinks wrote:
    I`m not a guru, but give my point of view. First of all, the first way is rude. You shouldn`t use try with empty catch. "rude" isn't the word I'd use to describe it. Think about what happens if an exception is thrown. How will you know? Your app fails, and you have NO indication as to why. "stupid" or "suicidal" are better descriptions.
    Then for the second way, I`ll reccomend for you use not printStackTrace(); , but use special method for it:
    public void outputError (Exception e) {
    e.printStackTrace();
    }It`ll be better just because if in future you`d like to output error message instead of stack of print it on GUI, you`ll need change only one method, but not all 'try' 'catch' statements for changing e.printStackTrace(); with the call of new output method.I disagree with this. Far be it from me to argue against the DRY principle, but I wouldn't code it this way.
    I would not recommend exiting from a catch block like that. It's not a strategy for recovery. Just throw the exception.
    Then, the third way also good, but I suppose you should use throws only if the caller method should know that called method have a problem (for example, when you read parametrs from gui, so if params are inccorect, main method of programm should know about it and for example show alert window)."throw it everywhere"? No, throw it until you get to an appropriate handler.
    If you're writing layered applications - and you should be - you want to identify the layer that will handle the exception. For example, if I'm writing a web app with a view layer, a service layer, and a persistence layer, and there's a problem in the persistence tier, I'd let the service layer know what the persistence exception was. The service layer might translate that into some other exception with some business meaning. The view layer would translate the business exception into something that would be actionable by the user.
    And in all other cases I suppose you should use the fourth way. So I suppose it`s better to combine 2,3,4 ways as I have mentioned above.I don't know that I'd recommend special exceptions for every layer. I'd reuse existing classes where I could (e.g., IllegalArgumentException)
    Sorry, I can give you advice how to avoid problem with try-catch in constructor. :-(You shouldn't catch anything that you can't handle. If an exception occurs in a constructor that will compromise the object you're trying to create, by all means just throw the exception. No try/catch needed.
    You sound like you're looking for a single cookie cutter approach. I'd recommend thinking instead.
    %

  • How to Handle forms with J2EE?

    Hi, I am currently working on a project that needs to handle a lot of form inputs.
    I needs to find out how can i storage a big chunck of text from the form to the database.
    I was thinking perhaps i can create a text file for the text and store the file name in the database for every entry.
    Is that possible with J2EE technology?

    I am suppose to build a Job Search site. Jobseekers usually will not to copy and paste their resume into a textbox and the form will just store everything in the textbox. I believe a resume is definitely a very big data.
    An alternative will be to upload the file but i have no idea how can i achieve that.

  • How to handle directories with special characters in their name

    I can't figure out how to recode the second clause of this function to handle directories like one named "[]"
    function Get-DiskUsage {
    # parse and pray (but it does accept directory []
    dir |
    ? { $_.psIsContainer } |
    $size = ((@(cmd /c dir /s $_.name)[-2])[25..39] -join '')
    if ($size[14] -eq ' ') {
    $size = ' ' + ((@(cmd /c dir /s $_.name)[-2])[25..38] -join '')
    $name = $_.name
    ' ' + $size + ' ' + $name
    # object oriented, but it does not accept directory []
    Get-ChildItem -Directory |
    Select-Object @{ Name="Size";
    Expression={ ($_ | Get-ChildItem -Recurse |
    Measure-Object -Sum Length).Sum + 0 } },
    Name

    Here is the function with additional functionality to count bytes in the files in the directory itself as well as subdirectories, and accept an optional argument to specify the target directory.  I wish there was a better way
    to do this without modifying and later restoring $pwd
    function Get-DiskUsage {
    # Discovers how much space is allocated in the directories at and below
    # the current directory
    # Inspired by a version from Windows PowerShell Cookbook by Lee Holmes
    # http://www.leeholmes.com/guide
    # The change to parse ] and [ correctly in a directory name was created by Rhys W Edwards
    # http://social.technet.microsoft.com/Forums/en-US/f4f0a133-8c4d-4089-8047-274dbc03567b
    # if there is an argument, then validate it as an actual directory and set $pwd to it
    if ($args.length -gt 0) {
    if ((Test-Path -Path $args[0] -PathType Container) -eq $False) {
    return
    $pwdsave = $pwd
    cd $args[0]
    # count of bytes in the files in the directory itself
    (Get-ChildItem | Measure-Object -property length -sum) |
    Select-Object @{Name='Size';Expression={$_.Sum}},@{Name='Name';Expression={$pwd}}
    # count of bytes in the files in the subdirectories
    Get-ChildItem -Directory |
    Select-Object @{
    Name='Size';
    Expression={
    ( $_ -replace '\[','`[' -replace '\]','`]' |
    Get-ChildItem -Recurse |
    Measure-Object -Sum Length).Sum + 0 }
    },Name
    # restore $pwd is needed
    if ($args.length -gt 0) {
    cd $pwdsave

  • How to handle security with Auto-Versions and Time Machine?

    I've upgraded to OS X Lion, which of course now has the new automatic "versions" system.
    Today, I created a text file in TextEdit, containing highly sensitive data that I must keep absolutely secure (well, you know -- as best I can.) The file was eventually copied to an encrypted sparse disk image (.dmg) and the original on my desktop deleted trashed and emptied.
    But before that happened, Lion had already saved two copies of the file through the new versions sytem --and-- one copy in regular old Time Machine! So much for keeping the file secure. (OK -- not "copies" but delta data. Whatever. )
    EDIT: OK ... I found how to "Delete all backups ..." from within Time Machine. (I feel silly for not finding that before!) But the real question here relates to manual and auto-save versions from the likes of TextEdit and any residual data that may leave lying around, despite the file seemingly having been deleted.
    My questions should now be fairly obvious ...
    Does "Delete all backups" from within TimeMachine also delete all data from the "versions" system? One would assume so. But I don't like to assume.
    Can one somehow pre-emptively flag a file to not be recorded by versions or Time Machine?
    Someone in some post noted that a file could be "locked" to prevent these issues altogether. But I can find no informtaion about such a thing, either by further googling or poking around in menus locally.
    EDIT: Good grief! You spend ages trying to find something, then you post on here and it magically appears. You can click the title bar of TextEdit to produce a pull-down (that's new!), which shows an option to "Lock".
    So this one is just about answered by myself -- except for the part about whether "version delta" info is also removed when "Delete all backups" is used from within Time Machine.
    Any help will be much appreciated. Thanks.
    Bryan.

    If you're dealing with highly sensitive data, you should enable FileVault on your primary and backup volumes. That's the only way to ensure that all copies of your files will always be encrypted. Needless to say, you have to be very sure you won't lose the password. Optionally, you can store an alternate decryption key on Apple's servers, but then you have to trust Apple.
    That said, in my opinion it's too soon after the release of Lion to trust FileVault completely.

  • How to handle sessions with two severs on one machine?

    All,
    I am having a problem with session cookies being overwritten when I host two apps on one machine running WebLogic 8.1 The apps are http://myserver:7300/app1 and http://myserver:7400/app2, and each runs in its own server.
    Users will often access both apps at once, in two browser windows. If the windows are different threads in the same process, the sessions collide. For Internet Explorer, this isn't usually a problem since clicking on the shortcut multiple times launches different processes by default. Some browsers (Firefox, etc.) won't let you have two windows under different processes. Attempts to launch a second window 'detect' the existing process and appear to spawn a new thread. When this happens there appears to be no way for the users to use both apps at once.
    I know this is happening because of the way session cookies are stored in the browser process' memory. The session cookies appear to me to be 'keyed' by the host name or ip address of the server. Does anyone know of a setting in WebLogic so that this 'key' includes the port or context root? Is this even something which can be controlled on the server side?
    Thanks for any help,
    Brian

    Not quite sure what your intent is, but if you want to avoid a clash how
    about giving each application a different default session cookie name.

  • How to handle Column with Adobe Output Designer 5.7 ??

    Hello,
    I have to handle lists of articles with 2 columns pages.
    1 article = 1 title + 1 text.
    When the data has filled up Column 1 on page 1, it will go to the top of Column 2, on page 1.
    When the fist page is filled then it goes to Page2 Column 1.
    I tryed to modify the preamble but I 'm not able  which is the best option :
    - group !OnOverflow
    - Intelligent pagination commands : \position
    - group!OnBOF
    - group!OnEntry
    - group!OnExit
    It doesn't work !!!
    Could you help me ??
    Thanks in Advance
    Sylvain

    Look here: http://www.adobe.com/products/server/outputdesigner/overview.html
    There is a link at the top to have Adobe contact you.

  • How to Handle Files With No Extension

    Many open source softwares come with some text files named "README" or "TODO" with no extension.
    All my txt files are opened with MacVim, but these files without extensions are open with TextEdit.app by default .
    The question is HOW do I change  it so that thay're NOT open with TextEdit.app but open with MacVim.app when being double-clicked .
    Thank you, And sorry for my pool English.

    Click on the file and do a Get-Info. command-I. In the Open with drop down menu click on the drop down and if your MacVim appears select it. If it doesn't select other and navigate to where MacVim is located. Select it and then select open all.

  • How to Handle Data with Icons

    I'm trying to create a directory of showroom locations and the type of products that they carry. I need an efficient way to manage the data (like an Access database) but I need to represent the product categories with icons. My team has drawn the icons in Illustrator and I have considered using a utility to create a custom icon font, but those custom icon fonts are web-fonts only and it appears that they cannot be used in the database directly.  The final output needs to be in a printable format. Any suggestions on how to solve this? Do I need someone to write a custom script to run in InDesign?

    Hard to say without seeing the layout, but perhaps Data Merge would work-- you can place images using data merge. Another possibility is to use some sort of text symbol, then use Find/Change to replace with contents of the clip board after copying an icon.
    Or make your own font with a better utility: Indiscripts :: IndyFont

  • India: how to handle material with excise inventorised?

    Dear all,
    following setup was planned for purchasing trading goods locally to depot:
    1) Flag material as non cenvatable in J1ID and remove the Cenvat determination for the same
    2) Create PO with this material using tax code deductable, no excise gets calculated as the material is non cenvatable
    3) Do GR in MIGO without excise tab being displayed
    4) Do J1IG for the excise invoice with real values so that RG23D gets updated properly
    5) Do MIRO.
    Problem is that in this setup SAP populates the excise values of J1IG in MIRO (in addition to base price already including excise tax) and tries to post the excise values to Cenvat clearing accounts independent of master data setup in J1ID.
    Reason behind our setup is that we try to avoid to have so many tax codes in the system for deductable case as well as inventorised excise for trading.
    Does anybody know if there is a chance to make it work as planned or is "doubling" the tax codes our only option?

    HI John,
    Please have a look at Plan driven procurement configuration in the classic mode?
    Regards,
    Nikhil

  • How to handle form with more than one page in struts

    Hai,
    i have more than one page in my struts web apps. each page has a form & i have submit button @ last page. I navigate between these pages using titles. data has to exist when i come back from another page(i.e i am in page1 i have some fields called name & address as textfield, i move to page2 & then i go back to page1 @ that time i should have the name & addess values that i entered previous in the corresponding textfield) & finally when i submit need to get values form all these pages.
    Plz tell me how to do this.

    Hi prasadmca ,
    1.Try to store those value in session variable
    2. or else store those value in DB

  • How to handle list with way more than 5,000 items?

    Hello SharePoint Fam,
    I have a library that will be rather large with nothing but pdf files that are around 30-80KB per file.  Currently I am at around 40k files in the library and of course I have the error message about 5k list view threshold and was wanting to get advice
    on what I should do, I am not using no extra fields at all just a name/title field.  There will be around 100-150k files per year in the library
    Thanks so much n advance

    Nothing at all, basically using this library for our account payable folks to begin scanning in invoices so that they can have a url that links the ap software to these files easier instead of fileshare url.  They use a Fujitsu scanner that scans the
    invoice directly to sp library and the file name is just 20150313064630.pdf format and that is it.  I am open to fields/metadata but that would mean i'd have to go back and touch all 40k files already loaded?
    Thanks so much n advance

  • Adding formulas via ADS file - How to Handle Members with Spaces

    greetings,
    I'm building onto an existing dimension using an ADS file in EPMA where some of the members have formulas. The problem is the ADS load is not consistent with the double quotes where at times the double quotes are retained after deployment, while at other times they are not, thus giving a formula error in Essbase.
    The ads file shows something like this: IF(@ISIDESC (""SPECIFIC ACCOUNT"")) ""JAN2012""; ELSE ""JAN2013""; ENDIF
    In Essbase, the quotes around SPECIFIC ACCOUNT are removed: IF(@ISIDESC (SPECIFIC ACCOUNT)) ""JAN2012""; ELSE ""JAN2013""; ENDIF
    We're on 11.1.1.4.
    I've tried various things, such as surrounding the double quote with single quotes, nothing seems to work... Any help is greatly appreciated...
    cg
    Edited by: cg on May 9, 2012 5:41 AM

    Does this document in Oracle Suport help - Double Quotes Around Member Formulas Are Deleted When The ADS file Is Imported [ID 1101093.1]     
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • How to Handle events from audioplayer by ADF ObjectMedia Component

    Hi,
    In My application Having a ADF ObjectMedia Component for the audio play,
    My requirement is to handle the events from the Player,i.e Need to get an
    event when the user pause the player,can i get the event in backing bean.or else please help me in any other way to get the requirement asap.
    Thanking you....

    Hi,
    assume the media player most likely is a browser plugin. Question: Does the media plugin raise events ?
    If the media player has a JavaScript API that allows you to call a JavaScript function then you found a gate open to publish the event to the JSF application
    So as a todo for you: Check with the media player vendor if there exist a JavAScript API or any other sort of eventing.
    Frank

Maybe you are looking for

  • Sale order Billing invoice history.

    Hi, I am an ABAPer. I have to create a report that displays the invoice billing history of a sales order for a particular period of time. My final table should contain the following fields. Invoice Date Document Type Currency Invoice Amount (in DC) I

  • My sound is not working anymore on my mac book pro

    My sound on my mac book pro is not working at all anymore. I used it in the morning and it worked just fine and i came back at night and my sound was gone. I checked my output settings, raised the volume up all the way, made sure that i wasn't on mut

  • HT4623 i trying to update my ios 4.2.1 to 4.3 or higher but itunes and iphone are

    saying that its upto date please help i cant use no apps not even facebook

  • VLAN reports in LMS 3.1

    Hey this may be a ridiculous question but I'm running out of ideas. I need to run a report that will display the Voice VLANS on each switchport. We are doing a major phone/VLAN migration and this report will save a lot of time. The current reports I

  • Q: Auto file naming in TextEdit possible?

    I've just come over from the 'Dark Side' having been freed from the 'MicroSith' Empire and I'm really enjoying my two new Macs. I'm taking some extra time to set it up like I want. I'm interested in productivity. Is there a way to cause TextEdit to t