Storing an object within an object

insertLabel is great, but I have the need to store an object (not an InDesign object, but just a custom one) for later reference with a TextFrame. I thought about serializing the object, but javascript doesn't have a native serialize function, so before I embark down that route, is there an alternative method I could use to do this?
thanks

Here is a snippet from my Package for Archive script.
At start, the script I extracts the previously stored settings with eval() method, if the script is run for the 1st time -- creates default settings.
function GetSettings() {
    var mySettings = eval(app.extractLabel("Kas_PackageForArchive_Settings_ver3.0"));
    if (mySettings == undefined) {
        mySettings = { copyFontsCheckBox:false, copyGraphicsCheckBox:true, updateGraphicsCheckBox:true, includeHiddenLayers:true, ignorePreflightErrorsCheckBox:true, createReportCheckBox:false, createLogCheckBox:true };
    return mySettings;
Then a dialog box appears where a user selects settings and after he/she clicks OK, the settings are converted to string with toSource() and stored as string with insertLabel() method.
    if (myShowDialog== 1) {
        var myResult = {};
        myResult.copyFontsCheckBox = myCopyFontsCheckBox.value;
        myResult.copyGraphicsCheckBox = myCopyGraphicsCheckBox.value;
        myResult.updateGraphicsCheckBox = myUpdateGraphicsCheckBox.value;
        if (myInDesignVersion == 6) myResult.includeHiddenLayers = myIncludeHiddenLayersCheckBox.value;
        myResult.ignorePreflightErrorsCheckBox = myIgnorePreflightErrorsCheckBox.value;
        myResult.createReportCheckBox = myCreateReportCheckBox.value;
        myResult.createLogCheckBox = myCreateLogCheckBox.value;
        myResult.folder = myFolder;
        app.insertLabel("Kas_PackageForArchive_Settings_ver3.0", myResult.toSource());
    return myResult;
In other words, the setting are stored in a custom object which can be serialized with toSource() and then restored with eval().
Kasyan

Similar Messages

  • How to print the image data stored in object of 'java.io.File' Class in jsp

    I have created a file object for the image file in the system temporary directory.Now I want to display it in my page. please tell,How to print the image data stored in object(in my program it is imgr) of 'java.io.File' Class in jsp

    Create a servlet which gets an InputStream of the file and writes it to the OutputStream of the response and call this servlet in `src` attribute. That's basically all.
    Here's an example which covers the most of the minimum needs: [http://balusc.blogspot.com/2007/04/imageservlet.html].

  • Getting invalid packages when installing support for stored java objects

    I am getting invalid packages notices when installing support for stored java objects in Forms 9i that can with the Oracle 9iDS Suite. In the post installation notes it says to locate a few SQL files, PLB files and a JAR file and run them. On executing the SQL package that will install the rest , I am logged in as SYSTEM as the instructions stated, I get an error when it tries to load the PLB files ( which are encrypted from Oracle). Any one else have this problem or know of a solution?
    If you need more information please let me know and I will try to respond promptly.
    Thanks
    Chad Leath

    The PLB package is called ORA_DE_REFLECTION. I forgot to mention this in the previous post.

  • Invoking Oracle stored procedures from within a JDBC channel for PI 7.1

    Hi ,
    Can anybody tell me that is it possible to invoke Oracle stored Procedure from within a JDBC  sender channel for PI 7.1.
    Its working in XI3.0 and XI 7.0 for Oracle DBMS versions >= 10.2.x. But I am not sure,whether it will work for PI 7.1 also.
    Thanks & Regards,
    Saru

    HI,
    refer below link,there is no much difference in PI7.1 ,executing stored procedure is same .
    http://help.sap.com/saphelp_nwpi71/helpdata/EN/44/7b72b2fde93673e10000000a114a6b/content.htm
    Regards,
    Raj

  • Storing Action objects in some container?

    Hey all,
    I was wondering what is the best way to store Action objects that I will use to make toolbars and menus. I was thinking of using a vector, but what if it get reallocated? I would really like to know what is the accepted way of doing this.
    Thanks for any help.

    Hi,
    have a look into the source of the notepad demo coming with the SDK in path [SDK]/demo/jfc/Notepad/src/Notepad.java
    There a Hashtable 'commands' is used to store references to action objects. There are methods to store and retrieve references to action objects too.
    And to add to previous posters: IF an 'action is stored' in a Hashtable, only its reference is stored there. Consequently, if an 'action is retrieved' from that Hashtable, the stored reference to that action actually is retrieved only.
    Ulrich

  • Stored Procedure Object Result

    Hi everyone! this is my question, i'm new in this world of BPEL, i dont know so much of databases.
    I have a process with a partner Link to a Database Stored Procedure, this stored procedure should return a dataset/recordset/rowset, i dont know what kind of object it will return, it should be like a cimple query resultset! then i have an invoke activity with the input and the output variables, this output variable (the procedure result) i need to show it in a jsp page of workflow creation, i created the workflow and it create the jsp for interaction with user, i will modify the jsp to show the result of the procedure, how can i do that? what kind of object is the output varible and how can i to loop with it to show the table result?
    thnx in advance all of you!
    Best regards

    Your procedure could perhaps return a pl/sql table type.
    The DB adapter wizard will create the schema's for it.
    You can then after you have these schema's create a workflow task and use the output schema element that represents the table as a parameter for your workflow task.
    The jsp will then automatically be generated for this structure.
    HTH, Marc

  • Storing XMLType object as a Workflow Attribute - is it possible?

    Dear Experts,
    I have an XML document stored as a PL/SQL 'XMLType' object and I wish to store it in a Workflow Attribute. Is this possible and if so, under what 'Type' option shall I store it as?
    Many thanks,
    Mark

    Hi,
    You can store the payload as a CLOB inside a Workflow Event attribute type (WF_EVENT_T).
    If the XML is guaranteed to be short, you could store it in a text attribute of up to 4000 characters, but I'd be inclined to store it in the event.
    HTH,
    Matt
    WorkflowFAQ.com - the ONLY independent resource for Oracle Workflow development
    Alpha review chapters from my book "Developing With Oracle Workflow" are available via my website http://www.workflowfaq.com
    Have you read the blog at http://thoughts.workflowfaq.com ?
    WorkflowFAQ support forum: http://forum.workflowfaq.com

  • Getting selected item from combobox itemrenderer and storing in object

    Hi Guys,
    Can anyone help me in this regard. Its very urgent.
    I have a combo box itemrenderer in datagrid column. I want to get the user selected item from the dropdown of the row(s) (User may select values from combo box from multiple rows of datagrid) and corressponding values of all other columns of the rows and store it in an object . Then pass this object to database to update only those rows that user has changed.
    I am able to get the selected item from combo box using "event.currentTarget.selectedItem" and corressponding values of all other columns of the rows using "valueSelect.ID", etc where valueSelect is object which contains data for datagrid. But am stuck up with, how to store the selected item value of the combobox  and corressponding values of all other columns of the rows into an Object ?.
    Can anybody help me with sample to store selected item from combobox and its corressponding values of all other columns into an object which i can send to db...?
    Kindly help me in this regard.
    Thanks,
    Anand.

    Hi!
    Are you using a collection of VO or DTO as the dataprovider of the combobox component?
    If so, have you created some attribute there to control the user's selection in the combobox?
    For instance:
    private var selected:Boolean = false;
    If your solution fits this approach, you may create a new collection that contains just the objects that were selected by the user, it means you can loop through the datagrid's dataprovider and only insert in this new collection those objects that have the attribute "selected" set to true.
    For instance:
    private function getSelectedRecords(datagridDataProvider:ArrayCollection):ArrayCollection
        var newCollection:ArrayCollection = new ArrayCollection();
        for each (var item:Object in datagridDataProvider)
            if (item.selected)
                newCollection.addItem(item)
        return newCollection;
    Afterwards, you may serialize this new collection with your back-end.
    Hope it helps you!
    Cheers,
    @Pablo_Souza

  • Stored business object in BSP

    hi All,
    I am trying to imitate the store business document facility available in me23n against PO in our bSP application.
    I have put the file element and i can get the file and all but i am not able to store it as busines document, I need to store this document on open text server and link it with PO.
    Has anyone done something like this before ?
    thanks,
    Golu

    You can find all the function modules for the Business Document Service start with "BDS_*".
    I usually use function module BDS_BUSINESSDOCUMENT_CREA_TAB to create a document and BDS_DOCUMENT_ASSIGN to link a business document to a business object.
    Cheers
    Graham Robbo

  • XML stored as object relational fails

    We are looking at implementing a system to store Universal Business Language (UBL) 1.0 XML invoices in an XMLType column in 10g. I've registered all the requisite schemas (the UBL invoice comprises a rather complicated hierarchy of 19 individual namespaces), but when I come to create the table:
    CREATE TABLE UBLInvoices (
    invoice_id NUMBER,
    invoice_spec XMLTYPE)
    XMLTYPE invoice_spec STORE AS OBJECT RELATIONAL
    XMLSCHEMA "Invoice-1.0"
    ELEMENT "Invoice";
    I get an error message to the effect that a table with more than 1000 columns cannot be created. I can create the table using CLOB storage (STORE AS CLOB) without any problems. Is there a limit to the complexity of typed XMLType column schema? Is there any workaround?

    As A Non says, why is it unacceptable?
    It's only unacceptable to you, but it's not unacceptable XML. The standard of XML does not require a display format as the purpose of XML is to define a structure of data, not to present itself nicely to you on the screen.
    If you want to prettify your XML, that's up to you, but optimised XML data does not have formatting, which takes up additional and unnecessary storage space.

  • Storing two objects per index in a list?

    I want to make a list that I can add and remove items from. Each item would contain a PrintWriter and a String. I don't really know how I would do this.. I can store the String in an arraylist but I need the PrintWriter aswell :P. Any ideas?
    Cheers.

    tom14201 wrote:
    I need to remove them once they have been used Remove it from the list, and then use it, then (presumably) close the writer and throw the whole object away.
    and have a way of telling whether there is any to use if that makes sense.Do you mean whether there are any objects in the List? Use yourList.size()

  • Storing an object in Session, is that a good practice

    Hi,
    In application, I have a class that is very much important class, that is very much important for every backing bean class. So I am initializing at the time of login and keeping that object in the session and every time when ever the application requires it takes from the session and uses, So now my doubt is, is that a correct procedure to keep that such a valueble object in the session, in the security point of view will it makes any problem?
    actually previously I have written like, every backing bean extends this important class so after that I thought for very time it initiates the parent object for every view so I thought to reduce the heap size at runtime I kept this object in the session and when ever the application gets the requirement it gets from the session and it uses with the object
    Please any one give the valid suggestion...

    No balu sir I didn't ask, in which scope I have to keep my object.
    I am having a class, which is useful for used session wide, shared among all requests of the same user (session) throughout all subrequests/windows/tabs. so Thats why I am creating this object once per the session and keeping that object in the Httpsession, in the constructor I am passing that Object ref into the baking bean's instance variable and using through out the page.
    You can ask me why and how I am doing that!
    Actually will take an example, I have a class App class this has some methods and some instance variables, those methods are communication methods between client and server modules. So this App class provides basic behavior, passing and getting application data from server. So In the previous architecture I am extending this class for every page's backing bean class, So when I run the profile in the NetBeans the more App class objects are getting created because for every user for every page request it is creating object. thats why I thought there should only one object should serve across the user session. In my application there we can't predict, which page will be the user's first page, because we can't put a common welcome page. Thats why I am creating an object and keeping that in the Http server side session.
    I am implimented in this way,
    In every pages constructor first line, I am calling a method, that method first checks whether the HttpSession has any Object value against AppObj key if it is there it will pass to the Page's backing bean's instance variable otherwise it will create a new object and it will keep that object in the HttpSession on the key name of AppObj and then it will pass the ref to the Page's backing bean's instance .
    Actually I don't have Home Page otherwise I can create this object there in the welcome page and I can use across the usersession.
    Now My question is, If I implement in this way, will my Application gets any security problem in the future?

  • Custom Mapping: Storing embedded objects to column of Oracle Object type

    Hello,
    How hard in your opinion it would be to write custome mapping to store an
    embedded object which only have simple fields in it (no references to other
    persistent classes) to oracle object column. What superclass is the best for
    the job?
    Simplest approach I see is to define "none" mapped class for my embedded
    object and use transformation mapping to do the job
    What if I need to reference other persistent objects in my embedded one - do
    you think it will make any difference?
    Thank you for your assistance
    Alex

    overriding loadProjection() took care of this issue
    "Alex Roytman" <[email protected]> wrote in message
    news:cjslsb$uo6$[email protected]..
    Looks like transform mapping would not work - Kodo does not support object
    mappings (use stream instead) or I am missing something?
    "Alex Roytman" <[email protected]> wrote in message
    news:cjshqv$ref$[email protected]..
    Hello,
    How hard in your opinion it would be to write custome mapping to store an
    embedded object which only have simple fields in it (no references to
    other persistent classes) to oracle object column. What superclass is the
    best for the job?
    Simplest approach I see is to define "none" mapped class for my embedded
    object and use transformation mapping to do the job
    What if I need to reference other persistent objects in my embedded one -
    do you think it will make any difference?
    Thank you for your assistance
    Alex

  • Storing Java objects into a Derby db

    Hi, Im new to Apache Derby, Id like to know how store a Java Object into a db field.
    Im working with the JPCap library and the Packet class has many attributes and values, it will be easier if I could save the complete object in a just one field.
    Thanks in advantage.

    DB script:
    "Create Table APP.PACKETS (ID INTEGER not null primary key, PACKET LONG VARCHAR FOR BIT DATA)"
    Test:
    import jpcap.packet.TCPPacket;
    import java.io.ByteArrayOutputStream;
    import java.io.ObjectOutputStream;
    import java.io.ByteArrayInputStream;
    import java.io.ObjectInputStream;
    import java.io.IOException;
    private static int increment;
    public static void addPacket() {
    System.out.println("Inserting...");
    TCPPacket packet = new TCPPacket(12, 8080, 56, 78, false, false, false, false, true, true, true, true, 10, 10);
    try {
    ByteArrayOutputStream byteOutStream = new ByteArrayOutputStream();
    ObjectOutputStream objOutStream = new ObjectOutputStream(byteOutStream);
    objOutStream.writeObject(packet);
    objOutStream.flush();
    objOutStream.close();
    byteOutStream.close();
    PreparedStatement pstmt = conn.prepareStatement("Insert Into APP.PACKETS Values(?, ?)");
    pstmt.setInt(1, ++increment) ;
    pstmt.setBytes(2, byteOutStream.toByteArray());
    pstmt.execute();
    conn.commit() ;
    System.out.println("Inserted!");
    } catch(IOException e) {
    e.printStackTrace();
    } catch(SQLException e) {
    e.printStackTrace();
    public static void showPackets() {
    String query = "Select * From APP.PACKETS ";
    Statement st = null;
    ResultSet rs = null;
    int id = -1;
    byte[] data = null;
    try {
    st = conn.createStatement();
    rs = st.executeQuery(query);
    while (rs.next()) {
    id = rs.getInt("id") ;
              data = rs.getBytes("packet") ;
    ByteArrayInputStream byteInStream = new ByteArrayInputStream(data);
    ObjectInputStream objInStream = new ObjectInputStream(byteInStream);
    Object obj = objInStream.readObject();
    objInStream.close();
    byteInStream.close();
    if (obj instanceof TCPPacket) {
    TCPPacket p = (TCPPacket)obj;
    System.out.println(p.dst_port); // Print anything
    } else {
    System.out.println("No Found!");
    } catch(IOException e) {
    e.printStackTrace();
    } catch (ClassNotFoundException e) {
    e.printStackTrace();
    } catch(SQLException e) {
    e.printStackTrace();
    Thats one of several ways to insert Java Objects...

  • Storing cursor object in data base side

    I have laks of records in oracle database .how can retrieve all those records in our serverside with out getting java heap area exception.By calling stored procedure only once(stored procedure out parameter is cursor).

    sreenu1234 wrote:
    I have laks of records in oracle database .how can retrieve all those records in our serverside with out getting java heap area exception.By not doing it in the first place of course.
    Your architecture and/or design is flawed if you think that you need to retrieve so many records at one time that you run out of memory (presuming you know that you can increase the heap.)

Maybe you are looking for