How to properly create complex OCI objects (for Annotation Text)

I am upgrading a tool that will upload text objects to a table with a ST_ANNOTATION_TEXT field. The app is a C++ app and I need to instantiate a ST_ANNOTATION_TEXT (using OCIObjectNew??). I actually have 2 questions. First, does anyone have an example of how to accomplish this? I seem to be unable to correctly create the annotation text type in C++ to be able to append to (calling OCICollAppend). Second, since ST_ANNOTATION_TEXT is a complex type (contains an array of annotation text elements), do I need to call OCIObjectNew on not only the main ST_ANNOTATION_TEXT type but also for the ST_ANNOTATIONTEXTELEMENT_ARRAY, ST_ANNOT_TEXTELEMENT_ARRAY, and the ST_ANNOTATIONTEXTELEMENT?
I can't seem to find in info on this so hopefully someone else has been through this.

user3068343 wrote:
I am still having an issue where the sub objects are still NULL.Actually I was mistaken. I must have confused getting an Object from OCIObjectNew with using one of its constructor method in a statement.
http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28395/oci18nav004.htm#sthref3438 clearly state the object will have NULL attributes, unless the OCI_ATTR_OBJECT_NEWNOTNULL flag is set on the environment handle.
http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28395/oci11obj.htm#i446308 further tells you what the default value for the object members will be.
An older 9i doc http://download.oracle.com/docs/cd/B10501_01/appdev.920/a96594/adobjadv.htm#1008774 also warns about resetting the indicator struct member when you update a member of the object.
user3068343 wrote:
++a) you allocate the object's top-level struct yourself (SDO_GEOMETRY in my case) in C+++
Above you suggest creating the objects top-level struct myself. How do you create that top level object? I have been using OCIObjectNew on that object as well as its sub objects? Is that how you are creating the top-level object?This technique works only on binds, as objects you get back from defines are always allocated from the object cache. I create the top-level object directly on the stack... This is something I discovered worked, but is not documented, so you're probably on safer ground using OCIObjectNew instead.
BTW, the reason I can't easily post OCI example code is that my code uses wrappers around the objects that hides most of the OCI:
Geometry Geometry::make_point(OCIEnv* envhp, OCIError* errhp, float x, float y) {
    Geometry point_geom(envhp, errhp);
    point_geom.set_null(false);
    point_geom.gtype() = 2001;
    PointRef point = point_geom.point();
    point.set_null(false);
    point.x() = x;
    point.y() = y;
    return point_geom;
}The above creates an 2D point-type SDO_GEOMETRY hidden inside the Geometry class, itself deriving from a GeometryRef class. The latter wraps a C++ API on top of the struct pointers for a SDO_GEOMETRY/SDO_GEOMETRY_ind, while Geometry actually composes the OTT generated value/indicator structs by value, and passes addresses to its nested structs to GeometryRef (its parent class). So GeometryRef can manipulate an object irrelevant of where it was allocated, the stack or the object cache. The Geometry class is a value class, but it's useful for binds only, and like I said uses a behavior which appears to work but is not explicitly documented.
Unless you have nested objects by reference, nested objects are composed by value in the OTT-generated structs, so the space for all nested objects is already allocated after the first OCIObjectNew. But the members themselves are not initialized, and thus marked as null in the indicator struct.
In the code above, my Geometry instance is fully allocated (on the stack), but fully uninitialized (the indicator is by default set to all nulls). I first set the atomic flag to non-null, then get the Ref wrapper around its nested SDOPOINT_TYPE to also set it to non-null, and fill in the x/y member (via another NumberRef wrapper, which knows about the member and the indicator for that member, and sets it as non-null when assigned to). Notice how how I return the instance by copy: My point geometry instance doesn't have a pointer-aliasing issue here, only because its two OCIColl* are null. In the general case, you can't copy my value wrappers without making a true deep copy... But I'm getting into the weeds here.
The important point is that OCIObjectNew doesn't init the nested objects unlike what I stated earlier. Sorry for misleading you on that. --DD                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Similar Messages

  • How to properly create path art object, please help

    Hello there,
    I have a vector of AIRealPoint , each point is actual X, Y coordinate of the stroke. I need to create path art object out of this vector.
    I'm  somehow confused how to correctly construct segments array form the given AIRealPoints, my goal is to have single path object where count of segments is equal to count of AIrealPoints first and last points are anchors. SDK documenation is not really helping here...
    Please, take a look at the code snippet, it seems I'm doing something wrong with in and out params of segment , in any case I fail to create simple path object ....
    ASErr CretaeVectorPathTest2(vector<AIRealPoint>& stroke)
    AIArtHandle artHandle;
    ASErr result = kNoErr;
    try {
      AIRealPoint start;
      long lngStrokeLength = stroke.size()-1;
      AIArtHandle lineHandle = NULL;
      AIErr error = sAIArt->NewArt( kPathArt, kPlaceAboveAll, NULL, &lineHandle );
      if ( error ) throw( error );
      error = sAIPath->SetPathSegmentCount( lineHandle, lngStrokeLength );
      if ( error ) throw( error );
      AIPathSegment *segment = new AIPathSegment[lngStrokeLength];
      // This is a first point of the path
      segment[0].p.h = stroke[0].h;
      segment[0].p.v = stroke[0].v;
      segment[0].in = segment[0].out = segment[0].p;
      segment[0].corner = true;
      for(inti=1 ;i< lngStrokeLength-1;i++)
       segment[i].p.h = stroke[i].h ;
       segment[i].p.v = stroke[i].h ;
       // NOT GOOD!!!
       segment[i].in.h  = stroke[i-1].h ;
       segment[i].in.v  = stroke[i-1].v ;
       segment[i].out.h  = stroke[i+1].h;
       segment[i].out.v  = stroke[i+1].v;
       segment[i].corner = false;
    // NOT GOOD!!!
      // This is a last point of the path
      segment[lngStrokeLength].p.h = stroke[lngStrokeLength].h;
      segment[lngStrokeLength].p.v = stroke[lngStrokeLength].v;
      segment[lngStrokeLength].in = segment[lngStrokeLength].out = segment[lngStrokeLength].p;
      segment[lngStrokeLength].corner = true;
      error = sAIPath->SetPathSegments( lineHandle, 0, lngStrokeLength, segment );
      if ( error ) throw( error );
      error = sAIPath->SetPathClosed( lineHandle, false );
      if ( error ) throw( error );
    // apply color width etc.
      AIPathStyle style;
      error = sAIPathStyle->GetPathStyle( lineHandle, &style );
      if ( error ) throw( error );
      style.strokePaint = true;
      style.stroke.color.kind = kFourColor;
      style.stroke.color.c.f.cyan = 0;
      style.stroke.color.c.f.magenta = 0;
      style.stroke.color.c.f.yellow = 0;
      style.stroke.color.c.f.black = 100;
      style.stroke.width = 0.75;
      style.stroke.dash.length = 0;
      delete[] segment;
      error = sAIPathStyle->SetPathStyle( lineHandle, &style );
      if ( error ) throw( error );
    catch (ai::Error& ex) {
      result = ex;
    return result;
    Thanks,
    David

    As for beziers, Illustrator uses cubic beziers which are fairly straight forward (thank goodness!). Here's a lift from Wikipedia's Bezier entry:
    This image is pretty good at demonstrating how AI's bezier segments work. In the animation, the moving point has two lines sticking off it, ending with two points. If P3 was an AISegment, the left-hand blue point would be in and the right-hand point would be out. If we were to translate the state of the animation in its last frame into AI code, you'd basically have something like this:
    AISegment segment1, segment2;
    segment1.p = p0;
    segment1.in = p0;
    segment1.out = p1;
    segment2.in = p2;
    segment2.p = p3;
    segment.out = p3;
    Note that this would imply any line that continues beyond either end point isn't a smooth beizer curve (i.e. the curve is limited to between these points). That effectively makes them corner points (I think). Also, the line formed by linking in & p or out & p is the tangent to the curve at p, which I think you can make out from from the animation.
    Another way to get a feel for this is to use the pen tool to draw a line with a few segments. If you then pick the sub-select tool (white selection arrow, not black selection arrow) and select individual points on the curve, you'll see when you do that two 'anchors' jut out from each point. Those are the in & out for that point on the curve.
    Its all a little confusing because technically, a bezier segment between p & q would be p, p.out, q.in & q. (four vertices). To avoid repeating information, and keep it simple for non-beziers, AI's segments are still the vertices. So if you wanted to make the nth segment a beizer, you'd need n & n+1 from AI's path, and you'd modify two-thirds of each AISegment (p, out from n & in, p from n+1).
    I hope that helps, but if you have any further questions, feel free to ask! If you need to do anything fancy with beziers, there are some helpful utilites in AIRealBezier.h.

  • How can I create a Document object from a text file (myFile.txt)

    Hi everybody:
    Thank you for reading this message.
    I am trying to find a method to convert a text file ( I have it in a File object) to a Document object.
    I read the Java API but it is strange, I do not know if I have to create an AbstractDocument, it is really strange for me.
    Any comment is welcome,
    Regards,
    JB

    Document is an interface, and AbstractDocument is abstract, so you
    can't create either of those directly. Assuming you are dealing with a
    a plain text file, you could do something like
    // Not catching any exceptions that get thrown
    File file = /* file you already have */
    String eol = System.getProperty( "line.separator" );
    int eolLen = eol.length();
    FileReader reader = new FileReader( file );
    BufferedReader buffer = new BufferedReader( reader );
    PlainDocument doc = new PlainDocument();
    for ( String line = buffer.readLine() ; line != null ; line = buffer.readLine() ) {
        int len = doc.getLength();
        if ( len > 0 ) {
            doc.insertString( len, eol, null );
            len += eolLen;
        doc.insertString( len, line, null );
    }and now you have a document.
    : jay

  • How do I create a keyboard shortcut for compressing text?

    I am in a prepress situation where we build print advertisements.
    The company has just gone over to Indesign from Quark.
    I would like quick access to text compression similar to Quark's 'Ctrl ['.
    I can't find the facility to compress in 'Edit/Keyboard Shortcuts/Type'.

    - Navigate to Adobe InDesign's "Edit" menu and select "Keyboard Shortcuts." The Keyboard Shortcuts dialog box comes up on your screen.
    - Click on the "Set" pop-up at the top of the Keyboard Shortcuts dialog box. Choose "Shortcuts for QuarkXPress 4.0." Now click "OK." That's all you have to do to make Adobe InDesign behave more like QuarkXPress.
    - Attempt to use a QuarkXPress shortcut and you find your familiar hands-on environment within Adobe InDesign. This saves you time by letting you leverage the value of your experience in a new software package.
    - Return to the "Edit" menu and choose "Keyboard Shortcuts" again if you prefer the keyboard commands from QuarkXPress but always wanted to change one or more of them. Don't try to edit the shortcuts in the "QuarkXPress 4.0" set  itself. Instead, click the "New Set" button. In the window that comes up, type a distinctive name for your new shortcut set. Choose "Shortcuts for QuarkXPress 4.0" from the "Based on Set" pop-up. Now click "OK." The "Product Area" pop-up  helps you assign new shortcuts to as many menu items as you wish. (If you try to assign a shortcut that's already in use, you see the conflict listed at the bottom of the dialog box.) When you've finished your changes, click "OK" to use your  new settings.
    - Test your new shortcuts

  • How to create a new object for a particular class?

    Hi,
      Can anybody please tell  the steps for creating a new object for a particular class.
    Thanks,
    Sreeja

    Declare the object as TYPE REF TO the class and use the CREATE OBJECT statement to create an object.
    DATA <obj_name> TYPE REF TO <class_name>.
    CREATE OBJECT <obj_name>.
    Please mark points if the solution was useful.
    Regards,
    Manoj

  • I have an I phone and my own account  and just purchased an ITouch for my daughter - how do i create a seperate account for her on my computer?

    I have an I phone and my own  I tunes account  and just purchased an ITouch for my daughter - how do i create a seperate account for her on my computer? I want to make sure that my apps do not sync on her I touch.

    Go into Setttings -> Messages and make sure your Caller ID setting for Messages is set properly.

  • HT204053 how do i create an apple id for my 12 yr old?

    how do i create an apple id for my 12 yr old?

    Welcome to the community.
    Unfortunately, you cannot do that. The first hurdle that you are going to face, is that mobile devices, by virtue of being prone to loss, will always require that a password is entered before a purchase of any kind is made.
    If your concern about the password, is related to your privacy in regard to your mail, contacts and calendar information rather than their acces to make purchases, then the best solution would be for you to use another Apple ID for iCloud.
    Apple have called the whole cloud thing iCloud, there are a number of features under the iCloud umbrella, some of which require their own login. iTunes is one of these, another is what Apple have unfortunately also called iCloud too.
    You can use the same Apple ID (account) to login to both iCloud and iTunes, but you don't need to and often users will login to each service using a different ID.
    The part that you need to remember is that the services available when you log into iCloud are completely different and unrelated to those when you log in to iTunes. Your iCloud login enables mail, contacts, calendars, find my phone, Back to My Mac, Documents & Data sharing and photostream, it does not affect any of your iTunes services.

  • HT204053 How do I create an Apple ID for my kids which are linked to my Apple ID so that they can make purchases without me having to tell them my user/password?

    How do I create an Apple ID for my kids which are linked to my Apple ID so that they can make purchases without me having to tell them my user/password?

    Welcome to the community.
    Unfortunately, you cannot do that. The first hurdle that you are going to face, is that mobile devices, by virtue of being prone to loss, will always require that a password is entered before a purchase of any kind is made.
    If your concern about the password, is related to your privacy in regard to your mail, contacts and calendar information rather than their acces to make purchases, then the best solution would be for you to use another Apple ID for iCloud.
    Apple have called the whole cloud thing iCloud, there are a number of features under the iCloud umbrella, some of which require their own login. iTunes is one of these, another is what Apple have unfortunately also called iCloud too.
    You can use the same Apple ID (account) to login to both iCloud and iTunes, but you don't need to and often users will login to each service using a different ID.
    The part that you need to remember is that the services available when you log into iCloud are completely different and unrelated to those when you log in to iTunes. Your iCloud login enables mail, contacts, calendars, find my phone, Back to My Mac, Documents & Data sharing and photostream, it does not affect any of your iTunes services.

  • How do I create an 'upload facility" for my website using Muse.

    How do I create an 'upload facility" for my website using Muse.  We are a print company and is how we receive most of our work.
    Iain

    Hey Iggy,
    These might help:
    Muse
    http://tv.adobe.com/watch/introducing-business-catalyst/getting-started-with-business-cata lyst-and-muse-what-is-business-catalyst
    http://tv.adobe.com/watch/introducing-business-catalyst/getting-started-with-business-cata lyst-and-muse-creating-and-publishing-sites
    -Dave

  • How do I create an apple ID for my Kid without a Credit Card?

    How do I create an Apple ID for my Kid?

    See  >  Create an iTunes App Store account without a credit card
    Note:
    13 years old is the minimum age requirement.

  • How can I create a Forms9i Runtime for client distribution

    Currently we have an application developed in Forms 5.0.6.8.0 our Database has been upgraded to 9i DB. The application is working fine with this combination but we want to upgrade Forms in order to get Oracle Support. We just get the Developer Suite 9i package and we're trying to test our application with this software.
    How can I create the client runtime for Forms 9i?
    My application will work with Win 95 and 98?
    Thanks.

    Oracle9i Forms is web-only. Forms 6i is the last release of Forms to have client/server and character mode.
    You can test Forms from the Builder by installing iDS. To deploy Forms using iAS follow the documentation. It's all there in the deployment guide.
    iAS and Forms doco can be found on OTN.
    Regards,
    Robin Zimmermann
    Forms Product Management

  • HT204053 how can i create multiple icloud accounts for my family members

    how can i create multiple icloud accounts for my family members

    Thanks...  I appreciate the reply.  Since I wrote the previous email, I actually went and changed my apple id (the main id) and the documentation I looked at said iCloud will set mail up automatically(?)...  I had it working before. 
    Also, I tried to manually set up the ID via the Mail Accounts screen(s) and I can't figure out what my server information is...  Pop or Imap?  What's the outgoing server and the incoming server?
    I typically have never had problems setting up mail accounts (in apple mail) with no problem.
    Can anyone point me in the right direction?
    Thanks in advance!

  • How do I create a new calendar for the current year, using last years calendar's birthday's/photos and comments from the lower pages?

    Each year for the past 5 years I make a family calendar and send copies to all he family members around the globe.  I hate that I have to recreate all the birthdays and special occasions from scratch, and re-drag all the photos onto these dates, in the lower half of the page of each month on the new calendar.  How can I create a new calendar for the current year and port all of these photos/comments into the new calendar from last years calendar, to save having to redo all this work!!  I am not talking about the upper half page of the photos only...I am referring to the calendar page of each month.
    Thanks in advance. 
    Colin

    Welcome to the Apple Discussions. Open iWeb so you see your original site in the left hand pane. Use the File->New Site menu option to create a new site. Give it the name you want.
    Now select a page in your original site and type Command+D. That will duplicate the page. Drag the duplicate page down to the new site and rename it as needed. Do that for the other pages you need in the original site.
    OT

  • HT201209 How can I create an apple ID for my daughter, without adding a credit card to the account?

    How can I create an apple ID for my daughter, without adding a credit card to the account? I have tried to purchase a gift card online, but it just credits it to my account; I cannot use it to credit her new account therefore I cannot create that account.

    There are intructions on this page for how to create a new account without giving credit card details : http://support.apple.com/kb/HT2534
    e.g. log out of your account, find a free a free app in the store, click on its free 'price' :
    click on 'create Apple id' on the popup :
    Agree to the terms and fill in the details, and you should get 'none' on the payments screen.

  • HT5622 How can I create an Apple ID for my child without linking it to a credit card?

    How can I create an Apple ID for my child without linking it to a credit card?

    Hi Kappy..
    that did use to be the case but ios 8 you can create a child's Apple ID which will stay linked to the main Apple ID until they are 13 when they can if you wish take over the Apple ID themselves.
    I Have the same question regarding creating an Apple ID for my son but it insists I have to add a credit card to prove I'm an adult.
    thing is I don't have another card to add to my Apple ID I have been using the same card for all my family's Apple purchases i just update my details when I get issued a new one.
    Any ideas or suggestions greatly accepted.
    cheers

Maybe you are looking for

  • Data from Different datasources in the same table

    Hi everyone, Here I am under this complex problem. I have two different Bapi's which are being called multiple times. These bapi's have 3 common export parameters. I need to display a table with these 3 common export parameters (columns), as columns

  • Problem with set_data method in me_process_out_cust

    Hello Experts, Am implementing process_item method in me_process_out_cust BADI for this methods parameters are im_item (type if_purchase_out_item) and im_count, both are import parameters..so I cant change. My query is I have get_data and set_data me

  • Can I buy more storage space for my IPAD2

    I have a 16G IPAD2. Is it possible to buy more memory for it?

  • Using Empty Level Adjustment in CS3

    Operating System: Windows XP Professional (Service Pack 3) Software: Adobe Design Premium CS3 (10.0.1) Photoshop Lightroom 4.1 and Lightroom 2.0 - on Trial) For reasons that I cannot fully explain all my images are now opening as "Smart Objects" rath

  • Variable - Current Year

    Is there anyway the report will display current fiscal year's data considering Fiscalyear is a user entry optional variable ....the user neednot enter the input for optional variable as it is its purpose but what settings need to be made so as the re