How can i add custom attributes to a new Class Object using the API ?

Hello everyone,
Here is my problem. I just created a subclass of Document using the API (not XML), by creating a ClassObjectDefinition and a ClassObject. Here is the code :
// doc is an instance of Document
ClassObject co = doc.getClassObject();
ClassObjectDefinition cod = new ClassObjectDefinition(ifsSession);
cod.setSuperclass(co);
cod.setSuperclassName(co.getName());
cod.setName("MYDocument");
ClassObject c = (ClassObject)ifsSession.createSchemaObject(cod);
Everything seems to be OK since i can see the new class when i use ifsmgr. But my question is : how can i add custom attributes to this new class ? Here is what i tried :
AttributeDefinition value = new AttributeDefinition(ifsSession);
value.setAttribute("FOO", AttributeValue.newAttributeValue("bar"));
c.addAttribute(value);
But i got the following error message :
oracle.ifs.common.IfsException: IFS-30002: Unable to create new LibraryObject
java.sql.SQLException: ORA-01400: impossible d'insirer NULL dans ("IFSSYS"."ODM_ATTRIBUTE"."DATATYPE")
oracle.ifs.server.S_LibraryObjectData oracle.ifs.beans.LibrarySession.DMNewSchemaObject(oracle.ifs.server.S_LibraryObjectDefinition)
oracle.ifs.beans.SchemaObject oracle.ifs.beans.LibrarySession.NewSchemaObject(oracle.ifs.beans.SchemaObjectDefinition)
oracle.ifs.beans.SchemaObject oracle.ifs.beans.LibrarySession.createSchemaObject(oracle.ifs.beans.SchemaObjectDefinition)
void fr.sword.ifs.GestionDocument.IFSDocument.createDocument(java.lang.String)
void fr.sword.ifs.GestionDocument.IFSDocument.main(java.lang.String[])
So, what am i doing wrong ?
More generally, are we restricted in the types of the attributes ? (for example, would it be possible to add an attribute that would be an inputStream ? Or an object that i have already created ?).
Any help would be appreciated. Thanks in advance.
Guillaume
PS : i'm using Oracle iFS 1.1.9 on NT4 SP6 and Oracle 8.1.7
null

Hi Guillaume,
you're welcome. Don't know exactly, but assume that ATTRIBUTEDATATYPE_UNKNOWN
is used to check for erronous cases only
and it shouldn't be used otherwise.
Creating your own objects could be simply done via
ClassObject ifsClassObject;
DocumentDefinition ifsDocDef = new DocumentDefinition(ifsSession);
// get class object for my very own document
ifsClassObject = ClassObject.getClassObjectFromLabel(ifsSession, "MYDOCUMENT");
// set the class for the document i'd like to create
ifsDocDef.setClassObject(ifsClassObject);
// set attributes and content for the document...
ifsDocDef.setAttribute("MYFOO_ATTRIBUTE",....);
ifsDocDef.setContent("This is the content of my document");
// create the document...
PublicObject doc = ifsSession.createPublicObject(ifsDocDef);
null

