Copy Parent and its children records

Hello:
I have a requirement to implement the "deep copy" functionality i.e. copy Opportunity and its children records including Contact, Opportunity Product Revenue etc. Can this be accomplished with the weblink, web services or any other options? I have went over the Oracle web services Guide doc, but I am still not sure what steps need to take in order to implement this "deep copy" functionality. Could you direct me to any reference docs to implement this?
Thanks in advance!
-AJ

Briefly, it looks like this.
"Deep copy", as you describe it, can be just a programmatic manipulation of data via WebServices. So your program would go through these steps:
- login to WS (or use stateless sessions)
- use Query method on Opportunity object Web Service to retrieve all fields from the record, and all child records
- create new Opportunity record, by calling Insert method
- create child records of all types you need, also by calling Insert method (in WS 1.0 you will use InsertChild)
Exact details depend on your programming language.
You may need to use both 1.0 and 2.0, or select which version to use, because these two interface support different child objects.
In any case, there is no way to create both parent and children in one call - you create Opportunity record, and then reference its ID in new child objects.
Hope it helps.

Similar Messages

  • XML having many parents and many children but all unrelated!***URGENT***

    This is very urgent..Please HELP!!!
    Iam in a project which is planning to store the entire XML file in the database in a XML datatype column. The XML has multiple parents AND multiple children for each of those parents. My problem is how to read/store the data for each of the parent and associate the parent to the child elements. The child elements does not have a parentID in its column. Here is an example- Parent table - SHIPMENT. Child Table - SHIPMENTUNITS. ShipmentNBr is the business key in both these tables. This column comes in the SHIPMENT node but does not come in the SHIPMENTUNITS node. When I try the OPENXML, all the data just gets stored..how do I link the child to the parent?
    <SHIPMENT xmlns="">
    <SHIPMENTNBR>US1011<SHIPMENTNBR />
    <SHIPMENTTYPE_CD>BK</SHIPMENTTYPE_CD>
    <LINESCAC>ACLH</LINESCAC>
    <TERMINAL_CD>USJAX</TERMINAL_CD>
    <ISSUE_DT>2006-08-17T14:23:09</ISSUE_DT>
    <VESSEL_CD>VES</VESSEL_CD>
    <VOYAGE_CD>VOYA</VOYAGE_CD>
    <POL />
    <POD>POD_0</POD>
    <SHIPMENTUNITS>
    <UNITNBR>1234</UNITNBR>
    <UNITTYPE_CD>CAR</UNITTYPE_CD>
    <MAKE>HON</MAKE>
    <MODEL>ACCO</MODEL>
    <COLOR>RED</COLOR>
    <FULLEMPTY_CD>F</FULLEMPTY_CD>
    <LENGTH>0011</LENGTH>
    <WIDTH>0022</WIDTH>
    <HEIGHT>0033</HEIGHT>
    <DIMENSIONUOM>C</DIMENSIONUOM>
    <WEIGHT>000010</WEIGHT>
    <WGTUOM>K</WGTUOM>
    </SHIPMENTUNITS>
    </SHIPMENT>
    <SHIPMENT xmlns="">
    <SHIPMENTNBR>IN2052<SHIPMENTNBR />
    <SHIPMENTTYPE_CD>BK</SHIPMENTTYPE_CD>
    <LINESCAC>ACLH</LINESCAC>
    <TERMINAL_CD>USJAX</TERMINAL_CD>
    <ISSUE_DT>2006-08-17T14:23:09</ISSUE_DT>
    <VESSEL_CD>VES</VESSEL_CD>
    <VOYAGE_CD>VOYA</VOYAGE_CD>
    <POL />
    <POD>POD_0</POD>
    <SHIPMENTUNITS>
    <UNITNBR>1234</UNITNBR>
    <UNITTYPE_CD>CAR</UNITTYPE_CD>
    <MAKE>HON</MAKE>
    <MODEL>ACCO</MODEL>
    <COLOR>RED</COLOR>
    <FULLEMPTY_CD>F</FULLEMPTY_CD>
    <LENGTH>0011</LENGTH>
    <WIDTH>0022</WIDTH>
    <HEIGHT>0033</HEIGHT>
    <DIMENSIONUOM>C</DIMENSIONUOM>
    <WEIGHT>000010</WEIGHT>
    <WGTUOM>K</WGTUOM>
    </SHIPMENTUNITS>
    </SHIPMENT>

    I don't quite understand what you want to achieve.
    If you store the data in an XML data type then you get the XML as is and all the children are associated with their parents.
    If you want to decompose them into relational tables using OpenXML, then you either use the id values provided in the data and use the parent axis, or if no such id values are present look at the so called meta properties @mp:id and @mp:parentid. In your case you have the shipment number and unit number that you could use. The first approach you can do with the nodes() method too (but the meta properties are OpenXML only).
    In the following example I show you both. In your case you don't need the @mp: parts. Also, since OpenXML needs a complete document I added a single root node.
    declare @i int;
    exec sp_xml_preparedocument @i output,
    N'<doc><SHIPMENT xmlns="">
      <SHIPMENTNBR>US1011</SHIPMENTNBR>
      <SHIPMENTTYPE_CD>BK</SHIPMENTTYPE_CD>
      <LINESCAC>ACLH</LINESCAC>
      <TERMINAL_CD>USJAX</TERMINAL_CD>
      <ISSUE_DT>2006-08-17T14:23:09</ISSUE_DT>
      <VESSEL_CD>VES</VESSEL_CD>
      <VOYAGE_CD>VOYA</VOYAGE_CD>
      <POL />
      <POD>POD_0</POD>
      <SHIPMENTUNITS>
        <UNITNBR>1234</UNITNBR>
        <UNITTYPE_CD>CAR</UNITTYPE_CD>
        <MAKE>HON</MAKE>
        <MODEL>ACCO</MODEL>
        <COLOR>RED</COLOR>
        <FULLEMPTY_CD>F</FULLEMPTY_CD>
        <LENGTH>0011</LENGTH>
        <WIDTH>0022</WIDTH>
        <HEIGHT>0033</HEIGHT>
        <DIMENSIONUOM>C</DIMENSIONUOM>
        <WEIGHT>000010</WEIGHT>
        <WGTUOM>K</WGTUOM>
      </SHIPMENTUNITS>
    </SHIPMENT>
    <SHIPMENT xmlns="">
      <SHIPMENTNBR>IN2052</SHIPMENTNBR>
      <SHIPMENTTYPE_CD>BK</SHIPMENTTYPE_CD>
      <LINESCAC>ACLH</LINESCAC>
      <TERMINAL_CD>USJAX</TERMINAL_CD>
      <ISSUE_DT>2006-08-17T14:23:09</ISSUE_DT>
      <VESSEL_CD>VES</VESSEL_CD>
      <VOYAGE_CD>VOYA</VOYAGE_CD>
      <POL />
      <POD>POD_0</POD>
      <SHIPMENTUNITS>
        <UNITNBR>1234</UNITNBR>
        <UNITTYPE_CD>CAR</UNITTYPE_CD>
        <MAKE>HON</MAKE>
        <MODEL>ACCO</MODEL>
        <COLOR>RED</COLOR>
        <FULLEMPTY_CD>F</FULLEMPTY_CD>
        <LENGTH>0011</LENGTH>
        <WIDTH>0022</WIDTH>
        <HEIGHT>0033</HEIGHT>
        <DIMENSIONUOM>C</DIMENSIONUOM>
        <WEIGHT>000010</WEIGHT>
        <WGTUOM>K</WGTUOM>
      </SHIPMENTUNITS>
    </SHIPMENT></doc>'
    select *
    from OpenXML(@i, '/doc/SHIPMENT')
            with (
                     id int '@mp:id'
                   , nbr varchar(40) 'SHIPMENTNBR'
    select *
    from OpenXML(@i, '/doc/SHIPMENT/SHIPMENTUNITS')
            with (
                     id int '@mp:id'
                   , ship_id int '@mp:parentid'
                   , ship_nbr varchar(40) '../SHIPMENTNBR'
                   , nbr varchar(40) 'UNITNBR'
    exec sp_xml_removedocument @i
    Best regards
    Michael

  • Drag a container and its children

    Hi,
    How do i drag a container and its children? 
    I see you can drag something and its parent, but i don't see how you can get the child from the draginitiator. 
    Thanks

    I've had a chance to play with this now and I had a pop at using the JLayeredPane, throwing a component to the top which is a MouseListener and KeyListener and consume()s all the events. Works fine for the most part, until there's a JButton within the component - they manage to carry on handling events despite the consuming component over the top of them. Hover over them and they repaint, they're clickable, and so on. Hmm.

  • To Obtain parent and its child categories

    Hi,
    I have a "categories" table. I use MySQL.
    categories
    category_id int(10)
    category_name varchar(255)
    parent_category_id int(10)
    category_id category_name parent_category_id
    1 A 0 -- 0 represents parent level
    2 B 0
    3 C 1
    4 D 1
    5 E 2
    I need a query to display parent and its child categories like:
    category_id category_name parent_category_id
    1 A 0
    3 C 1
    4 D 1
    Thanks.

    Can't help you with MySQL.
    But if you google for "mysql start with connect by", you may find what you need.

  • I just purchased harry potter and the deathly hallows digital copy but i just synced my ipod and its not there. i went back to get the copy again and its sasy the cose can only be used once. I dont have the movie and now i cant get it at all.

    I just purchased harry potter and the deathly hallows digital copy but i just synced my ipod and its not there. i went back to get the copy again and its says the code can only be used once. I dont have the movie and now i cant get it at all. i paid for it when i bought the movie but now i dont own it at all. i feel cheated, somebody please help!

    Not Charge
    - See:      
    iPod touch: Hardware troubleshooting
    iPhone and iPod touch: Charging the battery
    - Try another cable. Some 5G iPods were shipped with Lightning cable that were either initially defective or failed after short use.
    - Try another charging source
    - Inspect the dock connector on the iPod for bent or missing contacts, foreign material, corroded contacts, broken, missing or cracked plastic.
    - Make an appointment at the Genius Bar of an Apple store.
      Apple Retail Store - Genius Bar 

  • Accessing to Windows Server 2003 SP2 R2 32-bit from a Windows XP SP3 32-bit leaves a fork of the explorer and its children processes !!!

    When I try to access to Windows Server 2003 SP2 R2 32-bit from a Windows XP SP3 32-bit and then closes the RDP from Windows XP (the client side), a fork of the explorer and its children processes will persist in the server side !!!
    Take a look at the screenshot to understand:
    is this normal behavior !?
    Thank you for your understanding ;)

    Hi,
    I think this is normal behavior.
    You just close the RDP from client side but not log off the server, right?
    Regards.
    Vivian Wang
    Yes, right I closed the RDP from client side, not log off the server.

  • Hierarchy query showing  parent and their child records

    I'm a newbie on Oracle using Tora,
    I'm Trying to run a query that will show me a hierarchical view of parent and child records in a table.
    So far I"ve found a query format like this, but its not working
    SELECT employee_id, last_name, manager_id
    FROM employees
    CONNECT BY PRIOR employee_id = manager_id;
    but when running it with my tables and columns I get an error message
    saying something 'cannont run CONNECT BY in subquery'
    Any ideas?

    Thanks for all the help, I'm getting the error message
    'ORA-01473: cannot have subqueries in CONNECT BY clause'
    Here's my actual query
    select           resource_id, lname, org_id
    from           std_resource
    start with      resource_id = 413783
         connect by prior resource_id = org_id;
    I'm trying to display a hierarchical list of user resource_id's, last names, and org_id's from the std_resource table starting withe resource_id 413783

  • Disabling events for a container and its children

    I've stumbled across this one and don't currently have time to find a full solution, so just wondering if anyone else has implemented the same...
    I have a class which extends JPanel and adds a "wait(boolean)" method - when called with 'true' this kicks off a Timer which repaints with an animated overlay until it is called again with 'false.' The overlay is simply painted, it's not an actual component.
    All well and good so far.
    However, what I'd like to do is also disable mouse/key/etc events within that panel. Let's say one of the components which it contains is a table - I don't want the user to be able to change the selected row whilst the panel is in 'wait mode.'
    Since Swing uses a bubble-up event model, this isn't trivial - the on-liner solutions such as calling setEnabled() or overriding processEvent() won't work because the component itself doesn't actually receive the events.
    So, the solutions off the top of my head are,
    1. when wait is called, lock and traverse the tree and disable/enable all the components within it - not a good solution as this disrupts the state of the components and even if a map is maintained, and changes to the hierarchy during wait mode will cause trouble
    2. use the panel as a container for a wrapped panel plus an overlay which is only visible during wait mode, delegate various methods to the wrapped panel - I don't like this as it means overriding a whole truckload of methods and it feels fragile
    3. when wait is called, inject an overlay panel into the component tree - I don't like this either as it means understanding the panel's context in its parent (eg it might be the center of a BorderLayout or it might be the left component in a JSplitPane) and it also has obvious implications for events such as ComponentEvent on the children
    4. wrap a panel as per 2 and instead of delegating, simply provide a "getPanel()" method to obtain it - perfectly functional but utterly ugly and it allows people to easily and comprehensively break the behaviour if they wish
    I can't help feeling there's something obvious I'm missing :o) ...I'm thinking more along the lines of a composition model rather than extension now, but I think I fundamentally still have similar issues.
    Anyone got any ideas?

    I've had a chance to play with this now and I had a pop at using the JLayeredPane, throwing a component to the top which is a MouseListener and KeyListener and consume()s all the events. Works fine for the most part, until there's a JButton within the component - they manage to carry on handling events despite the consuming component over the top of them. Hover over them and they repaint, they're clickable, and so on. Hmm.

  • We are a family of 6 - 2 parents and 4 children.. We have an iMac, 3 macbooks, a Macbook Pro and an iPad. We all want to be able to share the itunes library, but it keeps telling us that it can't authorize more than 5 computers.  What can we do???

    How can we home share with more than 5 computers?? We are a family of 6 and each has his/her own computer.

    You can't. But iDevices don't count. So you should be able to share the 5 computers.

  • Disabling a panel and its children---help

    I have textfields and JComboBoxes in my JPanel.
    Depeding on some conditions, I would like to disable
    the user from entering any value in the text fields and
    choosing from JComboBox. If I set the setEnabled method to false,
    the existing values in those fields greyed-out. Because
    of this, the fields look "dull". Is there anyway, I can disable
    those fields while the look and feel remains the same.
    Thanks.

    morgalr,
    I can see both points. I agree wholeheartedly with you that when programmers stick to standards things are much better for users. Let me as-sure you that I am the first (and loudest) complainer about this. When I am forced to use a GUI that does not conform to my accustomed collection of [keyboard shortcut/mouseless usablility] features, I am famous for shamelessly cussing the thoughtless designer/programmer.
    I think that disabled/grayed-out looking controls tell the user "I am not relevant right now". But sometimes you don't want the control to say "I am not relevant right now", but rather "I am displaying useful information in a place where it makes sense for you to see it but not to change it right now". And grayed-out controls can be difficult to read.
    For example, I once had an application that listed 15 rows of information about slots in a physical device I was talking to serially. The 15-row list served a dual purpose: it showed software config info corresponding to each physical slot, and it allowed editing of slot's configuration only if the slot was not configured yet. Since each row consisted of a label, a combobox, 2 textfields, and a button, disabling some rows looked ugly and made the information presented difficult to read (in other words, the configured information looked less important than the not-yet-configured info, when it should have been looking more important). Furthermore, in the case when a row corresponded to an absent physical device, that row rightfully needed to be disabled. I chose to make my own disabled look for the not-yet-configured rows. It involved hiding the button, changing the background of the label, textfield, and background panel itself to yellowish (so that they didn't really look like controls anymore), but they were still lined up with and had a consistant look as the non-disabled rows. For real-estate purposes, this single list was a very intuitive way to look at this info -- At a glance user could tell (1) which rows were already configured, (2) the configuration information about those rows, (3) which rows needed to be configured, and (4) which rows were irrelevant.
    I know it's hard to explain the GUI theory without showing, but I am trying to give example of a situation when overriding the normal disabled look was a good thing. But the comboboxes could not easily have their look changed, and that caused me grief (I was still quite a newbie then and hadn't ever dreamed of overriding the UI or subcomponents of anything).
    /Mel

  • Copy a dir & all children subdirs EXCEPT for one dir (and all its subdirs)

    Is there a tool for SOLARIS 10 that will allow you to copy /u01 and all its children folders but exclude a specific child dir and its children?
    For example, I would like to copy the entire directory structure under /u01 EXCEPT for /u01/text and all its subdirectories. This would EXCLUDE /u01/text, /u01/text/output, /u01/text/output/archive, but COPY /u01/fonts/ and /u01/doc and /u01/doc/pdfs/.
    I checked the man for rcp and scp and found no such option.
    Thanks.
    Edited by: dubitancy on Dec 3, 2008 10:37 AM -- Meant to put SOLARIS 10 not 9.

    except rsync isnt installed by default so you would need to grab it from sunfreeware or blastwave.
    gnu tar (/usr/sfw/bin/gtar) can also exclude files.
    So you can copy by taring and untaring.

  • Parenting and child control with AS3

    Hi,
    I'm new to AS3 and although I can see some good practice and functionality I'm constantly getting stucked and can't yet make things that I would do so easily with AS2 - I almost need to relearn it from scratch!. Still I would appreciate some help and guidance on this...
    I made a class that creates a "kind" of menu with data from a XML file and basically what it does when it is called is create a emptyMC (a container), add a childMC (a square) and add another child (a text label). When I create the container I'm trying to add a MouseEvent that can act on each the container instances but all I can get is a MouseEvent on object containing all the added MCs. The code follows.
    Can anyone enlight me with this issue or explain what am I doing wrong.
    I can't understand well the dynamic parenting with AS3 and the lack of using instance names and dot parenting doesn't help.
    Thanks in advance.
    Note to Adobe: Previous versions of Flash Help Files and AS reference were by far more helpful than in CS4!
    In the timeline:
    import assets.myDynMenu;
    var theMenu:myDynMenu = new myDynMenu("menu.xml");
    stage.addChild(theMenu)
    stop();
    In the class:
    package assets
         import flash.display.*;
         import flash.events.Event;
         import flash.events.MouseEvent;
         import flash.text.TextField;
         import flash.net.*;
         public class myDynMenu extends Sprite {
              // INIT EXTERNAL DATA LOAD
              public function myDynMenu(theData) {
                   // LOADS THE MENU DATA FROM PREFORMATTED XML
                   var loader:URLLoader = new URLLoader();
                   var url:URLRequest = new URLRequest(theData);
                   loader.addEventListener(Event.COMPLETE, buildTheMenu);
                   loader.load(url);
              // XML MENU DATA LOAD CHECK - ON COMPLETE BUILD OBJECT AND CHILDREN
              public function buildTheMenu(event:Event):void {
                   var xml:XML = new XML(event.target.data);
                   for (var i=0; i<xml.menuData.menuItem.length(); i++) {
                        // ADDS A CONTAINER
                        var itemContainer:MovieClip = new MovieClip();
                        itemContainer.name = "menu" + i;
                        // THE NEXT LINE DOESN'T ACT AS I WISHED?!
                        // IN THE FUNCTION CALLED I NEED TO CONTROL THIS ITEM AND ITS CHILDREN
                        itemContainer.addEventListener(MouseEvent.MOUSE_OVER, onMouseOver);
                        itemContainer.x = 100 * i;
                        itemContainer.y = 0;
                        itemContainer.mouseEnabled = true;
                        itemContainer.mouseChildren = false;
                        addChild(itemContainer);
                        // ADDS A CHILD TO CONTAINER (a square)
                        var itemBase:MovieClip = new MovieClip();
                        itemBase.graphics.beginFill(xml.menuData.mConfig.mainItemColor);
                        itemBase.graphics.drawRect(0,0,xml.menuData.mConfig.mainItemW,xml.menuData.mConfig.mainIt emH);
                        itemBase.graphics.endFill();
                        itemBase.name = "base" + i;
                        itemBase.mouseEnabled = false;
                        itemBase.mouseChildren = false;
                        itemContainer.addChild(itemBase);
                        // ADDS ANOTHER CHILD TO CONTAINER (a text label)
                        var theLabel:TextField = new TextField();
                        theLabel.x = 5;
                        theLabel.y = 5;
                        theLabel.selectable = false;
                        theLabel.mouseEnabled = false;
                        theLabel.border = true;
                        theLabel.text = xml.menuData.menuItem[i].mName;
                        itemContainer.addChild(theLabel);
              // THIS IS THE MOUSE OVER THAT I NEED TO ACT ON EACH itemContainer (AND CHILDREN)
              private function onMouseOver(event:MouseEvent):void {
                   event.stopPropagation();
                   trace("You are over " + this.name );

    use:
    package assets
         import flash.display.*;
         import flash.events.Event;
         import flash.events.MouseEvent;
         import flash.text.TextField;
         import flash.net.*;
         public class myDynMenu extends Sprite {
              // INIT EXTERNAL DATA LOAD
              public function myDynMenu(theData) {
                   // LOADS THE MENU DATA FROM PREFORMATTED XML
                   var loader:URLLoader = new URLLoader();
                   var url:URLRequest = new URLRequest(theData);
                   loader.addEventListener(Event.COMPLETE, buildTheMenu);
                   loader.load(url);
              // XML MENU DATA LOAD CHECK - ON COMPLETE BUILD OBJECT AND CHILDREN
              public function buildTheMenu(event:Event):void {
                   var xml:XML = new XML(event.target.data);
                   for (var i=0; i<xml.menuData.menuItem.length(); i++) {
                        // ADDS A CONTAINER
                        var itemContainer:MovieClip = new MovieClip();
                        itemContainer.name = "menu" + i;
                        // THE NEXT LINE DOESN'T ACT AS I WISHED?!
                        // IN THE FUNCTION CALLED I NEED TO CONTROL THIS ITEM AND ITS CHILDREN
                        itemContainer.addEventListener(MouseEvent.MOUSE_OVER, onMouseOver);
                        itemContainer.x = 100 * i;
                        itemContainer.y = 0;
                        itemContainer.mouseEnabled = true;
                        itemContainer.mouseChildren = false;
                        addChild(itemContainer);
                        // ADDS A CHILD TO CONTAINER (a square)
                        var itemBase:MovieClip = new MovieClip();
                        itemBase.graphics.beginFill(xml.menuData.mConfig.mainItemColor);
                        itemBase.graphics.drawRect(0,0,xml.menuData.mConfig.mainItemW,xml.menuData.mCon fig.mainItemH);
                        itemBase.graphics.endFill();
                        itemBase.name = "base" + i;
                        itemBase.mouseEnabled = false;
                        itemBase.mouseChildren = false;
                        itemContainer.addChild(itemBase);
                        // ADDS ANOTHER CHILD TO CONTAINER (a text label)
                        var theLabel:TextField = new TextField();
                        theLabel.x = 5;
                        theLabel.y = 5;
                        theLabel.selectable = false;
                        theLabel.mouseEnabled = false;
                        theLabel.border = true;
                        theLabel.text = xml.menuData.menuItem[i].mName;
                        itemContainer.addChild(theLabel);
              // THIS IS THE MOUSE OVER THAT I NEED TO ACT ON EACH itemContainer (AND CHILDREN)
              private function onMouseOver(event:MouseEvent):void {
                   event.stopPropagation();
                   trace("You are over " + event.currentTarget.name );

  • [HELP!] Parenting and Forward Kinematics of Symbols in Flash CS5

    Example: I have symbol A and symbol B. Symbol B is inside symbol A, so when I move symbol A, B follows. My problem is that I want to animate A, but also B. But... Whenever there is a keyframe of A, the animation of Symbol B restarts, and has no connection to the main timeline.
    So, I have a character with symbols inside other symbols, both inside one big symbol [ Torso (head ( facial features, hair), legs (feet), arms (hands) (soemthing like this) ]. And I want to animate the parents and be able to animate the children after that. But the children animation restarts whenever there is a parent keyframe. I say 'parent' but I don't know if having a symbol inside of a symbol, can be considered proper Parenting. So my question perhaps is how can I do proper [Forward Kinematics in Flash CS5.
    For example in 3D softwares, I move and rotate the parent and the children follow, and after that I can animate the children, and all that relates directly to the main timeline. Flash seems to load symbol-children's timeline everythime there is a parent's keyframe.
    Any links or tuts? Any help aprreciated. Please consider that this is my second day using Flash. So I'd really appreciate a step by step answer.
    Cheers,
    Sara Naves

    I know its like 5 months late but i am looking for an answer to a similair question. But your problem i think can be resolved using the properties menu. When you have a graphic symbol with animation inside, once you place a keyframe along that symbols layer, for some reason it is beginning the nested animation on frame 1. It shouldnt do this. So when you place a keyframe, go to the properties menu and look at what the symbol settings are. It should be set to either loop, which will lopp the animation inside the symbol, or play once which will play the animation one time then stop on the last frame. For example, if you set a keyframe on frame 30, the properties tab should show you frame 30 as well, meaning that the animation inside that symbol is at frame 30 as well. If it goes back to 1 then you might have to manually se it to whichever frame it should be on.
    It should be doing this but i remember i had the same issue a few versions back and i had to manually set my animations in the properties menu all the time.
    Hope it helps

  • Resizing a node and make children appear/disappear on its "visibility"

    I guees I could wrap the question within a smaller sample code snippet. On the other side I put the whole thing in here, so you can see what I am working on (should be complete an runnable).
    I am playing around with some sort of windowing within JavaFX (building my own windows).
    It does not look nice so far, but it works somehow. Anyhow, when I minimize the window by dragging the frame it will be minimized till the size of its children. I would like to get it as small as I want. Uncommenting the Line " //window.setMinSize(0.0, 0.0);" will let me make it as small as possible, BUT the children stay visible too, but they should dissapear as soon as the frame hits their bounds.
    Anybody having any idea for a nice/slick solution ?
    Here is the code:
    package org.rob.javafx.framework;
    import javafx.application.Application;
    import javafx.event.EventHandler;
    import javafx.geometry.Point2D;
    import javafx.scene.Cursor;
    import javafx.scene.Group;
    import javafx.scene.Scene;
    import javafx.scene.control.Button;
    import javafx.scene.control.ButtonBuilder;
    import javafx.scene.control.Label;
    import javafx.scene.control.LabelBuilder;
    import javafx.scene.input.MouseEvent;
    import javafx.scene.layout.*;
    import javafx.stage.Stage;
    import javafx.stage.StageStyle;
    public class Tests  extends Application {
        private Stage primaryStage;
        private double titleBox_initX;
        private double titleBox_initY;
        private Point2D titleBox_dragAnchor;
        private boolean resize_dragStart = false;
        private double resize_initWidth;
        private double resize_initHeight;
        private double resize_initX;
        private double resize_initY;
        private int resize_edge = EDGE_NONE;
        private Point2D resize_dragAnchor;
        private boolean izing_isMax = false;
        private double izing_X;
        private double izing_Y;
        private double izing_Width;
        private double izing_Height;
        private void init(Stage primaryStage) {
            this.primaryStage = primaryStage;
            Group root = new Group();
            primaryStage.setResizable(true);
            primaryStage.setScene(new Scene(root, 500,500));
            primaryStage.initStyle(StageStyle.TRANSPARENT);
            final VBox centerContent = VBoxBuilder.create().children(new Label("Label1"), new Label("Label2")).build();
            final BorderPane windowContent = BorderPaneBuilder.create().center(centerContent).build();
            final Region windowContentBox = HBoxBuilder.create().children(windowContent).build();
            final Region window = createWindow("Blue circle", windowContentBox, root);
            window.setTranslateX(200);
            window.setTranslateY(80);
        private Region createWindow(final String title, final Region content, final Group parent) {
            final StackPane window = StackPaneBuilder.create().prefHeight(300).cursor(Cursor.HAND).prefWidth(200).style("-fx-background-color:#b0c4de; -fx-border-style:solid; -fx-border-width:6px; -fx-border-color: linear-gradient(to bottom right, gray, gray 50%, black 50%, black);").build();
            // Without : minimizing stops at the space the children need, with this you can make it as small as possible,
            // BUT the children are still visible. -> ToDo: Make the children dissapear, but keep the titlebar.
            //window.setMinSize(0.0, 0.0);
            // Title-Bar
            final Label titleLabel = LabelBuilder.create().text(title).style("-fx-text-fill:yellow;").build();
            final Region titleBoxSpring = new Region();
            titleBoxSpring.setPrefWidth(20);
            titleBoxSpring.setMinWidth(Region.USE_PREF_SIZE);
            final Button titleMinBtn = ButtonBuilder.create().text("_").cursor(Cursor.DEFAULT).build();
            final Button titleMaxBtn = ButtonBuilder.create().text("+").cursor(Cursor.DEFAULT).build();
            final Button titleCloseBtn = ButtonBuilder.create().text("X").cursor(Cursor.DEFAULT).build();
            HBox.setHgrow(titleBoxSpring, Priority.ALWAYS); // make the "spring" always grow, so the buttons are always on the right.
            final HBox titleResizeButtonBox = HBoxBuilder.create().spacing(2).children(titleMinBtn, titleMaxBtn, titleCloseBtn).style("-fx-alignment:center-right;").build();
            final HBox titleBox = HBoxBuilder.create().children(titleLabel,titleBoxSpring,titleResizeButtonBox).prefHeight(30).cursor(Cursor.HAND).spacing(4.0).style("-fx-alignment:center-left; -fx-background-color:blue; -fx-border-style:dashed; -fx-border-width:1px; -fx-border-color: linear-gradient(to bottom right, gray, gray 50%, black 50%, black);").build();
            final BorderPane windowContentPane = BorderPaneBuilder.create().top(titleBox).center(content).build();
            titleMinBtn.setOnMouseClicked(new EventHandler<MouseEvent>() {
                public void handle(MouseEvent me) {
                    // -------- Minimizing-Handling ------
                    if(izing_isMax)
                        maximizeItRevert(window);
                    else
                        minimizeIt(window);            }
            titleMaxBtn.setOnMouseClicked(new EventHandler<MouseEvent>() {
                public void handle(MouseEvent me) {
                    // -------- Maximize-Handling ------
                    if(izing_isMax)
                        maximizeItRevert(window);
                    else
                        maximizeIt(window);
            titleCloseBtn.setOnMouseClicked(new EventHandler<MouseEvent>() {
                public void handle(MouseEvent me) {
                    parent.getChildren().remove(window);
            titleBox.setOnMouseClicked(new EventHandler<MouseEvent>() {
                public void handle(MouseEvent me) {
                    switch(me.getClickCount()){
                        case 1:
                            break;
                        case 2:
                            // -------- Maximize-Handling ------
                            if(izing_isMax)
                                maximizeItRevert(window);
                            else
                                maximizeIt(window);
                            break;
                        default:
                            break;
                    //when mouse is pressed, store initial position
                    titleBox_initX = window.getTranslateX();
                    titleBox_initY = window.getTranslateY();
                    titleBox_dragAnchor = new Point2D(me.getSceneX(), me.getSceneY());
            titleBox.setOnMousePressed(new EventHandler<MouseEvent>() {
                public void handle(MouseEvent me) {
                    //when mouse is pressed, store initial position
                    titleBox_initX = window.getTranslateX();
                    titleBox_initY = window.getTranslateY();
                    titleBox_dragAnchor = new Point2D(me.getSceneX(), me.getSceneY());
            titleBox.setOnMouseDragged(new EventHandler<MouseEvent>() {
                public void handle(MouseEvent me) {
                    if(!izing_isMax){
                        double dragX = me.getSceneX() - titleBox_dragAnchor.getX();
                        double dragY = me.getSceneY() - titleBox_dragAnchor.getY();
                        double newXPosition = titleBox_initX + dragX;
                        double newYPosition = titleBox_initY + dragY;
                        window.setTranslateX(newXPosition);
                        window.setTranslateY(newYPosition);
            window.setOnMouseExited(new EventHandler<MouseEvent>() {
                public void handle(MouseEvent me) {
                    if(window.getCursor() != Cursor.DEFAULT)
                        window.setCursor(Cursor.DEFAULT);
            window.setOnMouseMoved(new EventHandler<MouseEvent>() {
                public void handle(MouseEvent me) {
                    // ------ Resize-Handling ------
                    int resize_edge = getRESIZE_EDGE(me, window);
                    switch(resize_edge){
                        case EDGE_NORTH:
                            if (window.getCursor() != Cursor.N_RESIZE)
                                window.setCursor(Cursor.N_RESIZE);
                            break;
                        case EDGE_NORTH_EAST:
                            if (window.getCursor() != Cursor.NE_RESIZE)
                                window.setCursor(Cursor.NE_RESIZE);
                            break;
                        case EDGE_EAST:
                            if (window.getCursor() != Cursor.E_RESIZE)
                                window.setCursor(Cursor.E_RESIZE);
                            break;
                        case EDGE_SOUTH_EAST:
                            if (window.getCursor() != Cursor.SE_RESIZE)
                                window.setCursor(Cursor.SE_RESIZE);
                            break;
                        case EDGE_SOUTH:
                            if (window.getCursor() != Cursor.S_RESIZE)
                                window.setCursor(Cursor.S_RESIZE);
                            break;
                        case EDGE_SOUTH_WEST:
                            if (window.getCursor() != Cursor.SW_RESIZE)
                                window.setCursor(Cursor.SW_RESIZE);
                            break;
                        case EDGE_WEST:
                            if (window.getCursor() != Cursor.W_RESIZE)
                                window.setCursor(Cursor.W_RESIZE);
                            break;
                        case EDGE_NORTH_WEST:
                            if (window.getCursor() != Cursor.NW_RESIZE)
                                window.setCursor(Cursor.NW_RESIZE);
                            break;
                        default:
                            if (window.getCursor() != Cursor.DEFAULT)
                                window.setCursor(Cursor.DEFAULT);
                            break;
            window.setOnMousePressed(new EventHandler<MouseEvent>() {
                public void handle(MouseEvent me) {
                    // ------ Resize-Handling ------
                    resize_edge = getRESIZE_EDGE(me, window);
                    if(resize_edge != EDGE_NONE){
                        resize_initX = window.getTranslateX();
                        resize_initY = window.getTranslateY();
                        resize_initWidth = window.getWidth();
                        resize_initHeight = window.getHeight();
                        resize_dragAnchor = new Point2D(me.getSceneX(), me.getSceneY());
                        resize_dragStart = true;
                    } else
                        resize_dragStart = false;
            window.setOnMouseDragged(new EventHandler<MouseEvent>() {
                public void handle(MouseEvent me) {
                    // ------ Resize-Handling ------
                    if(resize_dragStart){
                        double dragX = me.getSceneX() - resize_dragAnchor.getX();
                        double dragY = me.getSceneY() - resize_dragAnchor.getY();
                        System.out.println("DraxX = " + dragX + " ; DragY = " + dragY);
                        double newWidth = window.getPrefWidth();
                        double newHeight = window.getPrefHeight();
                        switch(resize_edge){
                            case EDGE_NORTH:
                                newHeight = resize_initHeight - dragY;
                                window.setTranslateY(resize_initY + dragY);
                                break;
                            case EDGE_NORTH_EAST:
                                newHeight = resize_initHeight - dragY;
                                window.setTranslateY(resize_initY + dragY);
                                newWidth = resize_initWidth + dragX;
                                break;
                            case EDGE_EAST:
                                newWidth = resize_initWidth + dragX;
                                break;
                            case EDGE_SOUTH_EAST:
                                newHeight = resize_initHeight + dragY;
                                newWidth = resize_initWidth + dragX;
                                break;
                            case EDGE_SOUTH:
                                newHeight = resize_initHeight + dragY;
                                break;
                            case EDGE_SOUTH_WEST:
                                newHeight = resize_initHeight + dragY;
                                newWidth = resize_initWidth - dragX;
                                window.setTranslateX(resize_initX + dragX);
                                break;
                            case EDGE_WEST:
                                newWidth = resize_initWidth - dragX;
                                window.setTranslateX(resize_initX + dragX);
                                break;
                            case EDGE_NORTH_WEST:
                                newHeight = resize_initHeight - dragY;
                                window.setTranslateY(resize_initY + dragY);
                                newWidth = resize_initWidth - dragX;
                                window.setTranslateX(resize_initX + dragX);
                                break;
                            default:
                                break;
                        System.out.println("New-Width = " + newWidth + " ; New-Height = " + newHeight);
                        System.out.println("Content-Width = " + content.getWidth() + " ; Content-Height = " + content.getHeight());
                        window.setPrefWidth(newWidth);
                        window.setPrefHeight(newHeight);
            window.getChildren().addAll(windowContentPane);
            parent.getChildren().add(window);
            return window;
        private void maximizeItRevert(Region window){
            window.setTranslateX(izing_X);
            window.setTranslateY(izing_Y);
            window.setPrefWidth(izing_Width);
            window.setPrefHeight(izing_Height);
            izing_isMax = false;
        private void maximizeIt(Region window){
            izing_X = window.getTranslateX();
            izing_Y = window.getTranslateY();
            izing_Width = window.getWidth();
            izing_Height = window.getHeight();
            window.setTranslateX(0);
            window.setTranslateY(0);
            if(primaryStage.getStyle() == StageStyle.TRANSPARENT){
                window.setPrefWidth(window.getScene().getWindow().getWidth());
                window.setPrefHeight(window.getScene().getWindow().getHeight());
            } else {
                window.setPrefWidth(window.getScene().getWindow().getWidth() - 16);     // ToDo: 16 is hardcoded, since I do not know how to get the window border size. Still to do.
                window.setPrefHeight(window.getScene().getWindow().getHeight() - 38);   // ToDo: same
            izing_isMax = true;
        private void minimizeIt(Region window){
            izing_X = window.getTranslateX();
            izing_Y = window.getTranslateY();
            izing_Width = window.getWidth();
            izing_Height = window.getHeight();
            window.setTranslateX(0);
            if(primaryStage.getStyle() == StageStyle.TRANSPARENT)
                window.setTranslateY(window.getScene().getWindow().getHeight() - 50);
            else
                window.setTranslateY(window.getScene().getWindow().getHeight() - 88);
            window.setPrefWidth(60);
            window.setPrefHeight(30);
            izing_isMax = true;
        private final static int EDGEWITH = 8;
        private final static int EDGE_NONE = 0;
        private final static int EDGE_NORTH = 1;
        private final static int EDGE_NORTH_EAST = 2;
        private final static int EDGE_EAST = 3;
        private final static int EDGE_SOUTH_EAST = 4;
        private final static int EDGE_SOUTH = 5;
        private final static int EDGE_SOUTH_WEST = 6;
        private final static int EDGE_WEST = 7;
        private final static int EDGE_NORTH_WEST = 8;
        private int getRESIZE_EDGE(MouseEvent me, Region region){
            if(isN_RESIZE(me, region)){
                return EDGE_NORTH;   
            } else if(isNE_RESIZE(me, region)){
                return EDGE_NORTH_EAST;
            } else if(isE_RESIZE(me, region)){
                return EDGE_EAST;
            } else if(isSE_RESIZE(me, region)){
                return EDGE_SOUTH_EAST;
            } else if(isS_RESIZE(me, region)){
                return EDGE_SOUTH;
            } else if(isSW_RESIZE(me, region)){
                return EDGE_SOUTH_WEST;
            } else if(isW_RESIZE(me, region)){
                return EDGE_WEST;
            } else if(isNW_RESIZE(me, region)){
                return EDGE_NORTH_WEST;
            } else
                return EDGE_NONE;
        private boolean isN_RESIZE(MouseEvent me, Region region){       // North
            double recentXPos = me.getX();
            double recentYPos = me.getY();
            double xMin = EDGEWITH;
            double xMax = region.getWidth() - EDGEWITH;
            double yMin = 0;
            double yMax = EDGEWITH;
            return recentXPos > xMin && recentXPos < xMax && recentYPos > yMin && recentYPos < yMax;
        private boolean isNE_RESIZE(MouseEvent me, Region region){      // North-East (Upper-Right Corner)
            double recentXPos = me.getX();
            double recentYPos = me.getY();
            double xMin = region.getWidth() - EDGEWITH;
            double xMax = region.getWidth();
            double yMin = 0;
            double yMax = EDGEWITH;
            return recentXPos > xMin && recentXPos < xMax && recentYPos > yMin && recentYPos < yMax;
        private boolean isE_RESIZE(MouseEvent me, Region region){       // East
            double recentXPos = me.getX();
            double recentYPos = me.getY();
            double xMin = region.getWidth() - EDGEWITH;
            double xMax = region.getWidth();
            double yMin = EDGEWITH;
            double yMax = region.getHeight() - EDGEWITH;
            return recentXPos > xMin && recentXPos < xMax && recentYPos > yMin && recentYPos < yMax;
        private boolean isSE_RESIZE(MouseEvent me, Region region){      // South-East (Lower-Right Corner)
            double recentXPos = me.getX();
            double recentYPos = me.getY();
            double xMin = region.getWidth() - EDGEWITH;
            double xMax = region.getWidth();
            double yMin = region.getHeight() - EDGEWITH;
            double yMax = region.getHeight();
            return recentXPos > xMin && recentXPos < xMax && recentYPos > yMin && recentYPos < yMax;
        private boolean isS_RESIZE(MouseEvent me, Region region){      // South
            double recentXPos = me.getX();
            double recentYPos = me.getY();
            double xMin = EDGEWITH;
            double xMax = region.getWidth() - EDGEWITH;
            double yMin = region.getHeight() - EDGEWITH;
            double yMax = region.getHeight();
            return recentXPos > xMin && recentXPos < xMax && recentYPos > yMin && recentYPos < yMax;
        private boolean isSW_RESIZE(MouseEvent me, Region region){      // South-West (Lower-Left Corner)
            double recentXPos = me.getX();
            double recentYPos = me.getY();
            double xMin = 0;
            double xMax = EDGEWITH;
            double yMin = region.getHeight() - EDGEWITH;
            double yMax = region.getHeight();
            return recentXPos > xMin && recentXPos < xMax && recentYPos > yMin && recentYPos < yMax;
        private boolean isW_RESIZE(MouseEvent me, Region region){      // West
            double recentXPos = me.getX();
            double recentYPos = me.getY();
            double xMin = 0;
            double xMax = EDGEWITH;
            double yMin = EDGEWITH;
            double yMax = region.getHeight() - EDGEWITH;
            return recentXPos > xMin && recentXPos < xMax && recentYPos > yMin && recentYPos < yMax;
        private boolean isNW_RESIZE(MouseEvent me, Region region){      // North-West (Upper-Left Corner)
            double recentXPos = me.getX();
            double recentYPos = me.getY();
            double xMin = 0;
            double xMax = EDGEWITH;
            double yMin = 0;
            double yMax = EDGEWITH;
            return recentXPos > xMin && recentXPos < xMax && recentYPos > yMin && recentYPos < yMax;
        @Override
        public void start(Stage primaryStage) throws Exception {
            init(primaryStage);
            primaryStage.show();
        public static void main(String[] args) { launch(args); }
    }

    Hmm~ in your case I think you have to compute it by yourself
    I would use the width and height of the content as dependency.
    Add this to the hande-method of your MouseDragged-EventHandler:
    HBox center = (HBox) ((BorderPane) ((StackPane) window).getChildren().get(0)).getCenter();
    HBox top = (HBox) ((BorderPane) ((StackPane) window).getChildren().get(0)).getTop();
    /** @todo: compute the border of the window into this */
    if (newWidth < center.getWidth() || (newHeight - top.getHeight()) < center.getHeight()) {
        center.setManaged(false);
        center.setVisible(false);
    else {
        center.setManaged(true);
        center.setVisible(true);
    }

  • [b]HOW TO:[/b]  Copy and Paste THE Filename AND its PATH from Finder

    HOW TO DO THIS: Copy and Paste THE selected Filename AND its entire PATH from Finder to another application as in document footer reference, or document database which has a path field to aid in locating the file later.
    Finder, Spotlight and File Info (can be used to display Path) or using Command F, command I, etc. but user is not allowed to copy the path to clipboard.
    This is rudimentary, yet the word Path, is unknown to Mac Help.
    Message was edited by: jbov

    AJ,
    Isn't it amazing....There is no Command Key for this action? Apple Care was confounded too. And thanx, it'll be a help....
    Jim
    its tedious, but this should work:
    open a terminal window.
    Drag and drop the icon for the file in the terminal
    window.
    This will put the full path including the filename on
    the command line.
    Copy the path from the command line, and paste
    (wherever).
    Close the terminal window.

Maybe you are looking for