Can I append object's attribute by Jaxb

Dear all,
I need to add various of object's attributes constantly. I mean that I need to use JAxb to app xml content then write it to xml file , and the repeat this step again and again.Can I use Jaxb to do so ? If so, how can I do that. Thanks.

Hi Joseph,
You can use the Class as like BO in the workflow.
Please check the below links to know more about Classes in the workflow.
/people/jocelyn.dart/blog/2006/06/28/getting-started-with-abap-oo-for-workflow-using-the-ifworkflow-interface
/people/jocelyn.dart/blog/2006/07/25/using-abap-oo-methods-in-workflow-tasks
http://wiki.sdn.sap.com/wiki/display/ABAP/UsingABAPOOmethodsinWorkflowTasks
Thanks,
Viji.

Similar Messages

  • Can an arbitrary object be marshalled with JAXB?

    Is it possible to marshall an arbitrary Java object with JAXB?
    I would think this is possible if
    (i) marshalling works on non-public fields
    (ii) xml can handle all Java primitive types, including byte[]
    And, it it is possible, how would you unmarshall it?
    bw

    I don't believe it is possible for JAXB to marshal and un-marshal an arbitrary object. Your object would need to implement the MarshallableObject. Usually with JAXB you wouldn't actually create the MarshallableObject yourself, you would just create it from your binding schema and DTD.

  • Check Required Elements and Attributes in JAXB

    Hi
    I need check required elements and attributes in JAXB java classes , if there are any value for them place it , otherwise place default value in xml file , because of it I upgrade JAXB2.0 to JAXB 2.1 to support "required" in "XmlElement" , I read in "JavaWS(JAXB)Tutorial.pdf" that JAXB itself check required elements and attributes , if there are any value for them place it , otherwise place default value in xml file , the exact part of document is :
    << A property is said to have a set value if that value was assigned to it during unmarshalling or by invoking its mutation method. The value of a property is
    its set value, if defined; otherwise, it is the property’s schema specified default value, if any; otherwise, it is the default initial value for the property’s base type as it would be assigned for an uninitialized field within a Java class. >>
    I want to know , dose JAXB do this task ? (now I work with JAXB2.1 but it doesnt do this task.Maybe I must set some configuration)
    and if JAXB doesnt do it , how I can check required elements and attributes in JAXB ?
    Please help me.
    Shariat

    its all on Apple's Developer site
    http://developer.apple.com/DOCUMENTATION/AppleApplications/Reference/FinalCutPro _XML/index.html

  • How can i convert object to byte array very*100 fast?

    i need to transfer a object by datagram packet in embeded system.
    i make a code fallowing sequence.
    1) convert object to byte array ( i append object attribute to byte[] sequencailly )
    2) send the byte array by datagram packet ( by JNI )
    but, it's not satisfied my requirement.
    it must be finished in 1ms.
    but, converting is spending 2ms.
    network speed is not bottleneck. ( transfer time is 0.3ms and packet size is 4096 bytes )
    Using ObjectOutputStream is very slow, so i'm using this way.
    is there antoher way? or how can i improve?
    Edited by: JongpilKim on May 17, 2009 10:48 PM
    Edited by: JongpilKim on May 17, 2009 10:51 PM
    Edited by: JongpilKim on May 17, 2009 10:53 PM

    thanks a lot for your reply.
    now, i use udp socket for communication, but, i must use hardware pci communication later.
    so, i wrap the communication logic to use jni.
    for convert a object to byte array,
    i used ObjectInputStream before, but it was so slow.
    so, i change the implementation to use byte array directly, like ByteBuffer.
    ex)
    public class ByteArrayHelper {
    private byte[] buf = new byte[1024];
    int idx = 0;
    public void putInt(int val){
    buf[idx++] = (byte)(val & 0xff);
    buf[idx++] = (byte)((val>>8) & 0xff);
    buf[idx++] = (byte)((val>>16) & 0xff);
    buf[idx++] = (byte)((val>>24) & 0xff);
    public void putDouble(double val){ .... }
    public void putFloat(float val){ ... }
    public byte[] toByteArray(){ return this.buf; }
    public class PacketData {
    priavte int a;
    private int b;
    public byte[] getByteArray(){
    ByteArrayHelper helper = new ByteArrayHelper();
    helper.putInt(a);
    helper.putInt(b);
    return helper.toByteArray();
    but, it's not enough.
    is there another way to send a object data?
    in java language, i can't access memory directly.
    in c language, if i use struct, i can send struct data to copy memory by socket and it's very fast.
    Edited by: JongpilKim on May 18, 2009 5:26 PM

  • How can I add a custom attribute to a catalog area? (CRM Isa Sales)

    Gents,
    How can I add a custom attribute to a catalog area? (CRM Isa Sales)
    Actually I would like to use the Catalog Area Type (maintained in trx COMM_PCAT_ADM on Catalog Area Header level). This field doesn't seem to be available in J2EE webshop. (The field documentation says it is for documentation purposes only so I don't expect it to be transferred).
    As this field is not readily available, I would like to add is as an attribute to the Catalog Area. BADI's PCAT_IMS_FEED_ATT and PCAT_IMS_FEED_VAL seem to indicate that it should be possible to add additional fields not only on product level, but also on Area level:
    Example implementation code:
    method IF_EX_PCAT_IMS_FEED_ATT~READ_NEW_FIELDS.
    * Example, how to add new attributes to a indexcategory
    * Possible levels are 'C'ategory and 'P'roduct.
    * Field 'VALUE' carries the attributetype ('S'tring, 'I'ntegar or
    * 'F'loat)
    * Structure 'IS_OBJECTS' carries actuall identifiers
      data: ls_fields        type comt_pcat_ims_feed_ux.
      case iv_level.
        when 'C'.                        "Category Level
    *     no new field
        when 'P'.                        "Product Level
          ls_fields-field = 'CUSTOMER_EXIT_FIELD'.
          ls_Fields-value = 'S'.
          append ls_fields to ct_fields.
    *     exproduct fields
          ls_fields-field = 'REMAN_ABL'.
          APPEND ls_fields TO ct_fields.
          ls_fields-field = 'EXCH_BUS'.
          APPEND ls_fields TO ct_fields.
      endcase.
    endmethod.
    However, when I create an implementation and add some code in the when 'C' part, the attributes do not seem to get transferred. (I've checked in the debug mode of the developer studio).
    - My example code:
    METHOD if_ex_pcat_ims_feed_att~read_new_fields.
    * Possible levels are 'C'ategory and 'P'roduct.
    * Field 'VALUE' contains the attributetype
    * ('S'tring, 'I'ntegar or * 'F'loat)
      DATA:
      ls_fields LIKE LINE OF ct_fields.
      CASE iv_level.
        WHEN 'C'.                        "Category Level
          ls_fields-value = 'S'.
          ls_fields-field = 'ZTEST'.
           APPEND ls_fields TO ct_fields.
        WHEN 'P'.                        "Product Level
      ENDCASE.
    ENDMETHOD.
    and:
    METHOD if_ex_pcat_ims_feed_val~read_new_fields.
      CASE iv_level.
        WHEN 'C'.
         ls_fields-field = 'ZTEST'.
         ls_Fields-value = 'Value 1'.
         append ls_fields to ct_fields.
        WHEN 'P'.
      ENDCASE.
    ENDMETHOD.
    In the ABAP debugger, I can see that my code is touched during initial and delta replications, however, after replication, the fields do not show up in the Java debugger.
    Any ideas?
    regards,
    Wilco Menge

    Hi,
    How can I customize the /bin/wcmcommand or how can I make use of [2] to create a custom WCMCommand?
    I think the "formUrl" is to post those input value to the jcr repository?
    var createDialog = {
            "jcr:primaryType": "cq:Dialog",
            "id": CQ.Util.createId("cq-createdialog"),
            "title":CQ.I18n.getMessage("Create Page"),
            "formUrl": CQ.shared.HTTP.externalize("/bin/wcmcommand"),
            "params": {
                "cmd":"createPage",
                "_charset_":"utf-8"
    I have added a field called "starred"
    Moreover, when I using the firebug to trace the post command, I can see that the starred value is posted also.
    :status
    browser
    _charset_
    utf-8
    cmd
    createPage
    label
    b
    parentPath
    /content/keyword_elaboration
    starred
    c
    template
    /libs/collab/commons/templates/form
    title
    a
    Source
    cmd=createPage&_charset_=utf-8&%3Astatus=browser&parentPath=%2Fcontent%2Fkeyword_elaboration&title=a&label=b&starred=c&template=%2Flibs%2Fcollab%2Fcommons%2Ftemplates%2Fform
    However, when I go to the crxde to view the node's attribute, the properity starred is not created
    Are there anything I did wrong or missing?
    Thanks.
    Message was edited by: aslkit

  • How to read appended objects from file with ObjectInputStream?

    Hi to everyone. I'm new to Java so my question may look really stupid to most of you but I couldn't fined a solution by myself... I wanted to make an application, something like address book that is storing information about different people. So I decided to make a class that will hold the information for each person (for example: nickname, name, e-mail, web address and so on), then using the ObjectOutputStream the information will be save to a file. If I want to add a new record for a new person I'll simply append it to the already existing file. So far so good but soon I discovered that I can not read the appended objects using ObjectInputStream.
    What I mean is that if I create new file and then in one session save several objects to it using ObjectOutputStream they all will be read with no problem by ObjectInputStream. But after that if in a new session I append new objects they won't be read. The ObjectInputStream will read the objects from the first session after that IOException will be generated and the reading will stop just before the appended objects from the second session.
    The following is just a simple test it's not actual code from the program I was talking about. Instead of objects containing different kind of information I'm using only strings here. To use the program use as arguments in the console "w" to create new file followed by the file name and the strings you want save to the file (as objects). Example: "+w TestFile.obj Thats Just A Test+". Then to read it use "r" (for reading), followed by the file name. Example "+r TestFile.obj+". As a result you'll see that all the strings that are saved in the file can be successfully read back. Then do the same: "+w TestFile.obj Thats Second Test+" and then read again "+r TestFile.obj+". What will happen is that the strings only from the first sessions will be read and the ones from the second session will not.
    I am sorry for making this that long but I couldn't explain it more simple. If someone can give me a solution I'll be happy to hear it! ^.^ I'll also be glad if someone propose different approach of the problem! Here is the code:
    import java.io.*;
    class Fio
         public static void main(String[] args)
              try
                   if (args[0].equals("w"))
                        FileOutputStream fos = new FileOutputStream(args[1], true);
                        ObjectOutputStream oos = new ObjectOutputStream(fos);
                        for (int i = 2; i < args.length ; i++)
                             oos.writeObject(args);
                        fos.close();
                   else if (args[0].equals("r"))
                        FileInputStream fis = new FileInputStream(args[1]);
                        ObjectInputStream ois = new ObjectInputStream(fis);
                        for (int i = 0; i < fis.available(); i++)
                             System.out.println((String)ois.readObject());
                        fis.close();
                   else
                        System.out.println("Wrong args!");
              catch (IndexOutOfBoundsException exc)
                   System.out.println("You must use \"w\" or \"r\" followed by the file name as args!");
              catch (IOException exc)
                   System.out.println("I/O exception appeard!");
              catch (ClassNotFoundException exc)
                   System.out.println("Can not find the needed class");

    How to read appended objects from file with ObjectInputStream? The short answer is you can't.
    The long answer is you can if you put some work into it. The general outline would be to create a file with a format that will allow the storage of multiple streams within it. If you use a RandomAccessFile, you can create a header containing the length. If you use streams, you'll have to use a block protocol. The reason for this is that I don't think ObjectInputStream is guaranteed to read the same number of bytes ObjectOutputStream writes to it (e.g., it could skip ending padding or such).
    Next, you'll need to create an object that can return more InputStream objects, one per stream written to the file.
    Not trivial, but that's how you'd do it.

  • Appending Objects to a File using serialization

    hi,
    I was wondering if I can append objects in a single file. For example, suppose there are 2 .java files. 1st file creates the Serialized file caleed sl.dat, opens it, writes the object, close it down.
    The 2nd file nw open that same file, sl.dat, in append mode, writes one more object and close it down.
    next I want to read each object of the file. Will it work in this fashion?
    I found a quite interesting discussion here. but it says that it is not possible.. is that true?
    Any clue? Is there any other mean to achieve this?

    arin wrote:
    kajbj wrote:
    I've done it by subclassing ObjectOutputStream. I could then add a constructor that took an argument that indicated if a header should be written or not.Can you explain what I need to done here... I have a class which extends ObjectOutputStream but what to do after that? What do u mean by header in the constructor?? Please help meYou do know that you have the source code for the class if you have a JDK? The source for ObjectOutputStream is in the src.zip.
    The normal constructor calls writeStreamHeader, and that is the problem if you are going to append data since you don't want to get the stream header more than once. Create a constructor that takes a boolean as argument, and only calls writeStreamHeader if the boolean is true.
    Kaj

  • If I know a name of class , how can I get it's attribute and methods

    If I know a name of class , how can I get it's attribute and methods as well as it's detail information by ABAP code ?
    Best regards ,

    HI, Chandra ,
    Thank you very much , I can get the result
    Best regards,
    DATA lo_class TYPE REF TO cl_oo_class.
    DATA lt_attribs TYPE seo_attributes.
    FIELD-SYMBOLS: <attrib> TYPE vseoattrib.
    TRY.
        CREATE OBJECT lo_class
          EXPORTING
            clsname = 'CLASS_NAME'.
      CATCH cx_class_not_existent .
    ENDTRY.
    lt_attribs = lo_class->get_attributes( ).
    BREAK-POINT.

  • Can I create my own attributes in iDS?

    I know to store my photo I can use the jpegPhoto attribute, but what about if I want to store other binary objects like maybe my fingerprints, can I create my own attributes for it, and how?
    Or I can't do that?

    You can use Directory Server Console to create new attributes. After adding new attributes to your schema, you must create a new object class to contain them.
    Creating object class:
    1.Click Create on the Object Classes tab.
    2.Enter a unique name for the object class in the Name text box.
    3.Enter an object identifier for the new object class in the OID (Optional) text box.
    4.Select a parent object for the object class from the Parent drop-down menu.
    5.To add an attribute that must be present in entries that use the new object class,highlight the attribute in the Available Attributes list and then click the Add
    button to the left of the Required Attributes box.
    6.To add an attribute that may be present in entries that use the new object class,highlight the attribute in the Available Attributes list and then click the Add
    button to the left of the Allowed Attributes box.
    7.To remove an attribute that you previously added, highlight the attribute in the Required Attributes list or the Allowed Attributes list and then click the
    corresponding Remove button.You cannot remove either allowed or required attributes that are inherited
    from the parent object classes.
    8.Click to OK.
    To create a new attribute:
    1. Display the Attributes tab.
    2. Click Create.
    The Create Attribute dialog box is displayed.
    3. Enter a unique name for the attribute in the Attribute Name text box.
    4. Enter an object identifier for the attribute in the Attribute OID (Optional) text box.
    5. Select a syntax that describes the data to be held by the attribute from the Syntax drop-down menu.
    6. If you want the attribute to be multi-valued,select the Multi-Valued checkbox.The Directory Server allows more than one instance of a multi-valued attribute
    per entry.
    7.Click OK
    This is repersenting binary data.
    You can represent binary data, such as a JPEG image, in LDIF using one of the following methods:
    The standard LDIF notation, the lesser than (<) symbol. For example:
    jpegphoto: < file:/path/to/photo
    If you use this standard notation, you do not need to specify the ldapmodify -b parameter. However, you must add the following line to the beginning of your LDIF file, or your LDIF update statements:
    version:1
    For example, you could use the following ldapmodify command:
    prompt% ldapmodify -D userDN -w user_passwd
    version: 1
    dn: cn=Barney Fife,ou=People,dc=siroe,dc=comchangetype: modify
    add: userCertificate
    userCertificate;binary:< file: BarneysCert
    Using base 64 encoding. You identify base 64 encoded data by using the ::
    symbol. For example:
    jpegPhoto:: encoded_data
    In addition to binary data, other values that must be base 64-encoded include:
    Any value that begins with a semicolon (;) or a space
    Any value that contains non-ASCII data, including new lines Use the ldif command-line utility with the -b parameter to convert binary data to LDIF format:
    ldif -b attribute_name
    where attribute_name is the name of the attribute to which you are supplying the binary data. The binary data is read from standard input and the results are written to standard output. Thus, you should use redirection operators to select input and output files.
    The ldif command-line utility will take any input and format it with the correct line continuation and appropriate attribute information. The ldif utility also assesses whether the input requires base 64 encoding. For example:
    ldif -b jpegPhoto < mark.jpg > out.ldif
    This example takes a binary file containing a JPEG-formatted image and converts it into LDIF format for the attribute named jpegPhoto. The output is saved to
    out.ldif.
    The -b option specifies that the ldif utility should interpret the entire input as a single binary value. If -b is not present, each line is considered to be a separate input value.

  • Append Objects to a ObjectOutput Stream

    i have opened a FileOutputStream(fis)(name,true) for appending and created a ObjectOutputStream with above fis. eventhough i am writing objects into file while reading i am only getting first object then i am getting StreamCorruptedException. why i am getting that exception and how to overcome my problem so that i can able to append object to existing file which holds objects?

    In the append mode, the file header is writted twice (it seems to be a bug...)...
    You must override the ObjectInputStream and the ObjectOutputStream to avoid the problem.
    public class MyObjectOutputStream extends ObjectOutputStream {
    public MyObjectOutputStream(OutputStream out) throws IOException {
    super(out);
    protected void writeStreamHeader() throws IOException {
    // Nothing in header
    public class MyObjectInputStream extends ObjectInputStream {
    public MyObjectInputStream(InputStream in) throws IOException, StreamCorruptedException{
    super(in);
    protected void readStreamHeader() throws IOException, StreamCorruptedException{
    // Nothing in header
    }

  • Why cant i append objects to a file

    i'm amazed that i cannot append objects to a file
    as i did earlier in c++
    it gives StreamCorrupt error

    Ashutosh.options4u wrote:
    i'm amazed that i cannot append objects to a file
    as i did earlier in c++Whatever you did in C++ didn't involve ObjectOutputStream or Java Serialization. You can append anything but objects to a file in Java. The reasons are two:
    (a) ObjectOutputStream writes a header which ObjectInputStream expects to find at the beginning of the stream and nowhere else
    (b) closing an ObjectOutputStream and starting a new one to append to the same file breaks the specified semantics for preservation of object graphs under Serialization, which can only be implemented within a single instance of ObjectOutputStream.
    it gives StreamCorrupt errorI agree.

  • How can i append the variable to filename in import statement?

    how can i append variable(substitution variable) to file name in import command for maxL?
    example : For suppose there is a file like "dataload.txt" and a variable like cur_month(august).How can i rename the file like daload_august in import statement.
    Edited by: 788996 on Aug 22, 2010 11:18 PM

    Are you saying you want to use an OS level environment variable in a MaxL statement to substitute for an entire file name? I am going to illustrate Windows, but do it your own way in *nix if you want.
    YourCallingCode.cmd
    REM Note the \\ and then the \\, you had \\ and \
    SET curmon=c:\\ABC\\datafile_21_AUG.txt 
    REM Call MaxL with a paramenter
    startMaxL.cmd DoItForTheCurrentMonth.msh %curmon%DoItForTheCurrentMonth.msh
    login blah blah for blah ;
    import database appname.dbname data from local text data_file $curmon using server rules_file "rulefile"
         on error abort ;The trick is to change whatever's in % and % and replace it with a $ in the MaxL script.
    I gave a presentation last year on MaxL at ODTUG Kaleidoscope. If you go to http://www.odtug.com, then Tech Resources, then Essbase, then search on my name, you'll find "Master Essbase with MaxL Automation". More than you could ever want to know about MaxL, variables (parameter, environment, and explicitly declared), scripting, etc., etc., are all there for the taking. If you're not already a member, you'll have to join, but an associate membership is free. You can then download my presentation and all of the others. It is a treasure chest of technical tips and knowledge.
    Yes, I am a fan a member of the Hyperion SIG, so I am ever so slightly biased. Regardless, it is good information, for free.
    Regards,
    Cameron Lackpour
    Edited by: CL on Aug 24, 2010 5:33 AM
    If you want to substitute part of the data file name, you can do that too:
    set curmon=21_AUG
    Your MaxL statement would look like:
    import database appname.dbname data from local text data_file "c:\\ABC\\datafile_$curmon.txt" using server rules_file "rulefile"
         on error abort ;

  • How can we append data in existing flat file

    how can we append data to a existing flat file (Text file).

    just fill the itab from data which suppose to append to text file.than read text file from GUI_UPLOAD and loop on itab and with the use of read statements you may append the data.

  • Dead space showing up in print preview; can't place objects in it

    hi -- Somehow, I've managed to get what I'll call a "dead space" in between my last page footer and my report footer. The design view looks completely normal: page footer A, page footer B, and report footer. None are suppressed.
    However, when I go to the print preview, what I have is: page footer A, page footer B, a dead space, and then the report footer. The dead space looks like a section, in that the far left of the preview shows lines (like section dividers) both above and below the dead space. However, when I right click on the dead space, I don't get a Section Menu; I also don't get a section name when the mouse hovers over that dead space.  I can't place objects in the dead space.
    It wouldn't be a huge deal except for the fact that the report is long enough that the dead space causes it to overflow onto a second page, which isn't acceptable.
    How can I get rid of this thing? I really don't want to recreate the report. It's quite complex.
    Thanks,
    Carol
    This is Crystal 11.

    Hi Carol,
    That's interesting.  I've never heard of this rogue spacing issue. 
    Why don't you try insertting the following in the Page Footer B Suppress formula.
    Not OnLastRecord
    Maybe that will help.
    Regards,
    Zack H.

  • Crystal Report Addon Error : ActiveX Component Can't Create Object

    Hello Experts,
    We are facing an problem when we start the Crystal Report Addon .The error message getting
    displayed is  "CR_Crypto ActiveX Component Can't Create Object".This issue is happening only on the
    server its working fine on the client. We had even unistalled and re-installed the addon in the server but
    still it throws the error when we start the addon.
    Please help us to resolve this issue
    Thanks,
    Vishwanath

    Dear Friend,
                 I had described the problem to our technical support team, and they replied as follows u2013
    They solved the Script related error by several stages.
    They checked the machine for any mal-ware existence by the tool provided by Microsoft (MS Mal-ware remover).
    Then they tried by installing the following patches from Microsoft u2013
    http://support.microsoft.com/kb/949140
    Windows Script 5.7 for Windows XP
    http://www.microsoft.com/downloads/details.aspx?familyid=887fce82-e3f5-4289-a5e3-6cbb818623aa&displaylang=en
    Windows Script 5.6 for Windows Server 2003
    http://www.microsoft.com/downloads/details.aspx?FamilyId=C717D943-7E4B-4622-86EB-95A22B832CAA&displaylang=en
    Windows Script 5.6 for Windows XP and Windows 2000
    The internal matter to this problem was about the following DLL and its version u2013
    C:\WINDOWS\system32
    vbscript.dll
    5.5.0.8820
    Desired
    5.6.0.8820
    Check, if the information helps you.

Maybe you are looking for

  • How do I manage old messages in Mail on my Mac?

    Hi, I can no longer receive Yahoo messages in Mail on my Mac. This could be because I have over 20,000 messages in my Inbox? I'm wondering if there is a way I can arrange for Mail to delete and archive all these messages so I don't have to do it manu

  • The document could not be saved. an unexpected network error occurred

    I have several users on a terminal server that access a PDF from a file server. This PDF has many fillable fields like Name: with an empty text box next to it. Sometimes when the users open this PDF everything is missing except the fillable text fiel

  • J2EE 6.20 Java Cluster - Synchronisation of EP AND J2EE Components

    Hello, <b> J2EE 6.20 Java Cluster -> Synchronisation of EP AND J2EE Components </b>  We have a productive SAP Enterprise Portal J2EE Cluster Farm with 3 Server. The version of EP is: 6.0 SP2 Patch 28. One State Controller, one Backup Controller and o

  • Blur face again...I know have read previous but can't do it...help

    ok am using fcp5.1 on g5 and am very new to fcp...used to use another program but this is different... placed the original file on v1 and a copy on v2. have hidden v1 so i don't get confused. just need to block out a small piece of video i dropped a

  • Premiere & Prelude not recognizing C300 file structure

    I'm working with some new footage in Premiere CC shot on a C300. I have the footage broken down into a folder for each card we shot. Inside each folder is an entire clean copy of the card. If I dig all the way down to each .mxf I can see them and pla