Custom attributes on adf components?

I asked this question before:
howto modify components in tree?
and got no answer. So I'm trying a different approach. I'm using aop to intercept methods as such:
<include within="oracle.adfinternal.view.faces.renderkit.rich..*"/>
@Pointcut("execution(void encode*(..))")
This is the only way I've been able to get at adf components after the are all created, but before they are rendered. I verify the authorization level of the component based in the id of the component and the current user's roles.
in my jsf:
<af:image id="highly_secretive_data_chart" source="#{DataChart.src}" inlineStyle="padding-right: 2px"/>
in my aspect:
String id = component.getId();
AuthorityLevel level = getAuthorityLevel(id, getUser().getId());
if (AuthorityLevel.NONE.equals(level)) {
component.setRendered(false);
} else if (AuthorityLevel.ACTION.equals(level)) {
//do nothing
String className = component.getClass().getName();
types.add(className);
try {
Method m = component.getClass().getMethod("setDisabled", new Class[] {Boolean.TYPE});
if (AuthorityLevel.VIEW.equals(level)) {
m.invoke(component, true);
} catch (Exception e) {
//do nothing
btw - is there a way to format code in this forum?
This works fine and allows me to do what I want until I get to a case like this (where the component is created in a loop):
<f:facet name="treeNav">
<af:tree id="navtree"
binding="#{EventMaster.eventTree.treeControl}"
value="#{EventMaster.eventTree.listModel}"
var="node">
<f:facet name="nodeStamp">
<af:group>
<af:commandLink partialSubmit="true" id="#{node.id}" dyn_id="#{node.id}">
I put both failed attempts above (id and dyn_id), but obviously I tried them separately.
As documented here:
http://www.oracle.com/technology/products/adf/adffaces/11/doc/adf-richclient-api/tagdoc/af_commandLink.html
I cannot put el inside of the id attribute.
So, I thought I'd be cute and make my own attribute (dyn_id), but I that results in this exception:
org.apache.jasper.JasperException: ... Attribute dyn_id invalid for tag commandLink according to TLD
Does anyone know how to turn off this validation? Or have any other solutions? After typing this up, I realize this might be a tomcat thing. Perhaps there's hope then.
Thanks much,
Ben Anderson

Looks like I can use customizationId. The documentation states "This attribute is deprecated. The 'id' attribute should be used when applying persistent customizations. This attribute will be removed in the next release." I'm gonna call their bluff. But I'd still be up for an alternative if anyone's got one.

Similar Messages

  • Profile customized attribute is not working?

    Hi,
    I downloaded ‘WCSpacesExtensions’ project from Oracle because I want to add some customize attributes to Profile. I added ‘project’ to ExtendedProfileAttributes.java, and created getter and setter methods. In a jsff, this is my EL #{wcProfileCustomAttribute['securityContext.userName'].project}. The setProject() sets up the attribute, but when getProject() is invoked, ‘project’ is returned as NULL.
    Every time the jsff page references the attributes via EL, it creates a new instance ExtendedProfileAttributes obj. because you can see it calls the constructor over and over. It saves value of ‘sip’ (=> setSip():12345), but when trying to read its value, it's NULL (=> getSip():null). So, I can't read and save the attribute per user.
    Any feedback is greatly appreciated.
    .jsff page
    <mds:insert after="oliplam3" parent="olipfl1"
    xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
    <af:panelLabelAndMessage xmlns:af="http://xmlns.oracle.com/adf/faces/rich"
    label="*Sip" id="splam2">
    <af:inputText xmlns:af="http://xmlns.oracle.com/adf/faces/rich" id="sit1"
    value="#{wcProfileCustomAttribute[(pageFlowScope.userId == null ? securityContext.userName : pageFlowScope.userId)].sip}"/>
    </af:panelLabelAndMessage>
    </mds:insert>
    <mds:insert after="splam2" xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
    <af:panelLabelAndMessage xmlns:af="http://xmlns.oracle.com/adf/faces/rich"
    label="*Proj" id="splam3">
    <af:inputText xmlns:af="http://xmlns.oracle.com/adf/faces/rich" id="sit2"
    value="#{wcProfileCustomAttribute[(pageFlowScope.userId == null ? securityContext.userName : pageFlowScope.userId)].project}"/>
    </af:panelLabelAndMessage>
    </mds:insert>
    ExtendedProfileAttributes.java
    package custom.webcenter.spaces;
    import oracle.adf.share.logging.ADFLogger;
    * This is a sample class for profile extension
    * Add getter (and setter if you need to save)
    * for any new custom attribute.
    * New attriutes defined here can be acessed
    * via EL like
    * #{wcProfileCustomAttribute['smith'].sip}
    * in the jspx/jsff.
    public class ExtendedProfileAttributes
    private String sip;
    private String project;
    public ExtendedProfileAttributes(String profileID)
    // Query from custom attribute source and cache them
    //project = profileID + "'s Project";
    //mSIP = profileID + "'s SIP address!!!***";
    //mStreetAddress = profileID + "'s street address";
    System.out.println("ExtendedProfileAttributes(). user:" + profileID);
    System.out.println("ExtendedProfileAttributes(). sip:" + sip + " project:" + project);
    public void setSip(String s) {
    this.sip = s;
    System.out.println("=> setSip():" + this.sip);
    public String getSip() {
    System.out.println("=> getSip():" + this.sip);
    return this.sip;
    private static String CLASS_NAME = ExtendedProfileAttributes.class.getName();
    public void setProject(String project) {
    this.project = project;
    System.out.println("=> setProject():" + this.project);
    public String getProject() {
    System.out.println("=> getProject():" + this.project);
    return project;
    DEBUGGING:
    ===========
    ExtendedProfileAttributes(). user:securityContext.userName
    ExtendedProfileAttributes(). sip:null project:null
    => setSip():12345
    ExtendedProfileAttributes(). user:weblogic
    ExtendedProfileAttributes(). sip:null project:null
    => setProject():333
    <Feb 24, 2012 11:24:57 AM EST> <Warning> <oracle.adfinternal.view.faces.renderkit.rich.RegionRenderer> <ADF_FACES-60099> <The region component with id: T:wcCmdLinkGSSwit:spaceSwitcherComp:crtGS has detected a page fragment with multiple root components. Fragments with more than one root component may not display correctly in a region and may have a negative impact on performance. It is recommended that you restructure the page fragment to have a single root component.>
    <Feb 24, 2012 11:24:57 AM EST> <Warning> <oracle.adfinternal.view.faces.renderkit.rich.RegionRenderer> <ADF_FACES-60099> <The region component with id: T:spcNavPanel:dc_r3 has detected a page fragment with multiple root components. Fragments with more than one root component may not display correctly in a region and may have a negative impact on performance. It is recommended that you restructure the page fragment to have a single root component.>
    ExtendedProfileAttributes(). user:weblogic
    ExtendedProfileAttributes(). sip:null project:null
    ExtendedProfileAttributes(). user:weblogic
    ExtendedProfileAttributes(). sip:null project:null
    ExtendedProfileAttributes(). user:weblogic
    ExtendedProfileAttributes(). sip:null project:null
    => getSip():null
    Thanks a lot.

    Hi,
    if this is a WebCenter specific issue, they do have their own forum on OTN: WebCenter Portal
    Frank

  • Integrate javascript event into Oracle ADF Components

    Can someone show me how to use javascript attribute, for instance onclick, in CoreCommandButton? How do we normally integrate javascript event into Oracle ADF Components?

    Hi,
    you already have a link. Its not an Oracle project but a project of Wilfred from Eurotransplant. Feel free to ping him directly on this or ask this question on the Forms forum, if you haven't already, where he most likely is signed up for.
    Frank

  • OIM 11gR2 - custom attribute with illegal binding on Create User form in published sandbox

    Hi,
    I think I have managed to paint myself into a corner!
    In OIM 11gR2 I have added a number of custom attributes to the "User Form" - some Text-, some Lookup-type attributes.
    While customizing the "Create User" page within a sandbox and adding a SelectOneChoice item and fiddling around with its binding, I was distracted by a phone call and the browser timed out.
    The binding property on the new item is now not correct and the sandbox has unfortunately been published, and I am now unable to enter the "Create User" page - when I try, I get the following:
    <Sep 23, 2013 2:39:11 PM CEST> <Warning> <oracle.adf.view.rich.component.fragment.UIXRegion> <ADF_FACES-00009> <Error processing viewId: /user/createView URI: /oracle/iam/ui/runtime/form/view/pages/userCreateForm.jsff actual-URI: /oracle/iam/ui/runtime/form/view/pages/userCreateForm.jsff.
    javax.el.PropertyNotFoundException: Target Unreachable, 'ekstraresource1__c' returned null
            at com.sun.el.parser.AstValue.getTarget(AstValue.java:108)
            at com.sun.el.parser.AstValue.isReadOnly(AstValue.java:149)
            at com.sun.el.ValueExpressionImpl.isReadOnly(ValueExpressionImpl.java:248)
            at oracle.adfinternal.view.faces.renderkit.rich.EditableValueRenderer._getUncachedReadOnly(EditableValueRenderer.java:486)
            at oracle.adfinternal.view.faces.renderkit.rich.EditableValueRenderer.cacheReadOnly(EditableValueRenderer.java:416)
            at oracle.adfinternal.view.faces.renderkit.rich.LabeledInputRenderer.beforeEncode(LabeledInputRenderer.java:128)
            at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:340)
    <Sep 23, 2013 2:39:11 PM CEST> <Warning> <oracle.adf.view.rich.component.fragment.UIXRegion> <ADF_FACES-00009> <Error processing viewId: /catalog-tf/cart-details URI: /oracle/iam/ui/catalog/pages/cart-details.jsff actual-URI: /oracle/iam/ui/catalog/pages/cart-details.jsff.
    javax.el.PropertyNotFoundException: Target Unreachable, 'ekstraresource1__c' returned null
            at com.sun.el.parser.AstValue.getTarget(AstValue.java:108)
            at com.sun.el.parser.AstValue.isReadOnly(AstValue.java:149)
            at com.sun.el.ValueExpressionImpl.isReadOnly(ValueExpressionImpl.java:248)
            at oracle.adfinternal.view.faces.renderkit.rich.EditableValueRenderer._getUncachedReadOnly(EditableValueRenderer.java:486)
            at oracle.adfinternal.view.faces.renderkit.rich.EditableValueRenderer.cacheReadOnly(EditableValueRenderer.java:416)
            at oracle.adfinternal.view.faces.renderkit.rich.LabeledInputRenderer.beforeEncode(LabeledInputRenderer.java:128)
            at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:340)
    Caused By: java.io.IOException: javax.el.PropertyNotFoundException: Target Unreachable, 'ekstraresource1__c' returned null
            at oracle.adfinternal.view.page.editor.renderkit.PageCustomizableRenderer.encodeAll(PageCustomizableRenderer.java:764)
            at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1396)
            at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:341)
            at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:767)
            at javax.faces.component.UIComponent.encodeAll(UIComponent.java:937)
            at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:405)
    etc.
    Of course the sandbox should not have been published - but it is - and I am stuck trying to figure out how to somehow undo this mess.
    Is it possible to clean up this mess by diving to the database and removing some rows from the right tables - or perform some other operations undo my mistake?
    Thanks in advance,
    - Tom

    oim version is oim 11gR2 with BP4

  • Dynamic select list as APEX plug-in custom attribute?

    I'm developing a region plug-in in APEX 4.0.1. I wanted to make one of the custom attributes a select list where the options offered were the current application list templates (queried from the <tt>apex_application_temp_list</tt> view: the rendered plug-in region should be styled using a standard list template from the current theme). However, the Select List plug-in custom attribute type only appears to support static lists. Can anyone confirm that I've not missed anything and that this is indeed the case?
    If so, it seems that the plug-in will have to rely on developers typing a list template name into a text box, which is far from ideal. (Unless anyone can suggest a workaround?)
    Component specific templates can be applied to several built-in component types&mdash;lists, calendars, reports&mdash;so it would make sense for there to be a similar capability for plug-ins where these are congruent with an existing template type, e.g. by providing a Template Picker plug-in custom attribute type.

    Hi,
    you have not missed anything. Plug-in attributes of type "Select List" just support static values. And I'm not sure if a query based Select List would really help, because what happens if the template is deleted. Or in the reports where it shows if the template is in use.
    So I think your second approach to extend plug-in attributes to link to certain shared components (Lists, Templates) is the better way forward, because that will also allow us to know what you are actually referencing and we can use that information in reports, delete operations, ...
    Will add it to possible enhancements for 4.1
    Regards
    Patrick
    My Blog: http://www.inside-oracle-apex.com
    APEX 4.0 Plug-Ins: http://apex.oracle.com/plugins
    Twitter: http://www.twitter.com/patrickwolf

  • Customize adf components in deployed ADF web applications

    Hi,
    I am using JDeveloper 11.1.1.4 and ADF-BC in my project.
    In my project,I use several jsff pages with some common adf components inside them.[ex:af:panel,af:inputText ,etc].
    For example I use a panel and some adf input and button components inside panel.
    I build a ear/war and ship it to customer.
    My question is in customer environment,if the customer wants to customize the controls in the jsff page [like  adding new adf controls to the existing panel etc],can we achieve this in adf web applications.
    Please suggest.
    Thanks,
    Praveen

    hi,
    My question is in customer environment,if the customer wants to customize the controls in the jsff page [like adding new adf controls to the existing panel etc],can we achieve this in adf web applications.You cannot edit the ear file directly to embed the controls in page,
    So you can have a database table that stores the dynamic configuration of controls, like cntrl_name,type,value,autosubmit,, etc.
    and at runtime render it accordingly dynamically.
    forexample you can have a af:iterator that iterates over vo(table) and has switcher component to determine the type of component and apply properties to it.
    Regards,

  • Custome Tags in ADF

    Any body can help in in working with custom tags in ADF?

    Hi,
    <af:panelPartialRoot>
    is not needed because both components already support partial page refresh
    action="indexPage"
    is not a valid property for af:poll
    pollListener="#{poller.processPollEvent}"/>
    pollListener handles the poll event, but what are you trying to do in the polling code ?
    see: http://www.oracle.com/technology/products/jdev/htdocs/partners/addins/exchange/jsf/doc/tagdoc/core/poll.html
    http://www.oracle.com/technology/products/jdev/htdocs/partners/addins/exchange/jsf/doc/tagdoc/core/progressIndicator.html
    Frank

  • Issue with Sorting by Custom Attributes

    In our custom SES query application, I am trying to implement sorting at the custom attribute level. I am having difficulty in understanding exactly how to set the options on doOracleOrganizedSearch() to achieve the desired result.
    We have a table based content source and allow a user to search via custom search attribute. We are also going to allow them to sort by custom attribute.
    For example, say we have a Project content source and one of the attributes is "Client Name". Users are going to be able to sort by client name (A-Z and Z-A). I have a prototype working but it only seems to work if I set topN to a very high number.
    I want to bring back the first 10 documents sorted by Client Name A - Z and allowing paging to the next set of sorted results. My prototype works if I set topN to 1000 (more than the # of results) but does not work if I set it to 10 (# of results I want to display per page).
    Below if my code. Note I am not setting the group attribute or the cluster list. Perhaps this is the issue?
    Many thanks in advance!
    OracleResultContainer results = service.doOracleOrganizedSearch
    (this.m_query, // query
    this.m_docsRequested, // topN
    this.m_startIndex, // startIndex
    new Integer(10), // docsRequested
    this.m_dupRemoved, // dupRemoved
    this.m_dupMarked, // dupMarked
    this.m_searchDataGroup, // groups
    this.m_queryLang, // queryLang
    this.m_docLang, // docLang
    this.m_returnCount, // returnCount
    this.m_filterConnector, // filterConnector
    filters, // filters
    this.m_fetchAttributeNames, // fetchAttributeNames
    null, // searchControls
    null, // groupAttr
    this.m_sortAttributes, // sortAttrList
    null); // clusterList

    Hi Nikola,
    in 9.0.1 even if you rewrite the web interface you can't sort files by custom attributes setting a SortSpecification to a Folder. You can only sort by base attributes with getItems(). To get item sorted on custom attributes you must perform a search (a lot more codelines).
    Regards, Alessandro

  • Limitation on number of custom attributes visible

    Hi,
    I am using OIM 11g.
    All the custom attributes are visible on the create user form. I am able to see only 8 custom attributes on the modify user form.
    The visible property of all the attributes is set to true. I cannot modify the attribute once its created at the user creation.
    Can someone please help me out?
    Thanks...

    I got it resolved.
    Permissions in the access policies were not enabled for the remaining attributes.

  • Limitation on number of adf components on a jsp page?

    I am currently working on a page which comprises a number of af:table components with underlying af:column components for each table. The page also contains other adf components. My question is as stated above, is there a limitation on the number of adf components that are allowed on a page and if so what this is?
    I have found that page errors I have been having can be resolved by reducing the number of components. For example, by removing af:objectspacer components I am able to include af:column components which previously caused the page to fail.
    Any info would be appreciated.
    Thanks.

    Which version are you on?
    We faced similar problem in 10g. After jspx exceeds a certain size the project doesn't compile.
    This is due to java class file code_length restriction, it cannot be greater than 64K.
    Check this thread for detailed explanation and workaround {thread:id=361086}
    We had worked around the issue by breaking the big page into serveral pages and referring to them in the main page using:
    <f:subview id="SampleSubView">
    <jsp:include page="/app/SamplePage.jspx"/>
    </f:subview>
    Mitesh.

  • Encrypt custom attribute

    Tar: 7340338.994
    OID Version: 10.1.2.0.2
    We are trying to encrypt the custom attribute ( ssn, answer ). How do we encrypt the custom attribute ? This is security requirement.
    I find nothing in the admin guide and I am not even sure we can do this. Does anyone know how to encrypt a custom attribute?
    I am thinking at best this is an Enhancement Request.

    Several ways:
    1. Write a plugin: http://download.oracle.com/docs/cd/B14099_19/idmanage.1012/b14082/plugin_intr.htm#i120282
    2. Put OVD in front of OID, point the application to OVD and write a plugin for OVD: http://download.oracle.com/docs/html/E12283_01/java_plug_ins.htm#CIHBDHHE
    3. If you can find the attribute in ODS schema, try encryption at the database level with TDE or VPD. Actually I am not sure it will carry over to LDAP interface..probably not but it's worth a try
    4. Have the application do it?

  • Problem with setting custom attribute and it being searchable

    I'm having an issue with setting a custom attribute and having it be searchable using Portal 10.1.4. The situation that we have is that we initially added a bunch of files to Oracle Portal using webdrive. Later on, we decided that we needed another custom attribute called "Pinned Item" that will be used for searching (boolean value) and gave it a default value of false. The attribute was then added to the "File" item type in the "Shared Objects" group.
    It appears that since this attribute wasn't initially available on the file object, we couldn't search on it so we decided to set it programatically. First, I tried using wwsbr.set_attribute but it errored out seemingly because the value wasn't set in the first place. If I set a value first by using the web front end, I could then use the set_attribute procedure.
    So, I moved on to using wwsbr_api.modify_item and it appears to set it (although everything is being set to false until I changed it to "text" instead of "boolean" which is OK because that's what I wanted anyway... see metalink bug 390618.1). I'm using the method outlined in metalink doc 413079.1. When I do set it to a "1", and edit the item the check box is checked indicating that it is set correctly. And if I just click "OK" to save the attributes after I open it everything works like it should.
    However, the advanced search (and custom search portlet) and the search APIs are not picking it up. I'm not sure if I'm hitting Metalink bug ID 5592472 or not as that's using the "set_attribute" procedure instead of the modify_item procedure. And their "workaround" of setting the attribute in the UI isn't really feasible for a couple thousand files.
    So far I've tried the following things to get it working:
    1. I am calling wwpro_api_invalidation.execute_cache_invalidation
    2. I have executed wwv_context.sync
    3. I cleared the page group cache
    4. I invalidated all of the web cache
    Does anyone else have any other suggestions?

    I'm having an issue with setting a custom attribute and having it be searchable using Portal 10.1.4. The situation that we have is that we initially added a bunch of files to Oracle Portal using webdrive. Later on, we decided that we needed another custom attribute called "Pinned Item" that will be used for searching (boolean value) and gave it a default value of false. The attribute was then added to the "File" item type in the "Shared Objects" group.
    It appears that since this attribute wasn't initially available on the file object, we couldn't search on it so we decided to set it programatically. First, I tried using wwsbr.set_attribute but it errored out seemingly because the value wasn't set in the first place. If I set a value first by using the web front end, I could then use the set_attribute procedure.
    So, I moved on to using wwsbr_api.modify_item and it appears to set it (although everything is being set to false until I changed it to "text" instead of "boolean" which is OK because that's what I wanted anyway... see metalink bug 390618.1). I'm using the method outlined in metalink doc 413079.1. When I do set it to a "1", and edit the item the check box is checked indicating that it is set correctly. And if I just click "OK" to save the attributes after I open it everything works like it should.
    However, the advanced search (and custom search portlet) and the search APIs are not picking it up. I'm not sure if I'm hitting Metalink bug ID 5592472 or not as that's using the "set_attribute" procedure instead of the modify_item procedure. And their "workaround" of setting the attribute in the UI isn't really feasible for a couple thousand files.
    So far I've tried the following things to get it working:
    1. I am calling wwpro_api_invalidation.execute_cache_invalidation
    2. I have executed wwv_context.sync
    3. I cleared the page group cache
    4. I invalidated all of the web cache
    Does anyone else have any other suggestions?

  • Custom Attributes in Target Group Email Campaign Not Refreshed

    We have a campaign sending emails to a target group of BPs.  To fill our custom attributes with values  we have implemented our code in badi CRM_IM_ADD_DATA_BADI method CRM_IM_BPSELE.  We tested our code using the Test Send feature from the email form and all worked fine.
    But when we ran the campaign in the background for a Target Group with multiple BPs it would not work correctly, our attribute values were incorrect. 
    We discovered while debugging the job, that the badi gets run once for each BP, but the attribute values from the previous BP do NOT get refreshed.  In fact there are 2 entire sets of attribute records in the CT_ATT_VALUES table parameter.  Each time through it multiplies by another set of our attributes.
    I have put code in the badi as a workaround that deletes the previously filled attributes for the previous BP, but I'd like to figure out what is causing this problem.
    Any help would be appreciated.
    thanks,
    Lee

    Hi Lee,
    Is this issue resolved for you now??
    I am facing the similar problem.
    Though the BADi is not used for these two mails (it is used in some other mail forms), it is actually called in 'CRM_ERMS_MAIL_COMPOSE' Function Module and the process is same as u said. There are 2 sets of values.
    I am using a Mail Alert functionality where in a 'Mail Alert ON' is sent to field engineers (FE) and then upon FE accepting the work we will send a 'Mail Alert OFF' to FEs.
    Problem is, we get one or two fields data incorrectly sometimes. I am not able to find out the root cause yet.
    Please let me know if you have had any resolution to this!
    Thanks in advance.
    Chaitanya

  • How to Add custom Attribute in XML

    How to add Custom attribute recusrivly. With sequence order.
    //Before xml:-
    var myxml:XML=
    <root>
    <leval0 >
    <leval1 >
    <leval2></leval2>
    <leval2></leval2>
    </leval1>
    <leval1 >
    <leval2></leval2>
    <leval2></leval2>
    </leval1>
    </leval0>
    </root>
    ////After xml:
    var myxml:XML=
    <root>
    <leval0 levalid="0" >
    <leval1 levalid="0_0" >
    <leval2 levalid="0_0_0"></leval2>
    <leval2 levalid="0_0_1"></leval2>
    </leval1>
    <leval1 levalid="0_1" >
    <leval2 levalid="0_1_0"></leval2>
    <leval2 levalid="0_1_1"></leval2>
    </leval1>
    </leval0>
    </root>

    //call this method
                trace(addAttribute(myxml));
    //method
                private function addAttribute(node:XML, depth:String = ""):XML
                    if (node.hasComplexContent())
                        var count:int = 0;
                        var prefix:String = 0 < depth.length ? depth + "_" : "";
                        var currentAtt:String;
                        for each (var nodeItem:XML in node.children())
                            currentAtt = prefix + count;
                            nodeItem.@levalid = currentAtt;
                            addAttribute(nodeItem,currentAtt);
                            count++;
                    return node;

  • 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

Maybe you are looking for

  • BAPI to add role to a user.

    Hi, Is there any BAPI available to assign role to a user?. I got one bapi BAPI_USER_ACTGROUPS_ASSIGN, this bapi does work. But the problem is it deletes the previous roles assigned to the user and then assign new one. I would like to know if there is

  • 802.1x with /21 subnet

    Hello, I am currently deploying 802.1x using following devices: XP - HP Procurve - Cisco ACS - Active Directory I am able to forward dynamic vlan id to employe and consultant after authentication. Bit how to deal with big site having a large number o

  • Why won't my iPad 3 history clear?

    Here is some other information: I noticed a few days ago that a website I had not visited was in my iPad's browsing history.  I deleted my history and cookies and data but they remained.  I was on my dad's username: he and I shared one; now that I'm

  • App Store, victim of fraud competitors

    Hello to all, I am a developer and i am confident that fraud competitors ranked my app with one star ! Why ? because its impossible in a couple of hours to get an exact number of 41 one star al over 40 stores worldwide. And it happens to be  over 160

  • Help, I cannot log in!!

    Have installed iCloud on my PC direct from Apple software downloads.  Trying to log in using Apple id as requested, login details are correct (I checked by putting a false passcode in which it failed).  However, it will not log in, just keeps rolling