Similar Messages

  • How can i add my outlook email to my ipad without useing the Exchange Service?

    Please help me in this, How can i add my outlook email to my ipad without useing the Exchange Service?

    I'm afraid you've posted in the wrong place. This is a technical forum around a particular product called 'SharePoint'. This does talk to Exchange and Outlook in places but we don't specialised in either of those. You should have a look for one of the
    generic Outlook support forums or contact your IT department if it's a work related account.

  • How can I add an attribute to a node?

    Hi,
    How can I add an attribute to a node of a DOM Document?
    I want to add attribute Maximum="6" for all Grade node as <Grade Maximum="6">.
    Grade is a third level node in my document.
    Thanks

    Hi,
    How can I add an attribute to a node of a DOM
    Document?
    I want to add attribute Maximum="6" for all Grade node
    as <Grade Maximum="6">.
    Grade is a third level node in my document.
    ThanksGet the father of "Grade" elements as an element. Then get all elements named "Grade", and for each one set attribute "Maximum" with value "6". If you read api documentation you will know which methods to use.
    But for helping you in getting the "Grade" parent.
    1) get the root element of the Dom Doc
    2)get the father of the "Grade" father: getElementsBytagName("his name") -> it will return a Node List get the first element casting as Element if there's only one, or elese if not case
    3)the same method in 2 get the "Grade" father
    4)getElementByTagName("Grade") over the "Grade" father -> for each "grade" element on nodelist do whatever you need
    i hope u understood...

  • How can i add Custom fields into the

    Dear Experts
    We have Ecc6.0 system,
    How can i add Custom fields into the Infotype Screen(PA30),i heard that we do it by PM01 Tcode.
    But in PM01 i am unable to find the enhance infotype tab.
    How can i do it ....pls help.....
    Regards
    Sajid

    Hi,
    Do it thru the third tab : Single Screen.
    There write down the infotype number (e.g. 0022) and say generate objects.
    Regards,
    Dilek

  • How can I add a signature to a New Messages within 'Cases' in CRM?

    How can I add a signature to a New Messages within 'Cases' in CRM?

    That option is not available, only for emails.

  • I had Premier pro given me by the college I attend and do no use wi fi and do not use cloud. My laptop completely died and will be sent back to Apple for exchange. How can I reinstall Premier Pro on a new Apple computer since the old one is completly dead

    I had Premier pro given me by the college I attend and do no use wi fi and do not use cloud. My laptop completely died and will be sent back to Apple for exchange. How can I reinstall Premier Pro on a new Apple computer since the old one is completly dead and could not be unregistered?

    Hi,
    You have not specified which version of Premiere Pro was given to you. If you don't have the disc (which i suppose you don't have) you will have to download it online.
    As far as your registration is concerned, for Premiere Pro CS6 or earlier you will have to reach Adobe chat support for further help: http://helpx.adobe.com/contact.html
    For Premiere Pro CC and later, you will not have much problems reactivating it.
    Thanks,
    Rameez

  • How can I block all other mail account just to only use the exchange mailbox of our company? This is to prevent the user to setup his on company iPhone.

    How can I block all other mail account just to only use the exchange mailbox of our company? This is to prevent the user to setup his on company iPhone.

    I don't know if I'm asking this all in a way that can be understood? Thanks ED3K, however that part I do understand (in the link you provided!)
    What I need to know is "how" I can separate or rather create another Apple ID for my son-who is currently using "my Apple ID?" If there is a way to let him keep "all" his info on his phone (eg-contacts, music, app's, etc.) without doing a "reset?') Somehow I need to go into his phone's setting-create a new Apple ID and possibly a new password so he can still use our combined iCloud & Itunes account?
    Also then letting me take back my Apple ID & password, but again allowing us (my son and I) to use the same iCloud & Itunes account? Does that make more sense??? I'm sincerely trying to get this cleared up once and for all----just need guidance from someone who has a true understanding of the whole Apple iCloud/Itunes system!
    Thanks again for "anyone" that can help me!!!

  • How can i have a refrence of a java class object instance in my c++ project

    Hi!
    How can i have a refrence of a java class object instance in my c++ project. Is there a way?

    hahaxia wrote:
    The second question is the big one. The first question is half of the problem of "c++ to java" invocation and access. But the other half which is "java to c++ " invocation and access is still not solved. jni only provide the "java to c++ " DLL invocation Wrong,
    Using JNI your java classes can have methods implemented in C/C++.
    Using JNI you can call java classes.
    There is no other possible interaction between C++ and java, so it does it all.

  • How To Directly Add Attachments to E-Business Suite Entities Without Using The Managed Attachments Window

    How To Directly Add Attachments to E-Business Suite Entities Without Using The Managed Attachments Window? any option?

    user11016624 wrote:
    How To Directly Add Attachments to E-Business Suite Entities Without Using The Managed Attachments Window? any option?
    Please see:
    http://www.oraclebusinessapps.com/2008/04/28/load-pdf-file-attachment-using-api/
    http://www.oracleerpappsguide.com/2011/04/attachment-in-oracle-application.html
    http://etrm.oracle.com/pls/et1211d9/etrm_pnav.show_object?c_name=FND_ATTACHED_DOCUMENTS_PKG&c_owner=APPS&c_type=PACKAGE
    Thanks,
    Hussein

  • HT4059 Have several books that were purchased recently, when all the sudden they have multiplied having 20 or more copies in my library   How can I delete them because it won't let me use the edit tab?

    Have several books that were recently purchased. This week these books have multiplied into at least 20 or more copies within my library. How can I delete them because it will not let me use the edit tab?

    Do they have the cloud icon on them ? When I had Settings > iBooks > Show All Purchases 'on' I was getting multiple copies of books that were only in the cloud showing on the bookshelf in the app - turning that setting 'off' stopped them showing (you can see what books are available for redownloading, and redownload them, via the Purchased tab in the ibookstore in the app)

  • How can a webpage refresh automatically if some new data has entered the da

    hi,
    How can a webpage refresh automatically if some new data has entered the database.
    with thanks
    jp reddy

    There have been several discussions on related topics. HTTP/HTML is not a "push" protocol and therefore is not well suited for this type of application. I would recommend setting a reasonable refresh rate using a META tag or switching to another technology (i.e. Applets) that can provide a push environment.

  • How can i add custom document properties in Content Services?

    Hello guys.
    I have question. I need to add custom attributes of document uploaded in CS.
    I know about categories, and it will help me.
    But i need it on the properties page? in main tab, where docname, creationdate, etc. appears. Is it possible?
    Ideally it should appears in main window of CS, without any additional clicks.
    Is there any way organize it without development new Web Services?
    Thank you.

    One possible way of doing this would be to use the $A mapping in the send_access mapping table. see http://docs.iplanet.com/docs/manuals/messaging/ims52/ag/filter.htm#15965
    This will depend on what value you wish to use in the header and when and where during the message routing you want to add the header.
    You can use channel level filters on the send_access or orig_send_access mapping table to control at which point the header is added but without knowing more about what you wish to do and which conditions you wish to use to add the header it is difficult to say more. It is possible to use a "customer supplied routine (in the form of a shared object call) from the mapping process, but during the mapping process the only information available to the routine is the sender and recipient info so that probably isnt suitable for your purposes.
    Another method of header manipulation in IMS is channel header option files but these should be used with caution and will only operate on "known" headers and as a result are probably not of too much use to you either.
    The conversion channel does have access to the original message headers http://docs.iplanet.com/docs/manuals/messaging/ims52/rm/mta_conf.htm#1044412
    but Im afraid I cant point you at an example of where it has been used like this - perhaps someone else can.
    WRT moving the message to the top of the message list - I presume this is from the clients perspective - How did you accomplish this in NMS as message views and sorting are almost exclusively a client responsibility ?
    Also have you looked at the ENS service available with IMS?
    Sorry I cant offer anything more than that but without knowing what functions your previous SMTP plugin performed its a bit difficult.
    Ciaran

  • How can I add customer's information?

    I can add user to the wlcs_user table with jsp now .
    <um:createuser.............>
    But
    1. How can I add user to customer with jsp?
    2. How can I add user's information eg:cardid,e_mail,address etc) with jsp?
    which table these information will put into ?
    Thank in advance.

    I can add user to the wlcs_user table with jsp now .
    <um:createuser.............>
    But
    1. How can I add user to customer with jsp?For WLCS 2.0.1, look at the example code that came with the MyBuyBeans demo in
    <wlcs-install-dir>/src/examples/buybeans/client
    In particular, look at UserInformation, which is used to collect information
    for your Customer and look at RegistrationHelper, which has a
    register(userInformation) method that is used to create a new Customer.
    For WLCS 3.1 the Customer extends User, so that the Unified User Profile (see
    the documentation) can be used to easily integrate customers with WLPS users.
    2. How can I add user's information eg:cardid,e_mail,address etc) with jsp?
    which table these information will put into ?Look at _userreg.jsp.  These are properties that have not been registered with
    the "exampleportal" property set using the administration tool, so you cannot
    set them with the administration tool. You must use JSP tags or the API to set
    them.
    Ture Hoefner
    BEA Systems, Inc.
    2590 Pearl St.
    Suite 110
    Boulder, CO 80302
    www.bea.com

  • HT3255 my MacBook Air and iPhone 5 has been stollen, how can i block them. They were new. Never used.

    My MacBook Air and I phone 5 has been stolen, how can I block them. They were new and unused.

    If they were "unused", then it is very unlikely that "Find My Mac" or "Find My iPhone" is set up in order to locate, erase and/or remotely disable the systems.
    All you are really left with is ordinary law enforcement in order that you report the incident and hope that they surface in that manner.

  • How can I enable Facetime for two different iTouch (4 gen) using the same Apple ID?

    I would like to have each of them have their own distinct email address so I can Facetime them seperately, is this possible? I have two new iTouches for each of my kids, and I want to use one Apple ID so we can all share the same music. they have their own email accounts, but I would like to know if I can assign each of the iTouch with a different email address so I can facetime my kids using their distinct email address. Right now, they are sharing the email address assigned to our Apple ID, so they are ringing at the same time. Thanks!! CL

    It is possible to use one Apple ID with Face Time and Messages by adding email addresses and setting the "you can be reached at" and "Start a new conversation from" in the settings for each device. This method does not work well though.
    Your best option is to set each kid up with there own iCloud/Apple iTunes Store account (Apple ID) using their own email address. Then on each device set the iCloud Settings on each device to their specific Apple ID. Set the iTunes & Apps Store settings to use the main Apple ID for store purchases. With this setup each user will have their own distinct iCloud account which will not interferer with the others yet still make purchases from the main one.

Maybe you are looking for

  • Iphone will not send sms, but there is no error message

    Hi! I sent a sms to a friend of mine two days ago, but I got no response. I contacted NetCom, but the message had not gone out to their net. It had never "left" the phone. There is no error message on the phone. Does anyone know what I need to do to

  • Print Button in Web Dynpro ABAP

    Hi Everybody, i hope that someone know or have a code sample how i can set a print button to the Web Dynpro for ABAP. On click on this it should open the print window from the Internet Explorer. Please let me know if there is any information about th

  • I need Document to define how the KPIs in BI Apps working

    For Example what is the calculation for Any KPIs ? To understand how it's work. I know how can i make a KPs, but i need to know how oracle build the KPIs in BI Apps. Thank you.

  • Width problems.

    Hi! :) I create a Home page, in this home page I create two pages(html) with template(reports region 100% width) and display point(page template body(3.items above region content)) "column=1" on the first Page, "column=2" on the second one. When i ru

  • Why does Skype make your credit inactive?

    I was just curious on if anyone knew why Skype would de-activate your credit after 180 days.  That irks me quite a bit seeing how I paid for those credits.  If I just wanted to throw money money away I could do it faster if I walked over to at trashc