Help with Registering objects/access cache

Below is the save routine i use to persist my top-level objects to the database.
It seems very likely that I am doing something fundamentally wrong as I am obvserving behaviour that I do not expect.
For example, I am using a field called version_id to hold an integer for optimistic locking. The first time I save the object, the correct sql is created, and the database row looks as I would expect. However, subsequent attempts to save do not work because I cannot figure out how to get a reference to the object with the incremented version_id.
It would be much appreciated if someone can see things i am doing incorrecty with the implementation i have included below.
thanks in advance.
craig
public static Object save(IdentifiableValue obj, String sessionName) {
          Object entity= null;
          try {
               UnitOfWork uow= getSession(sessionName).acquireUnitOfWork();
               if (obj.isNew())
                    uow.registerObject(obj);
               entity= uow.deepMergeClone(obj);
               //                    uow.printRegisteredObjects();
               uow.commit();
               //               uow.registerObject(facility);
          } catch (DatabaseException e) {
               e.printStackTrace();
          Object returnValue= getSession(sessionName).readObject(obj);
          return returnValue;
     }

When I create a new record, the id (sequence generated) gets set fine, but not the version number.
When I save a record, the version id is not incremented.
It seems to use the version number field properly in the sql though.
Below is my sessions.xml entry, which looks like I am not JTS unless I am doing something incorrect.
Any help is much appreciated.
<session>
          <name>default</name>
          <project-xml>toplink.xml</project-xml>
          <session-type>
               <server-session/>
          </session-type>
          <enable-logging>true</enable-logging>
          <logging-options>
               <log-debug>true</log-debug>
               <log-exceptions>true</log-exceptions>
               <log-exception-stacktrace>true</log-exception-stacktrace>
               <print-thread>true</print-thread>
               <print-session>true</print-session>
               <print-connection>true</print-connection>
               <print-date>true</print-date>
          </logging-options>
          <login>
          <platform-class>oracle.toplink.internal.databaseaccess.OraclePlatform</platform-class>
               <datasource>jdbc/toplinkDS</datasource>
               <uses-external-connection-pool>true</uses-external-connection-pool>
               <uses-external-transaction-controller>false</uses-external-transaction-controller>
          </login>
     </session>

Similar Messages

  • [ETL]Could you please help with a problem accessing UML stereotype attributes ?

    Hi all,
    Could you please help with a problem accessing UML stereotype attributes and their values ?
    Here is the description :
    -I created a UML model with Papyrus tool and I applied MARTE profile to this UML model.
    -Then, I applied <<PaStep>> stereotype to an AcceptEventAction ( which is one of the element that I created in this model ), and set the extOpDemand property of the stereotype to 2.7 with Papyrus.
    -Now In the ETL file, I can find the stereotype property of extOpDemand as follows :
    s.attribute.selectOne(a|a.name="extOpDemand") , where s is a variable of type Stereotype.
    -However I can't access the value 2.7 of the extOpDemand attribute of the <<PaStep>> Stereotype. How do I do that ?
    Please help
    Thank you

    Hi Dimitris,
    Thank you , a minimal example is provided now.
    Version of the Epsilon that I am using is : ( Epsilon Core 1.2.0.201408251031 org.eclipse.epsilon.core.feature.feature.group Eclipse.org)
    Instructions for reproducing the problem :
    1-Run the uml2etl.etl transformation with the supplied launch configuration.
    2-Open lqn.model.
    There are two folders inside MinimalExample folder, the one which is called MinimalExample has 4 files, model.uml , lqn.model, uml2lqn.etl and MinimalExampleTransformation.launch.
    The other folder which is LQN has four files. (.project),LQN.emf,LQN.ecore and untitled.model which is an example model conforming to the LQN metamodel to see how the model looks like.
    Thank you
    Mana

  • Help with Converting an Access query

    Hello:
    First time poster and would appreciate some help in converting this Access query into T-SQL so I can use in a Stored Procedure. I don't need help in resolving the syntax for the variables as parameter in the second query, but stuck in writing the first query
    in T-SQL . I assume I need some type of nested query with a left join to another query in T-SQL. 
    How do I convert this from Access into MS-SQL
    SELECT TBL_MONTH.L_Month, TBL_MONTH.L_MonthName
    FROM TBL_MONTH LEFT JOIN qry_MonthCheck ON TBL_MONTH.L_Month = qry_MonthCheck.L_Month
    WHERE (((qry_MonthCheck.L_Month) Is Null));
    qryMonthCheck in Access is defined as
    SELECT TBL_MONTH.L_Month, TBL_SIGNOFF.SO_YEAR, TBL_SIGNOFF.SO_USER, TBL_SIGNOFF.SO_LOCATION
    FROM TBL_MONTH RIGHT JOIN TBL_SIGNOFF ON TBL_MONTH.L_Month = TBL_SIGNOFF.SO_MONTH
    WHERE (((TBL_SIGNOFF.SO_YEAR)=[forms]![frm_signoff]![cboyear]) AND ((TBL_SIGNOFF.SO_LOCATION)=[Tempvars]![tmpVarUserLOC]));

    It is very much up to personal taste. For tables I use no prefix at all. Or suffix. I prefer plural: categories, products, etc. For junction tables, I drop the plural in the first entity, for instance productcategories. As for the case, many people prefer
    initial uppercase, while I go for lowercase only. But initial uppercase has its points, particularly in documentation. I am a staunch advocate of using case-sensitive collation for metadata. I don't see any point in mixing productcategories, Productcategories,
    ProductCategories etc. That can only cause confusion.
    As for either entities, I don't use views much, and I don't have any prefix for these either. In fact, several views I've been involved used to be tables once upon a time.
    If you want to add a marker to the object name, I recommend using a suffix. It is much easier to find objects in the version control system and other browser, when not everything is cluttered on the same letter. For instance, I typically add _sp at the end
    of stored procedure names.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Help with layered objects

    I am new to Pages and struggling to layer objects. I am working with opacity, but unable to move one object on top of another.
    thanks for any help,
    Kim

    Welcome to Apple Discussions Kim
    When you insert any object in a Pages document & have it "fixed on page," by default wrap is turned on with a 12 point gutter. This results in objects "pushing" other objects out of the way. With your object(s) selected, go to the wrap inspector & uncheck "object causes wrap." Unfortunately, there is no way to change this default setting, it will have to be done manually for any object inserted. You may wish to leave feedback for the Pages team asking that the ability to have wrap apply to all objects or not be added as a preference in future versions of Pages.

  • Hoping for a little help with registering and hosting questions.

    i was hoping i could get some information from some of you
    that have personal experience with registering your site and
    picking a hosting provider.
    im wondering what the difference is between say....Dot5
    hosting at 5.00 a month and .. network solutions at 29.99 a month?
    my local provider here in sacramento wants 30 a month as
    well......299.oo a yr.
    should I go with a local provider? or go with ... say GoDaddy
    or some other company?
    also, registering. Im about to register my site name.
    however, some companies include it in the "packages" they offer.
    should I register it myself or let the hosting company I choose do
    it?
    sorry for the newb questions....but I cant find any good info
    on this and I was hoping maybe some of you that have already done
    this to chime in.
    thanks in advance.

    If you want almost all of the below features for about $9.00
    a month go to
    Gate.com and pick your package. I use them for several web
    sites and have
    never been dissatisfied with their services or features.
    They will register your domain and I've done it both ways,
    but have never
    had problems with them but it does make a lot of sense to
    register it
    yourself and keep full ownership....
    "Sonjay" <[email protected]> wrote in message
    news:C19368C5.A15FD%[email protected]...
    > There's probably not a dime's worth of difference
    between the Dot5 hosting
    > and the NetSol hosting, but I wouldn't recommend either
    of those companies
    > for hosting.
    >
    > $30/month seems high unless you have very specific needs
    -- there's plenty
    > of good hosting around for $8 or $10 a month. The thing
    you need to do is
    > decide what your requirements are: php? asp? MySQL?
    Access? dot.net?
    > E-mail?
    > Telnet or SSH access? Do you need/want a control panel
    that makes it easy
    > for you set up your own e-mail accounts, password
    protect directories, and
    > that sort of thing, or will basic FTP access be all you
    need? Do you want
    > a
    > statistics package included with your hosting? Do you
    need to run more
    > than
    > one domain under the same account? If all of the above
    makes you shake
    > your
    > head and say "I don't need any of that," then you can
    probably manage just
    > fine with any of the $5-$10 month basic packages, with a
    reputable host.
    >
    > Whatever you do, register your domain separately from
    your hosting, and
    > only
    > use an ICANN-accredited registrar, none of those
    resellers that tend to
    > disappear and/or register people's domains in their own
    name. I have
    > nothing
    > good to say about NetSol as a registrar, going back to
    the years when they
    > were the only game in town, and I will never use them
    again, but any other
    > ICANN-accredited registrar should do you just fine.
    >
    > --
    > Sonjay
    >
    > On 11/29/06 3:51 PM, "Progressive_Learning" wrote:
    >
    >>
    >>
    >> i was hoping i could get some information from some
    of you that have
    >> personal
    >> experience with registering your site and picking a
    hosting provider.
    >>
    >> im wondering what the difference is between
    say....Dot5 hosting at 5.00 a
    >> month and .. network solutions at 29.99 a month?
    >>
    >> my local provider here in sacramento wants 30 a
    month as well......299.oo
    >> a
    >> yr.
    >>
    >> should I go with a local provider? or go with ...
    say GoDaddy or some
    >> other
    >> company?
    >>
    >> also, registering. Im about to register my site
    name. however, some
    >> companies include it in the "packages" they offer.
    should I register it
    >> myself
    >> or let the hosting company I choose do it?
    >>
    >> sorry for the newb questions....but I cant find any
    good info on this and
    >> I
    >> was hoping maybe some of you that have already done
    this to chime in.
    >>
    >> thanks in advance.
    >>
    >
    >

  • Help with public function (accessing to addchild object from other public function)

    Hi, i have below piece of my code AS3 (Flash CS4). I would like to get access to addchild Movie Clip object (ZoltyWjazdMC) in function two() which i created by addchild command in public function one(). I know it`s basic question but i can`t find answer for it. Anybody would help me with that?
    public function one():void
    var ZoltyWjazdMC:MovieClip = new MovieClip();
    this.addChild(ZoltyWjazdMC);
    ZoltyWjazdMC.addChild(assets.ZoltyWjazd.loader);
    this.setChildIndex(ZoltyWjazdMC,1);
    ZoltyWjazdMC.alpha = 0;
    ZoltyWjazdMC.visible = true;
    assets.ZielonyWjazd.alpha = 1;
    public function two():void
    ZoltyWjazdMC.alpha = 1;
    Do i need remove "this" and change it to "stage". Is it necessary?

    Define your variable var ZoltyWjazdMC:MovieClip outside of function one(). Currently ZoltyWjazdMC is local to function one() so that function two() does not understand what it is!

  • Stumped with registering objects

    I have tried mightily, but am not getting behaviour I desire.
    I would like to eventually move to using DTO's to move data in and out of my session tier, but for the short term, I am trying to get the 'quick and dirty' approach to work.
    For instance,
    I query say 40 objects. I store a list of them in session scope in the servlet container. The gui then will allow a user to make some changes to one of these objects, and then resubmit it to the session tier to be saved.
    The problem seems to be I am not starting a unit of work before the changes start, and making the changes to clones. The servlet code does not know about toplink, it just reads a list of objects, picks an arbitrary one to edit, and then resubmits it.
    I was using deepMergeClone on the object to be saved to allow toplink to get a list of differences, and this seemed to work for most scenarios, but not all. I have heard that the merge api is more for objects which have been disconnected from the session.
    I have attached the methods i have written for load/save. Any feedback would be very much appreciated...espicially if it explains that this interm method will work, acknowledging I will implement a better facade pattern with DTO's in the future. (I really need demo quality soon)
    Here is the load method:
    public static Collection returnQueryResult(String queryBarId) {
              UnitOfWork uow= getSession().acquireUnitOfWork();
              Vector facilities= null;
              try {
                   Vector results=
                        (Vector) getSession().readAllObjects(
                             QueryBarResult.class,
                             new ExpressionBuilder().get("id").equal(queryBarId));
                   facilities= new Vector(results.size());
                   Iterator iter= results.iterator();
                   IdentifiableObject theFacility;
                   while (iter.hasNext()) {
                        theFacility= ((QueryBarResult) iter.next()).getQueriedObject();
                        facilities.add(uow.registerExistingObject(theFacility));
                   } catch (Throwable th) {
                   th.printStackTrace();
              return facilities;
    Here is the save:
         public static Object save(IdentifiableValue obj, String sessionName) {
              try {
                   UnitOfWork uow= getSession(sessionName).acquireUnitOfWork();
                   uow.registerObject(obj);
                   uow.deepMergeClone(obj);
                   uow.commit();               
              } catch (DatabaseException e) {
                   e.printStackTrace();
              return getSession(sessionName).readObject(obj);

    Craig,
    Sorry to hear you are having such difficulty getting your demo going. Have you looked at the session-bean and jsp-Servlet demos that are shipped with TopLink. They may help you get something running quickly.
    I would like to clarify some issues that you have raised.
    1. The instances in the shared cache, those returned from a query against a client session, are in fact the original objects. You need to be careful not to modify these outside the context of a UnitOfWork/TX.
    2. The use of the merge API is typically used when the objects are detached from the session through serialization. This means that you architecture has a serialized link between the web tier and the server tier. This is more often accomplished by wrapping your server logic with a session beans. You will also need to ensure that if the web tier and server/ejb tier are in the same JVM that the app server is not passing the object by reference instead of by value.
    3. If the objects you are changing in the web-tier are not separated by a serialized link such as a session-bean then you must register the objects prior to making any changes to them.
    The code you have shown seems to assume that the web application will be in the same JVM and not have a serialized link between it and the persistence layer. Then to ensure you have a copy of the object you use one UnitOfWork to copy the objects and another to persist the changes. If you were willing to have a slightly more stateful system you could just maintain the UnitOfWork and avoid having to register or merge on the save, just call UnitOfWork.commit().
    To address your specific code without writing a complete novel I would suggest the following:
    Here is the load method:
    public static Collection returnQueryResult(String queryBarId) {
    UnitOfWork uow= getSession().acquireUnitOfWork();
    Vector facilities= null;
    try {
    // Note: reading through the UOW will register results
    Vector facilities = (Vector) uow.readAllObjects(QueryBarResult.class, new ExpressionBuilder().get("id").equal(queryBarId));
    uow.release(); // not going to need it any more
    } catch (Throwable th) {
    th.printStackTrace();
    return facilities;
    Here is the save:
    public static Object save(IdentifiableValue obj, String sessionName) {
    try {
    UnitOfWork uow= getSession(sessionName).acquireUnitOfWork();
    uow.readObject(obj); //ensure its cached and registered
    uow.deepMergeClone(obj);
    uow.commit();
    } catch (DatabaseException e) {
    e.printStackTrace();
    return getSession(sessionName).readObject(obj);
    Although this should work for all cases there will be issues if you attempt to instantiate any indirect relationships on the copies returned from the query method. These objects have been copied through a now inactive UOW. If you require lazy loading after the query I would recommend using a more stateful solution an maintaining the UOW.
    I hope this helps you get your demo going quickly. Please let me know if you run into any further complications.
    Doug

  • Help with shared objects...again...

    Okay, I've been looking at a really good tutorial for shared objects in AS2, and I think I've gotten the basic concept down of how they work... now the problem lies in just integrating it into what I already have, which is making my brain hurt.  Basically its for a quiz game, which will have a dynamic scoreboard.  I want the scores in the shared object to update when the submit button is pressed, and then have the new values loaded into text boxes.  Displaying the values is going to be the easy part, its just updating them is what my brain doesnt want to wrap itself around.  Here is the array I have at the moment (yes, horribly inefficient, but the last time I actually did any coding before this was over 2 years ago when I was still a computer science major... with all of 4 actual Comp Sci courses under my belt -_-)
    scores= new Array();
    names= new Array();
    insert=function() {
         var newscore;
         var newname;
         newscore=0
         newscore=_global.correct;
         if (newscore > scores[0]) {
             scores[14]=scores[13];
             scores[13]=scores[12];
             scores[12]=scores[11];
             scores[11]=scores[10];
             scores[10]=scores[9];
             scores[9]=scores[8];
             scores[8]=scores[7];
             scores[7]=scores[6];
             scores[6]=scores[5];
             scores[5]=scores[4];
             scores[4]=scores[3];
             scores[3]=scores[2];
             scores[2]=scores[1];
             scores[1]=scores[0];
             scores[0]=newscore;
             names[14]=names[13];
             names[13]=names[12];
             names[12]=names[11];
             names[11]=names[10];
             names[10]=names[9];
             names[9]=names[8];
             names[8]=names[7];
             names[7]=names[6];
             names[6]=names[5];
             names[5]=names[4];
             names[4]=names[3];
             names[3]=names[2];
             names[2]=names[1];
             names[1]=names[0];
             names[0]=newname;
             else if (newscore > scores[1]) {
             scores[14]=scores[13];
             scores[13]=scores[12];
             scores[12]=scores[11];
             scores[11]=scores[10];
             scores[10]=scores[9];
             scores[9]=scores[8];
             scores[8]=scores[7];
             scores[7]=scores[6];
             scores[6]=scores[5];
             scores[5]=scores[4];
             scores[4]=scores[3];
             scores[3]=scores[2];
             scores[2]=scores[1];
             scores[1]=newscore
             names[14]=names[13];
             names[13]=names[12];
             names[12]=names[11];
             names[11]=names[10];
             names[10]=names[9];
             names[9]=names[8];
             names[8]=names[7];
             names[7]=names[6];
             names[6]=names[5];
             names[5]=names[4];
             names[4]=names[3];
             names[3]=names[2];
             names[2]=names[1];
             names[1]=newname;
    Continues all the way down to scores[14]
    Now, if I wanted this to pull data from the shared object, would I just put user_so.score[3]=user_so.score[2] for instance?  Or would I run the array and just update the new valued individually once the array insertion function completes?  THe problem with the latter is that it's not directly accessing the shared object so I'd need to find a way to pull them out into other variables first, and this is about the point where my brain just decides to short out on me and stop working alltogether...yay...
    So yea, any help on this would be much appreciated.
    also, would the array have to be declared within the shared object as well?  If so, how would I do that exactly?  Probably something so simple but the fact that it's shared objects is throwing me off...

    Ok, the shared object WAS working just fine until I had the banner start referencing it.  Then the quiz began giving me syntax errors like crazy, and even when the banner isnt runnit it gives me issues.
    user_so.data.soArray[0]=scores[0];
    user_so.data.soArray[1]=scores[1];
    user_so.data.soArray[2]=scores[2];
    user_so.data.soArray[3]=scores[3];
    user_so.data.soArray[4]=scores[4];
    user_so.data.soArray[5]=scores[5];
    user_so.data.soArray[6]=scores[6];
    user_so.data.soArray[7]=scores[7];
    user_so.data.soArray[8]=scores[8];
    user_so.data.soArray[9]=scores[9];
    user_so.data.soArray[10]=scores[10];
    user_so.data.soArray[11]=scores[11];
    user_so.data.soArray[12]=scores12];
    user_so.data.soArray[13]=scores[13];
    user_so.data.soArray[14]=scores[14];
        _global.player= "Input Name";
        player.text=_global.player;
        _global.correct= 0;
        phrase=" ";
    gotoAndStop (1);
    these are the lines it's telling me I need an on handler for, which I do have, at the very start of the entire code.
    Ive counted the brackets and those seem to line up, but I'll double check again.  The code is on the submit button itself (yes I know it's poor coding form, but this is how I learned it and what I'm used to, and since I'm on a bit of a time schedule now isn't the time to completely re-learn the proper conventions and etiquite of coding in flash).
    on (release) {
        if (user_so.data.tname!=undefined){
            user_so.data.tname = _global.player;
            user_so.data.newscore = _global.correct;
            insert=function() {
        var newscore;
        var newname;
        newscore=0
        newscore=_global.correct;
        if (newscore > scores[0]) {
            scores[14]=scores[13];
            scores[13]=scores[12];
            scores[12]=scores[11];
            scores[11]=scores[10];
            scores[10]=scores[9];
            scores[9]=scores[8];
            scores[8]=scores[7];
            scores[7]=scores[6];
            scores[6]=scores[5];
            scores[5]=scores[4];
            scores[4]=scores[3];
            scores[3]=scores[2];
            scores[2]=scores[1];
            scores[1]=scores[0];
            scores[0]=newscore;
            names[14]=names[13];
            names[13]=names[12];
            names[12]=names[11];
            names[11]=names[10];
            names[10]=names[9];
            names[9]=names[8];
            names[8]=names[7];
            names[7]=names[6];
            names[6]=names[5];
            names[5]=names[4];
            names[4]=names[3];
            names[3]=names[2];
            names[2]=names[1];
            names[1]=names[0];
            names[0]=newname;
            else if (newscore > scores[1]) {
            scores[14]=scores[13];
            scores[13]=scores[12];
            scores[12]=scores[11];
            scores[11]=scores[10];
            scores[10]=scores[9];
            scores[9]=scores[8];
            scores[8]=scores[7];
            scores[7]=scores[6];
            scores[6]=scores[5];
            scores[5]=scores[4];
            scores[4]=scores[3];
            scores[3]=scores[2];
            scores[2]=scores[1];
            scores[1]=newscore
            names[14]=names[13];
            names[13]=names[12];
            names[12]=names[11];
            names[11]=names[10];
            names[10]=names[9];
            names[9]=names[8];
            names[8]=names[7];
            names[7]=names[6];
            names[6]=names[5];
            names[5]=names[4];
            names[4]=names[3];
            names[3]=names[2];
            names[2]=names[1];
            names[1]=newname;
        else if (newscore > scores[2]) {
            scores[14]=scores[13];
            scores[13]=scores[12];
            scores[12]=scores[11];
            scores[11]=scores[10];
            scores[10]=scores[9];
            scores[9]=scores[8];
            scores[8]=scores[7];
            scores[7]=scores[6];
            scores[6]=scores[5];
            scores[5]=scores[4];
            scores[4]=scores[3];
            scores[3]=scores[2];
            scores[2]=newscore;
            names[14]=names[13];
            names[13]=names[12];
            names[12]=names[11];
            names[11]=names[10];
            names[10]=names[9];
            names[9]=names[8];
            names[8]=names[7];
            names[7]=names[6];
            names[6]=names[5];
            names[5]=names[4];
            names[4]=names[3];
            names[3]=names[2];
            names[2]=newname;
            else if (newscore > scores[3]) {
            scores[14]=scores[13];
            scores[13]=scores[12];
            scores[12]=scores[11];
            scores[11]=scores[10];
            scores[10]=scores[9];
            scores[9]=scores[8];
            scores[8]=scores[7];
            scores[7]=scores[6];
            scores[6]=scores[5];
            scores[5]=scores[4];
            scores[4]=scores[3];
            scores[3]=newscore;
            names[14]=names[13];
            names[13]=names[12];
            names[12]=names[11];
            names[11]=names[10];
            names[10]=names[9];
            names[9]=names[8];
            names[8]=names[7];
            names[7]=names[6];
            names[6]=names[5];
            names[5]=names[4];
            names[4]=names[3];
            names[3]=newname;
            else if (newscore > scores[4]) {
            scores[14]=scores[13];
            scores[13]=scores[12];
            scores[12]=scores[11];
            scores[11]=scores[10];
            scores[10]=scores[9];
            scores[9]=scores[8];
            scores[8]=scores[7];
            scores[7]=scores[6];
            scores[6]=scores[5];
            scores[5]=scores[4];
            scores[4]=newscore;
            names[14]=names[13];
            names[13]=names[12];
            names[12]=names[11];
            names[11]=names[10];
            names[10]=names[9];
            names[9]=names[8];
            names[8]=names[7];
            names[7]=names[6];
            names[6]=names[5];
            names[5]=names[4];
            names[4]=newname;
            else if (newscore > scores[5]) {
            scores[14]=scores[13];
            scores[13]=scores[12];
            scores[12]=scores[11];
            scores[11]=scores[10];
            scores[10]=scores[9];
            scores[9]=scores[8];
            scores[8]=scores[7];
            scores[7]=scores[6];
            scores[6]=scores[5];
            scores[5]=newscore;
            names[14]=names[13];
            names[13]=names[12];
            names[12]=names[11];
            names[11]=names[10];
            names[10]=names[9];
            names[9]=names[8];
            names[8]=names[7];
            names[7]=names[6];
            names[6]=names[5];
            names[5]=newname;
            else if (newscore > scores[6]) {
            scores[14]=scores[13];
            scores[13]=scores[12];
            scores[12]=scores[11];
            scores[11]=scores[10];
            scores[10]=scores[9];
            scores[9]=scores[8];
            scores[8]=scores[7];
            scores[7]=scores[6];
            scores[6]=newscore;
            names[14]=names[13];
            names[13]=names[12];
            names[12]=names[11];
            names[11]=names[10];
            names[10]=names[9];
            names[9]=names[8];
            names[8]=names[7];
            names[7]=names[6];
            names[6]=newname;
                else if (newscore > scores[7]) {
            scores[14]=scores[13];
            scores[13]=scores[12];
            scores[12]=scores[11];
            scores[11]=scores[10];
            scores[10]=scores[9];
            scores[9]=scores[8];
            scores[8]=scores[7];
            scores[7]=newscore;
            names[14]=names[13];
            names[13]=names[12];
            names[12]=names[11];
            names[11]=names[10];
            names[10]=names[9];
            names[9]=names[8];
            names[8]=names[7];
            names[7]=newname;
                    else if (newscore > scores[8]) {
            scores[14]=scores[13];
            scores[13]=scores[12];
            scores[12]=scores[11];
            scores[11]=scores[10];
            scores[10]=scores[9];
            scores[9]=scores[8];
            scores[8]=newscore;
            names[14]=names[13];
            names[13]=names[12];
            names[12]=names[11];
            names[11]=names[10];
            names[10]=names[9];
            names[9]=names[8];
            names[8]=newname;
                        else if (newscore > scores[9]) {
            scores[14]=scores[13];
            scores[13]=scores[12];
            scores[12]=scores[11];
            scores[11]=scores[10];
            scores[10]=scores[9];
            scores[9]=newscore;
            names[14]=names[13];
            names[13]=names[12];
            names[12]=names[11];
            names[11]=names[10];
            names[10]=names[9];
            names[9]=newname;
                            else if (newscore > scores[10]) {
            scores[14]=scores[13];
            scores[13]=scores[12];
            scores[12]=scores[11];
            scores[11]=scores[10];
            scores[10]=newscore;
            names[14]=names[13];
            names[13]=names[12];
            names[12]=names[11];
            names[11]=names[10];
            names[10]=newname;
                                else if (newscore > scores[11]) {
            scores[14]=scores[13];
            scores[13]=scores[12];
            scores[12]=scores[11];
            scores[11]=newscore;
            names[14]=names[13];
            names[13]=names[12];
            names[12]=names[11];
            names[11]=newname;
                                    else if (newscore > scores[12]) {
            scores[14]=scores[13];
            scores[13]=scores[12];
            scores[12]=newscore;
            names[14]=names[13];
            names[13]=names[12];
            names[12]=newname;
                                    else if (newscore > scores[13]) {
            scores[14]=scores[13];
            scores[13]=newscore;
            names[14]=names[13];
            names[13]=newname;
                                        else if (newscore > scores[14]) {
            scores[14]=newscore;
            names[14]=newname;
        else {
            user_so.data.tname = _global.player;
            user_so.data.newscore = _global.correct;
            scores[0]=user_so.data.newscore;
            names[0]=user_so.data.tname;
    user_so.data.soArray[0]=scores[0];
    user_so.data.soArray[1]=scores[1];
    user_so.data.soArray[2]=scores[2];
    user_so.data.soArray[3]=scores[3];
    user_so.data.soArray[4]=scores[4];
    user_so.data.soArray[5]=scores[5];
    user_so.data.soArray[6]=scores[6];
    user_so.data.soArray[7]=scores[7];
    user_so.data.soArray[8]=scores[8];
    user_so.data.soArray[9]=scores[9];
    user_so.data.soArray[10]=scores[10];
    user_so.data.soArray[11]=scores[11];
    user_so.data.soArray[12]=scores12];
    user_so.data.soArray[13]=scores[13];
    user_so.data.soArray[14]=scores[14];
        _global.player= "Input Name";
        player.text=_global.player;
        _global.correct= 0;
        phrase=" ";
    gotoAndStop (1);

  • Help with Dynamic Objects

    Hi All,
    New to Flex and wanted to get some help from the public.
    Basically, here's what I want to do.
    I have a tab navigator with multiple tabs. Each tab has a
    datagrid on it. When you click the tab, the grid should update to
    new data based on the tab clicked. That's no problem. The problem
    I'm running into is that because the data is taking a while to
    retreive from the server, users are getting the previous's tabs
    datagrid until the information is updated. I wanted to do two
    things:
    1) Change the cursor to a "thinking" or "processing" icon
    where clicks can't be done until the full data has been retreived
    and updated. This is a nice to have; i haven't the slightlest clue
    on how to accomplish this.
    2) In lieu/addition to #1, i wanted the datagrid to be
    dynamic. Meaning, if you go to the tab, it'll add dynamically the
    datagrid to the tab and then show the data.
    Here's my code, but it doesn't work very well. Any help i can
    get from you guys would be great:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="horizontal" initialize="createDataGrid()">
    <mx:Script>
    <![CDATA[
    import mx.controls.DataGrid;
    import mx.managers.PopUpManager;
    import mx.collections.ArrayCollection;
    import mx.controls.Alert;
    import mx.rpc.events.ResultEvent;
    import mx.containers.HBox;
    import mx.containers.TabNavigator;
    [Bindable]
    private var infoDataGrid:ArrayCollection;
    [Bindable]
    private var currentID:String;
    [Bindable]
    private var dynDataGrid:DataGrid;
    private function createDataGrid():void {
    dynDataGrid = new DataGrid;
    dynDataGrid.dataProvider=infoDataGrid;
    dynDataGrid.width=80;
    private function getDataFromServer(event:ResultEvent):void {
    var numOfRecords:int = event.result.result_set.num_rows;
    if (numOfRecords > 0 ) {
    infoDataGrid = event.result.result_set.results.result as
    ArrayCollection;
    } else {
    // no information retrieved worry about this later
    private function mainBuilder( event:Event ):void {
    var tabNavigator:TabNavigator = TabNavigator( event.target
    var pattern:RegExp = /\D/gi;
    if (tabNavigator.selectedChild.id != "NewTab") {
    // Remove all non-digits from LID
    var str:String = tabNavigator.selectedChild.id;
    currentID=(str.replace(pattern, ""));
    phpHTTPService.send();
    // loop through all children and remove any datagrids while
    adding to the current one
    for (y=0; y<tabNavigator.numChildren; y++) {
    var tmpNavID:String = tabNavigator.childDescriptors[y].id
    if ((tmpNavID == tabNavigator.selectedChild.id) &&
    (tmpNavID != "")) {
    // this does not work as intended...
    tabNavigator.selectedChild.addChild(dynDataGrid);
    } else {
    // this does not work.
    //How do you access something directly with an ID but
    represented by a variable?
    // tmpNavID.removeChildAt(0);
    } else {
    // New Tab selected, do something here
    ]]>
    </mx:Script>
    <mx:HTTPService id="phpHTTPService"
    url="/flex/php/AssetsInLocation.php" useProxy="false" method="GET"
    result="getDataFromServer(event)">
    <mx:request xmlns="">
    <lid>{currentID}</lid>
    </mx:request>
    </mx:HTTPService>
    <mx:TabNavigator id="tabNav"
    creationComplete="tabNav.selectedIndex=0;mainBuilder(event)"
    width="100%" change="mainBuilder(event);">
    <mx:HBox id="LID2345" label="Tab 1" width="100%"
    height="100%" horizontalAlign="center">
    <!-- <mx:DataGrid dataProvider="{infoDataGrid}"
    width="80%"/> -->
    </mx:HBox>
    <mx:HBox id="LID1111" label="Tab 2" width="100%"
    height="100%" horizontalAlign="center">
    <!-- <mx:DataGrid dataProvider="{infoDataGrid}"
    width="80%"/> -->
    </mx:HBox>
    <mx:HBox id="LID1234" label="Tab 3" width="100%"
    height="100%" horizontalAlign="center">
    <!-- <mx:DataGrid dataProvider="{infoDataGrid}"
    width="80%"/> -->
    </mx:HBox>
    <mx:Canvas id="NewTab" label="New..." width="100%"
    height="100%">
    </mx:Canvas>
    </mx:TabNavigator>
    </mx:Application>
    Thanks all for your assistance.

    I think Ned is on the right track, but the specific form of
    the command may be off. If the ProgressEvent handler is defined on
    MC_Holder_Image, then the command to get the
    MC_Holder_Preload_TextField object should be something like:
    var oTextField:TextField =
    this.parent.parent.MC_Holder_Preload.getChildByName(childname);
    oTextField.text = "some text";
    The first "parent" references MC_Holder_Sprite, the second
    MC_Holder. If there are several instances of MC_Holder_Preload,
    then the above would have to be modified to account for that by
    first using the getChildByName method to acquire the appropriate
    instance like so:
    var oMC:MovieClip =
    this.parent.parent.getChildByName(HolderPreloadName);
    var oTextField:TextField = oMC.getChildByName(TextFieldName);
    Hope this (a) makes sense, (b) helps and (c) actually works.
    Regards
    Dave Spaar

  • Help with registering multiple XML versions with Oracle 9i

    Hello,
    I have a fundamental question. Probably someone had been in similar situation and thought of the best way to handle.
    Our product has about 15 versions that we need to support.
    Each version publishes its 'xmlschema' and is slightly different from the previous version.
    Now if I register each schema version with oracle9i it will auto-create tables for each version (even for xml elements/attributes that are same across different versions).
    2 options that we thought of so far to handle this is
    -Combine all 15 versions schema's into 1 super-set schema and register with oracle db. Fields/elements, a version does not use will be empty
    -Use XML 'extensions' in various xml schema, such that each version in 'extended' from the previous one and keeps on adding its additions attributes/elements. My question is then if I register these 15 'extended' schemas with oracle, will it create common DB tables per version or it will still create unique tables for all 15 versions.
    Anyone has any better suggestions or comments to handle this situation ?
    thanx
    -Manu

    But I'm still stuck on the problem. It still doesn't read the second object. There is no second object.
    The code is quite big, any specific portion would be helpful, please let me know?This is a minimal load and print for an XML bean:import java.io.*;
    import java.beans.*;
    import java.util.*;
    public class LoadAndPrintXMLBean {
      // run with your file name as first argument
      public static void main (String[] args) {
        try {
          XMLDecoder d = new XMLDecoder(
            new BufferedInputStream(
              new FileInputStream(args[0])));
          Object result = d.readObject();
          d.close();
          System.out.println(result);
        } catch (Exception ex) {
          ex.printStackTrace();
    }For your input, it prints[[INDEX_KEY], [7]]You have one object, a vector, containing two vectors:
      The first child vector contains the string "INDEX_KEY".
      The second child vector contains the string "7".
    This matches the structure of your XML<?xml version="1.0" encoding="UTF-8"?>
    <java version="1.4.1_01" class="java.beans.XMLDecoder">
      <object class="java.util.Vector">
        <void method="add">
          <object class="java.util.Vector">
            <void method="add">
              <string>INDEX_KEY</string>
            </void>
          </object>
        </void>
        <void method="add">
          <object class="java.util.Vector">
            <void method="add">
              <string>7</string>
            </void>
          </object>
        </void>
      </object>
    </java>There is only one object there to retrieve using readObject().
    Pete

  • Need help with Calling objects

    I have created an object named "user" and I currently have 1 Frame in my program. The first frame is called "LogonFrame" and the second is called "UserDataFrame".
    In the main method of the application I declare a "User" object as user and then call LogonFrame to retreive the logon_name and password from the user. The logon_name and password will be placed in the User object to be accessed throughout the application.
    When I compile the application I receive the following error message:
    Error: (85) variable user not found in class GL2.LogonFrame
    *I know that 85 is the line number that the error is located
    *GL2 is the name of the package.
    Has anyone ever encountered this error before, and if so how can I fix this error.
    *Listed below is the code used in the User object if it helps at all.
    Jason Franz
    // Copyright (c) 2003 Jason T. Franz
    package GL2;
    * A Class class.
    * <P>
    * @author Jason T. Franz
    public class User extends Object {
    private static int user_id;
    private static String first_name;
    private static String last_name;
    public static void User(){
    user_id = 0;
    first_name = "";
    last_name = "";
    //sets the user ID
    public static void setUserID(int newID){
    user_id = newID;
    //Returns the User ID
    public static int getUserID(){
    return user_id;
    //Sets the User First Name
    public static void setFirstName(String newFirstName){
    first_name = newFirstName;
    //Gets the Users First Name
    public static String getFirstName(){
    return first_name;
    //Sets the Users Last Name
    public static void setLastName(String newLastName){
    last_name = newLastName;
    public static String getLastName(){
    return last_name;
    //Resets all data in the User Class
    public static void reset(){
    user_id = 0;
    first_name = "";
    last_name = "";

    The code below is a small portion of the program.
    If it helps at all I am useing Oracle JDeveloper version 3.2.3 with JDK1.2.2_JDeveloper
    This section is the User object
    // Copyright (c) 2003 Jason T. Franz
    package GL2;
    * A Class class.
    * <P>
    * @author Jason T. Franz
    public class User extends Object {
      private String first_name;
      private String last_name;
      public User(){
        first_name = "Jason";
        last_name = "Franz";
      //Sets the User First Name
      public void setFirstName(String newFirstName){
        first_name = newFirstName;
      //Gets the Users First Name
      public String getFirstName(){
        return first_name;
      //Sets the Users Last Name
      public void setLastName(String newLastName){
        last_name = newLastName;
      public String getLastName(){
        return last_name;
      //Resets all data in the User Class
      public void reset(){
        first_name = "";
        last_name = "";
        logon_name = "";
        user_password = "";
    }Here is the main method.
    // Copyright (c) 2003 Jason T. Franz
    package GL2;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    * GL2.DevilsHead
    * <P>
    * @author Jason T. Franz
    public class DevilsHead {
      public User user = new User();
       * Constructor
      public DevilsHead() {
        AddUserFrame frame = new AddUserFrame();
        //Center the window
        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
        Dimension frameSize = frame.getSize();
        if (frameSize.height > screenSize.height) {
          frameSize.height = screenSize.height;
        if (frameSize.width > screenSize.width) {
          frameSize.width = screenSize.width;
        frame.setLocation((screenSize.width - frameSize.width)/2, (screenSize.height - frameSize.height)/2);
        frame.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { System.exit(0); } });
        frame.setVisible(true);
       * main
       * @param args
      public static void main(String[] args) {
        try  {
          UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
        catch (Exception e) {
          e.printStackTrace();
        new DevilsHead();
    }and here is the Frame which calls the user object to display the Information.
    // Copyright (c) 2003 Jason T. Franz
    package GL2;
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    * A Swing-based top level window class.
    * <P>
    * @author Jason T. Franz
    public class AddUserFrame extends JFrame {
      BorderLayout borderLayout1 = new BorderLayout();
      JPanel jPanel1 = new JPanel();
      Button button1 = new Button();
       * Constructs a new instance.
      public AddUserFrame() {
        super();
        try  {
          jbInit();
        catch (Exception e) {
          e.printStackTrace();
       * Initializes the state of this instance.
      private void jbInit() throws Exception {
        this.getContentPane().setLayout(borderLayout1);
        this.setSize(new Dimension(400, 300));
        button1.setLabel("button1");
        button1.addActionListener(new java.awt.event.ActionListener() {
          public void actionPerformed(ActionEvent e) {
            button1_actionPerformed(e);
        this.setTitle("Add a User");
        this.getContentPane().add(jPanel1, BorderLayout.CENTER);
        jPanel1.add(button1, null);
      void button1_actionPerformed(ActionEvent e) {
        System.out.println(user.getFirstName());
        System.out.println(user.getLastName());
    }The error I receive is
    Error: (51) variable user not found in class GL2.AddUserFrame

  • Help with creating objects for ArrayCollection

    Hi all,
    I am trying to update an ArrayCollection with Objects created
    in ActionScript
    In the end the array collection will provide data to a chart
    I can add the objects to my arrayCollection and access the
    values of the properties via text field output but the data is not
    Bindable
    So my text field shows the values from my AC but my chart
    isn't getting the data

    AaffordableWeb:
    Wrapping the Object in an ObjectProxy seems to have worked in
    that the properties are bound but my Chart shows nothing.
    I have posted the code below (keep in mind its a work in
    progress)
    Any help would be appreciated.
    //////Code
    <?xml version="1.0"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    creationComplete="handleResult(event);">
    <mx:Script>
    <![CDATA[
    import mx.collections.ArrayCollection;
    import mx.events.FlexEvent;
    import mx.rpc.events.ResultEvent;
    import mx.utils.ObjectUtil;
    import mx.utils.ObjectProxy;
    //// set price change range for the four arrays
    [Bindable]
    public var nPchange:Array = new Array(-12, -11,
    -10,-9,-8,-7,-6,-5,-4,-3,-2,-1,0);
    [Bindable]
    public var pPchange:Array = new Array(12, 11,
    10,9,8,7,6,5,4,3,2,1,0);
    //// Set up temprary var
    [Bindable]
    public var tempval:*;
    [Bindable]
    public var tempval2:*;
    [Bindable]
    public var tempvaly:*;
    [Bindable]
    public var tempvalr:*;
    [Bindable]
    public var tempvalr2:*;
    [Bindable]
    public var tempvalry:*;
    [Bindable]
    public var ylovert:Array = new Array;
    [Bindable]
    public var rylovert:Array = new Array;
    [Bindable]
    public var ymin:*;
    [Bindable]
    public var testarray:Array;
    /// declare the lPrime ac
    // declare the rprime ac
    [Bindable]
    public var rPrime:ArrayCollection = new ArrayCollection();
    // declare rylover ac
    [Bindable]
    public var ryLover:ArrayCollection = new ArrayCollection();
    // declare ylover ac
    [Bindable]
    public var yLover:ArrayCollection = new ArrayCollection();
    /// declare default cMargin
    [Bindable]
    public var cMargin:* = 80;
    [Bindable]
    public var lPrime:ArrayCollection;
    public function handleResult(event:FlexEvent):void
    pedata();
    public function pedata():*{
    /// begin loop
    lPrime = new ArrayCollection();
    for(var n:int = 0; n < nPchange.length; n++){
    var value:* = nPchange[n];
    if(value == 0){value = .0001;}else{value = value;}
    tempval = -1 * value / (cMargin + value);
    tempval2 = (tempval / value);
    ylovert.push(tempval2);
    var o:Object = new Object;
    o.PriceChange= value;
    o.PriceElasticity= tempval2;
    lPrime.addItem(new ObjectProxy(o));
    } // end loop
    lprime.xField= "PriceChange";
    lprime.yField= "PriceElasticity";
    lprime.dataProvider = lPrime;
    ///last brkt
    ]]>
    </mx:Script>
    <mx:AreaChart id="myChart" showDataTips="true"
    mouseSensitivity="25" width="100%" >
    <mx:horizontalAxis>
    <mx:LinearAxis maximumLabelPrecision="1" title="Pricec2a"
    minimum="-12" maximum="12"/>
    </mx:horizontalAxis>
    <mx:verticalAxis>
    <mx:LinearAxis displayName="Price Elasticity to Break
    Even" minimum="-1.5" maximum="-1" />
    </mx:verticalAxis>
    <mx:series>
    <mx:AreaSeries id="lprime" form="curve" >
    <mx:areaFill>
    <mx:SolidColor color="red"/>
    </mx:areaFill></mx:AreaSeries>
    </mx:series>
    </mx:AreaChart>
    <mx:Text id="txt2"
    text="{lPrime.getItemAt(3).PriceElasticity}"/>
    </mx:Application>

  • Help with View Objects

    I have created a new ViewObject in my Application Module in the project where I have my BC4J.
    Previously, I created a BC4J JSP Application project based on the other project but a this time I didn4t have created a ViewObjet that I want to use now.
    Then, I created a new JSP pages and I added the DataTags referring to that new ViewObject like this:
    <%@ page language = "java" errorPage="errorpage.jsp" import = "java.util.*, oracle.jbo.*, javax.naming.*, oracle.jdeveloper.html.*, oracle.jbo.html.databeans.*" contentType="text/html;charset=ISO-8859-1" %>
    <%
    // make sure the application is registered
    oracle.jbo.html.jsp.JSPApplicationRegistry.registerApplicationFromPropertyFile(session , "PrjSegJSP_PkgSeg_PkgSegModule");
    %>
    <HTML xmlns:jbo="jbo">
    <HEAD>
    <TITLE>INSTITUTO ECUATORIANO DE SEGURIDAD SOCIAL</TITLE>
    <LINK href="estilo/estilo.sty" rel=stylesheet type=text/css>
    </HEAD>
    <BODY class="clbody" aLink=#800000 bgColor=#ffffff leftMargin=0 link=#808000 text=#000000 topMargin=0 vLink=#c0c0c0>
    <%@ taglib uri="/webapp/DataTags.tld" prefix="jbo" %>
    <jbo:ApplicationModule configname="PkgSeg.PkgSegModule.PkgSegModuleLocal" id="PkgSegModule" username="iessuser" password="iess" />
    <jbo:DataSource id="dtsVista" appid="PkgSegModule" viewobject="ViewRolPorUsu" ></jbo:DataSource>
    <FONT class="texgen">Primero</FONT> |
    <FONT class="texgen">Anterior</FONT> |
    <FONT class="texgen">Siguiente</FONT> |
    <FONT class="texgen">Ultimo</FONT>
    <br>
    <%
    String navop = request.getParameter("NAV");
    if ( navop == null )
    navop = "First";
    if ( navop.equals("Previous") && !dtsVista.getRowSet().hasPrevious() )
    navop = "First";
    if ( navop.equals("Next") && !dtsVista.getRowSet().hasNext() )
    navop = "Last";
    %>
    <jbo:RowsetNavigate datasource="dtsVista" action="<%=navop%>" />
    <br>
    <form name="Vista" action="untitled2_Submit.jsp">
    <table border="0">
    <tr>
    <td>Nombre de Usuario</td>
    <td>
    <FONT class="texgen"><jbo:ShowValue datasource="dtsVista" dataitem="Nomuniusu" ></jbo:ShowValue></jbo:ShowValue></FONT>
    </td>
    </tr>
    <tr>
    <td>Cedula de Identidad</td>
    <td>
    <jbo:ShowValue datasource="dtsVista" dataitem="Cedideusu" ></jbo:ShowValue>
    </td>
    </tr>
    <tr>
    <td>Fecha Inicio Vigencia del Rol</td>
    <td>
    <jbo:InputText datasource="dtsVista" dataitem="fecinivigrol"/>
    </td>
    </tr>
    <tr>
    <td>Tipo de Usuario</td>
    <td>
    <jbo:InputText datasource="dtsVista" dataitem="tipusu"/>
    </td>
    </tr>
    <tr>
    <td>Descripcion del rol</td>
    <td>
    <jbo:InputText datasource="dtsVista" dataitem="desrol"/>
    </td>
    </tr>
    </table>
    <input name="MyRowKey" type="hidden" value="<jbo:ShowValue datasource="dtsRolPorUsu" dataitem="RowKey"/>" />
    </form>
    </BODY>
    </HTML>
    <jbo:ReleasePageResources releasemode="Stateless" />
    But when I run the page I found this error:
    Application Error
    Return
    Error Message: DataWebBean: Could not locate View Object: ViewRolPorUsu in application PkgSegModule
    How can I work with a View Object created recently and after I have created the BC4J JSP Application???
    Could you help me please?

    Yes, I added my new View Object to the Data Model because when I right_click on the JSP page and I want to add a new Datasource Datatag, I see the ViewObject but it gave me the error.

  • Help with Jaxb - AnyType access to sub-elements?

    Hi All,
    I am reading an XML file (defined with XML Schema) using Jaxb.
    I need one particular element to hold an arbitrary, but well formed, XML document (with any tags).
    As such I've defined this element to be of the type xs:anyType. (See payload)
    The AnyType Jaxb class however only appears to be giving me access to the text node strings (not sub-elements). (Notice its don't see <b> needs help </b>)
    I need the whole thing so I can pass it on to another parser.
    Any ideas? Is this supported in jaxb? Is this supported by XML Schema? Am I doing something wrong?
    See details below.
    Thanks!
    mike
    THE SCHEMA:
    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema elementFormDefault="qualified"
               attributeFormDefault="unqualified"
               jaxb:version="1.0"
               xmlns:xs="http://www.w3.org/2001/XMLSchema"
               xmlns:jaxb="http://java.sun.com/xml/ns/jaxb">
            <xs:element name="message" type="message"/>
            <xs:complexType name="message">
                    <xs:annotation>
                            <xs:appinfo>
                                    <jaxb:class name="XmlMessage"/>
                            </xs:appinfo>
                    </xs:annotation>
                    <xs:sequence>
                            <xs:element name="from" type="xs:string"/>
                            <xs:element name="to" type="xs:string"/>
                            <xs:element name="send-date" type="xs:date"/>
                            <xs:element name="payload" type="xs:anyType"/>
                    </xs:sequence>
            </xs:complexType>
    </xs:schema>
    THE DOCUMENT:
    <?xml version="1.0" encoding="UTF-8"?>
    <message xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:noNamespaceSchemaLocation="message.xsd">
         <from>Mike</from>
         <to>Java Community</to>
         <send-date>2006-03-23</send-date>
         <payload>Mike<b> needs help </b>parsing the AnyType</payload>
    </message>
    THE CODE:
            // get the fields
            String from = xmlMessage.getFrom();
            String to = xmlMessage.getTo();
            Calendar date = xmlMessage.getSendDate();
            AnyType payload = xmlMessage.getPayload();
            // print out the values
            System.out.println("FROM: " + from);
            System.out.println("TO: " + to);
            System.out.println("DATE: " + date.getTime());
            System.out.println("PAYLOAD: " + payload);
            // print out details regarding the payload (The AnyType list)
            System.out.println("\tAnyType list length = "
                    + payload.getContent().size());
            for (Iterator i = payload.getContent().iterator(); i.hasNext();) {
                Object o = i.next();
                System.out.println("\t" + o.getClass() + " : \"" + o + "\"");
            } THE OUTPUT:
    FROM: Mike
    TO: Java Community
    DATE: Wed Mar 22 19:00:00 EST 2006
    PAYLOAD: org.w3._2001.xmlschema.impl.AnyTypeImpl@1c99159
         AnyType list length = 2
         class java.lang.String : "Mike"
         class java.lang.String : "parsing the AnyType"

    Ok.
    source message:
    root
    - node0 (first instance)
    --- node1
    name="<b>key</b>"
    value="<b>my_key_value_1</b>"
    --- /node1
    --- node1
    name="attribute1"
    value="attribute1_value"
    --- /node1
    --- /node0
    - node0 (second instance)
    --- node1
    name="<b>key</b>"
    value="<b>my_key_value_2</b>"
    --- /node1
    --- node1
    name="attribute1"
    value="attribute1_value"
    --- /node1
    - /node0
    /root
    Desired destination message:
    root
    - node0 (first instance)
    - key_value=<b>my_key_value_1</b> <- does exist
    --- node1
    name="<b>key</b>"
    value="<b>my_key_value_1</b>"
    --- /node1
    --- node1
    name="attribute1"
    value="attribute1_value"
    --- /node1
    - /node0
    - node0 (second instance)
    - key_value=<b>my_key_value_2</b>  < should exist but does <u>not</u> exist
    --- node1
    name="<b>key</b>"
    value="<b>my_key_value_2</b>"
    --- /node1
    --- node1
    name="attribute1"
    value="attribute1_value"
    --- /node1
    - /node0
    /root

  • Help with NAS Remote Access

    Here's what I have:
    Synology DS212J
    Airport Extreme Base Station Gen 4 running latest firmware
    Running Lion
    Here's what I have done:
    Changed NAS to use Manual Configuration. IP set to: 10.0.1.14 (after reading some forums here and there I have now changed this to 10.0.1.202 (to be outside the range of DCHP address)
    In Airport Extreme I have configured Port Forwarding for port 80 and 7000 entering the private ip of the NAS 10.0.1.14 and now 10.0.1.202 and filled in the TCP ports with the appropriate port, restarted router.
    After reading more posts in the forums I checked the NAS and my Mac Firewalls. Nothing...not turned on. I have since gone back into the NAS Firewall settings after reading a post to allow access for Photostation, File station...just in case it makes a differnece
    Obtained a static IP from my ISP - ISP does not block any ports
    Canyouseeme.org always gives a Timed out message when I try and check port forwarding
    Everything works perfect on LAN...just remote I can't seem to get.  Some nice iphone apps I'd like to use remotely and use my Air to access when away from home.
    Questions:
    Is it necessary to also configure a Static IP on my Airport Extreme...I haven't as my understanding is that only the DS needs one?  If I do could some kindly step this out for me?
    I have previously changed some settings in my router for unblock-us http://support.unblock-us.com/customer/ ... 27...could this be the problem?
    Thanks to anyone that might be able to help. I can post screen shots also or could send privately! I have noted that you must be at an outside computer to test access and of course tried that as well...but understand Canyouseeme.org should still say it can see the open port when I test from my network? I also have a DDNS and everything there shows Normal.
    Hoping for something obvious and stupid on my part that someone can point out!

    so if i understand correctly this should work?
    WAN IP 208.160.90.22
    router ip address 192.168.1.1
    camera ip 192.168.1.200
    to access the camera i would type in http://208.160.90.22:1024
    thanks greatly!  i'm trying to use this camera to monitor a boiler to make sure it's operating in this cold weather we are having...

Maybe you are looking for

  • Error -1607: Unable to Install InstallShield Scripting Run Time

    i cannot open itunes tried to delete and re-install and still wont work ...what else can i do i also tried to install by cd and nothin...iv tried turning off norton and looked for spyware

  • Any search engine search crashes Firefox.

    Any search engine search instantly crashes any browser I try (Firefox, Chrome, IE). I have checked all my add-ons, used safe-mode, and reinstalled Firefox--nothing has worked.

  • Windows 8.1 issues w/ Audible audiobooks

    Hi there, I just upgraded from Win 8 to Win 8.1 and have now issues with (already authorized) audible audiobooks in my iTunes library. When I try to listen to them, I am first asked to (re) authorize them by entering my audible password, then I get t

  • Managing updates for different groups

    Hi I have installed WSUS on a Server 2008 R2 VM and have configure WSUS computer groups using group policy. These groups have all updated and I can see the computers in there containers within WSUS. Does anyone have any advice on how to manage the up

  • Connection problem with additional HD

    I use TC with my MacBook Pro plus a plugged USB2 connection powered 2,5 HD with 200 GB. Every 2nd or 3rd day when I wake the MBP from sleep, TC does not connect to the HDs and cant mount them, i.e. they are not found at all. If i unplug the attached