Bind control using custom attribute

Everyone!
I have to create a ACL which will allow users to bind Directory Server only who has custom status attribute value as active.
all others should be denied.
I tried some thing like this ...
first i created a dynamic group ie) whose members are having attribute value as active.
then i created an acl placed on root dc=example,dc=com
(targetattr = "*") (target = "ldap:///ou=People, dc=example,dc=com") (version 3.0;acl "portal";allow (read,compare,search)(groupdn = "ldap:///cn=temp_access,ou=Groups, dc=example,dc=com");)
Problem still users whose status is not active is able to bind ...may be i am missing something here .
Also what is best way to disable binding of user entry without inactivating entry ...
.any advise will be greatly appreciated.
Thank you

A "typical" user authentication works like this:
1) User enters their uid and password into a gui.
2) The application binds to the directory with an application ID and password and searches for the user based on uid and retrieves the user's DN
3) The application then binds to the directory with the user's DN and password to perform authentication
My suggestion is to block the application's access to the user's record at step 2 so that the user's DN cannot be retreived and the application will fail with a "entry not found" error.
An ACI can allow or deny access to a user entry based on an attribute in that entry. So the ACI I am suggesting would deny access to the application for any user entries where status=lock.
I understand that you are trying something else with dynamic groups, etc. but I don't know if that will work without testing it, and I barely have time to test my own ideas!

Similar Messages

  • Using Custom Attributes in HBR

    <p>Does anyone know how to use custom attributes to limit local orglobal HBR variables (run-time prompts)? We have business rulesthat were developed in the graphical designers and the run timeprompt was set up to limit the user's selection based on a customattribute. When these business rules are imported into EAS theywill no longer validate.</p>

    Hi Maarten,
    I have applied the logic mentioned above to my code. But it still does not procure any data from the container.
    <ItemType name="uwl.task.webflow.decision.<task>" connector="WebFlowConnector" defaultView="travel" defaultAction="launchTravelUwl" executionMode="default">
          <ItemTypeCriteria systemId="UWL_R3" externalType="<task>" connector="WebFlowConnector"/>
           <CustomAttributes>
            <CustomAttributeSource id="ABAP_BOR" objectIdHolder="NOTIFICATION" objectType="ZBUS2078" cacheValidity="final">
              <Attribute name="STARTDATE" type="date" displayName="Creation Date"/>
              <Attribute name="ENDDATE" type="double" displayName="Due By"/>
            </CustomAttributeSource>
            <CustomAttributeSource id="WEBFLOW_CONTAINER" objectIdHolder="NOTIFICATION" objectType="WebflowContainer" cacheValidity="final">
              <Attribute name="NOTIFICATION" type="string" displayName="NOTIFICATION"/>
            </CustomAttributeSource>
          </CustomAttributes>
          <Actions>
            <Action name="replan" groupAction="no" handler="UserDecisionHandler">
              <Properties>
                <Property name="UserDecisionNote" value="mandatory"/>
                <Property name="decisionKey" value="4"/>
              </Properties>
            </Action>
            <Action name="reject" groupAction="yes" handler="UserDecisionHandler">
              <Properties>
                <Property name="UserDecisionNote" value="true"/>              
                <Property name="decisionKey" value="1"/>
              </Properties>
            </Action>
          </Actions>
        </ItemType>

  • Using LOV with bind var as custom attribute?

    I have an Portal LOV which uses a bind variable.
    Can I use this LOV as a custom attribute? If so, how do I specific the bind variable value?
    In the display option of the attribute I tried LOV_NAME(LOV_Bind => 'value'), but the LOV is not applied.

    It's been quite a while, but I think I remember trying this and not being able to achieve it. You can use a LOV with a bind variable in a report or in a form, or similar, but there is no way in an item to from specify where to get the bind variable. My suggestion if this is a requirement would be to use a portal form which submits to a stored procedure or pl/sql generated form to gather the attributes and then programmatically create the item using the APIs. Takes a bit of work, but gets you exactly what you described above.
    Rgds/Mark M.

  • Cannot bind when using "pwdLastSet" attribute in Active Directory

    Admin resets the password & enables user has to change password at next logon, when i try to change user password, I couldn't able to bind the user & it shows error Such as
    Since Authentication fails, he could able to modify the attribute[pwdLastSet].
    please suggest me any solution
    Error occured
    xyz is not authenticated javax.naming.AuthenticationException: [LDAP: error code 49 - 80090308: LdapErr: DSID-0C090334, comment: AcceptSecurityContext error, data 773, vece
    javax.naming.NamingException: [LDAP: error code 1 - 00000000: LdapErr: DSID-0C090A1A, comment: In order to perform this operation a successful bind must be completed on the connection., data 0, vece
    Since i couldn't able to bind the user, i cann;t able to change user password. Here is my program :
    {code}public class Fastbindclient_changePwd extends HttpServlet{
    class ldapfastbind {
    class FastBindConnectionControl implements Control {
    public byte[] getEncodedValue() {
    return null;
    public String getID() {
    return "2.16.840.1.113730.3.4.2";
    public boolean isCritical() {
    return Control.CRITICAL;
    public ldapfastbind(String ldapurl) {
    env = new Hashtable();
    env.put(Context.INITIAL_CONTEXT_FACTORY,
    "com.sun.jndi.ldap.LdapCtxFactory");
    env.put(Context.SECURITY_AUTHENTICATION, "simple");
    env.put(Context.SECURITY_PROTOCOL, "ssl");
    env.put(Context.PROVIDER_URL, ldapurl);
    connCtls = new Control[] { new FastBindConnectionControl() };
    try {
    ctx = new InitialLdapContext(env,connCtls);
    catch (NamingException e) {
    public int Authenticate(String username, String password, HttpServletRequest request, HttpServletResponse response) throws LDAPException{
    try {
    ctx.addToEnvironment(Context.SECURITY_PRINCIPAL,username);
    ctx.addToEnvironment(Context.SECURITY_CREDENTIALS,password);
    ctx.reconnect(connCtls);
    System.out.println(username + " is authenticated");
    return 0;
    catch (AuthenticationException e) {
    int index5= errMsg.indexOf("data 773");
    if(index5 != -1)
    try {
    pwdLastSet = 1;
    System.out.println("Password Last Set "+pwdLastSet);
    String j_username=request.getParameter("j_username");
    String j_password=request.getParameter("j_password");
    String new_password=request.getParameter("new_password");
    String change_password=request.getParameter("change_password");
    boolean isChanged = ctxFast.ChangePassword(j_username, j_password, new_password, request, response);
    } catch (IOException e1) {
    catch (NamingException e) {
    return 0;
    public boolean ChangePassword(String sUserName, String sOldPassword, String sNewPassword, HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException {
    try {
    ModificationItem[] mods = new ModificationItem[1];
    ModificationItem[] mods1 = new ModificationItem[1];
    String oldQuotedPassword = "\"" + sOldPassword + "\"";
    byte[] oldUnicodePassword = oldQuotedPassword.getBytes("UTF-16LE");
    String newQuotedPassword = "\"" + sNewPassword + "\"";
    byte[] newUnicodePassword = newQuotedPassword.getBytes("UTF-16LE");
    System.out.println("newUnicodePassword" + newUnicodePassword);
    System.out.println("printed before modify");
    mods[0] = new ModificationItem(LdapContext.REPLACE_ATTRIBUTE, new BasicAttribute("unicodePwd", newUnicodePassword));
    ctx.modifyAttributes("cn="+sUserName+",cn=Users,dc=tc,dc=com", mods);
    mods1[0] = new ModificationItem(LdapContext.REPLACE_ATTRIBUTE, new BasicAttribute("pwdLastSet", "-1"));
    System.out.println("pwdLastSet Replaced");
    /* mods[0] = new ModificationItem(DirContext.REMOVE_ATTRIBUTE, new BasicAttribute("unicodePwd", oldUnicodePassword));
    mods[1] = new ModificationItem(DirContext.ADD_ATTRIBUTE, new BasicAttribute("unicodePwd", newUnicodePassword));
    ctx.modifyAttributes("cn="+sUserName+",cn=Users,dc=tc,dc=com", mods1);
    ctx.close();
    return true;
    catch (AuthenticationException e) {
    if(index5 != -1)
    try {
    pwdLastSet = 1;
    System.out.println("Password Last Set "+pwdLastSet);
    String j_username=request.getParameter("j_username");
    String j_password=request.getParameter("j_password");
    String new_password=request.getParameter("new_password");
    String change_password=request.getParameter("change_password");
    boolean isChanged = ctxFast.ChangePassword(j_username, j_password, new_password, request, response);
    } catch (IOException e1) {
    // TODO Auto-generated catch block
    e1.printStackTrace();
    return false;
    catch (NamingException e) {
    return false;
    public void finito() {
    try {
    ctx.close();
    System.out.println("Context is closed");
    catch (NamingException e) {
    System.out.println("Context close failure " + e);
    public void bindClient(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
    String ldapurl = "ldaps://172.22.0.99:636";
    String keystore = "D:/j2sdk1.4.2_04/jre/lib/security/CACert.ks";
    System.setProperty("javax.net.ssl.trustStore",keystore);
    ctxFast = new ldapfastbind(ldapurl);
    try {
    IsAuthenticated = ctxFast.Authenticate(request.getParameter("j_username"),request.getParameter("j_password"), request, response);
    boolean isChangedNrml;
    if(pwdLastSet == 0)
    isChangedNrml = ctxFast.ChangePassword(j_username, j_password, new_password, request, response);
    System.out.println("b4 change");
    System.out.println("After change 1");
    } catch (LDAPException e) {
    System.out.println("LDAP Exception : " + e.getLDAPResultCode() + "LDAPMessage : " + e.getLDAPErrorMessage()+ "message : " + e.getMessage());
    e.printStackTrace();
    String errMsg = e.getMessage();
    System.out.println("error msa"+errMsg);
    ctxFast.finito();
    public ldapfastbind ctxFast = null;
    public int pwdLastSet = 0;
    }please suggest me solution
    Thanks in Advance..

    See my other reply concerning "user must change password" and the chicken & egg problem.
    In addition when using the LDAP Fast Bind control, it is only used to authenticate a user (verify credentials).
    If the user has the "user must change password" setting enabled, then the LDAP Fast Bind Connection Control will always fail the authentication attempt.
    Furthermore, the LDAP Fast Bind control does not create a Windows token, and even of the user had successfully authenticated, it does not permit the user to perform other operations againts the directory such as modify attribute values or change passwords.
    You must perform a full LDAP bind in order to allow a user to change their password or to modify other attribute values.

  • AD Import using Custom Attributes?

    by default when you run AD import in UC, it fetched whole AD domain accounts which contains service accounts and a lot other stuff which one don't want to import.
    So choice is to search using a particular Base DN which query only one OU.
    But this simple query is not adequate in a organization which has a very complex and large OUs structure, users which needs to be UC enabled are distributed among many separate OUs.
    Is there some kind of filters or other method during AD import which can query users from AD based on security group membership or CustomAttributes. The best approach will be CustomAttributes based query, because we already published CustomAttribute15 with values "STAFF","Faculty" and "Students".
    The whole purpose which we want to achieve is to exclude STUDENTS category in AD import. Help me friends to achieve this task.

    Hi
    You can edit the LDAP filer used by CCM; with that you could filter on your custom attributes. See this post for a discussion of a similar modification; it's just a matter of putting together a new LDAP filter string to return the results you want.
    https://supportforums.cisco.com/message/3042759#3042759
    Regards
    Aaron
    Please rate helpful posts...

  • Custom attributes in Service Registry

    Hi!
    Is it possible to use custom attributes in Service Registry?
    And if Yes, where can these attributes be displayed in Business Service Control or Registry Control?
    Thanks

    Hi,
    Please see the below link. This might help you.
    http://weblogs.sdn.sap.com/cs/blank/view/wlg/20379
    http://wiki.sdn.sap.com/wiki/display/BPX/Chapter+3
    Thanks and regards,
    SNJY

  • How to use Custom Search in Dynamic Page or HTML Portlet ?

    Gurus,
    1. I have a tab called My Space in the portal web site, where user gets a personalized view of the content.
    2. I am using custom attributes and custom item types. I have a custom attribute called 'Location', which is a attribute of custom item types.
    3. I have 2 pages - News and Events.
    4. All the content in News and Events page is tagged by the attribute 'Location'.
    5. The requirement is to let the user search the News and Events by Location.
    6. To achieve this I used the Custom Search portlet and the user can select the attribute Location and see the resultant News and Event items by location in the Search portlet.
    7. The requirement is to present the News items and Event items in separate regions on the page and show only the first 5 News and Event items in the result and show a More link which would guide the user to rest of the News and Event items.
    8. Eventually there may be more content other than News and Events tagged by location. If so, the requirement is to create a new region and display the new content.
    9. How would I do this using custom search ? I was thinking if there is anyway I could use the custom search api (where can i find it ?) in the HTML portlet or Dynamic page and submit the result to IFRAMES in each region and show the output ?
    Pls advise.
    Thanx a bunch.

    I would suggest that you use two custom search portlets; one for the news items and one for the events items. Switch the custom search portlets to "AutoQuery" mode and add the relevant criteria. On the results display tab of the the "edit defaults" screen, choose to show just 5 items.
    To add a link to show the user mode results, I'd create two new pages that have just a single custom search portlet on it that is customised to show more of the results and maybe has the pagination links enabled.
    Then I'd add two "Page Link" items underneath the two news and events portlets on the first page in an item region.
    I'm sure there are other ways of doing this as well. Hope that helps to get you started.

  • HTML 5 and Spry.. Making custom attributes valid

    The HTML 5 spec is still a "Editors Draft" but doesn't mean browser haven't started intergating it. While i was reading through the specification i noticed that HTML allows you to specify custom attributes on elements (see: http://dev.w3.org/html5/spec/Overview.html#embedding-custom-non-visible-data ). We all know Spry also uses custom attributes for the Spry dataset. These are typically prefixed with spry:action_here=""
    At this point its not valid HTML even though, when serving your page as xhtml it should be valid.. as xml allows you to specify custom attributes as well. But that aside, with the release of HTML5 getting closer and closer we could make Spry attibutes valid if we started prefixing all custom attributes with data-
    For example:
    spry:region="ds1"     =>     data-spry:region="ds1"
    spry:if="0 == false"  =>     data-spry:if="0 == false"
    A switch to the data- prefix would require very little editing of the existing spry files. The only thing users would have to do, is switch to the HTML5 doc type declaring to make it valid. As this doc type has backwards compatiblity and do not force IE6 in quirksmode i feel this is better alternative to externalizing the custom attributes or waiting for browser to support extended doctypes.
    So i wonder what you opinions are on this . Is Spry ready for HTML5 and is HTML5 ready for Spry ?

    Am I excited about the upcoming HTML5? YES!  But not because it validates our Spry attributes.
    Spry, if used properly, already works well and the fact that it is not validated by W3C can be regarded as a curious fact. Sort of like a driver of mine that has not been validated by Microsoft; without the driver my hardware does not work. So what do I do?
    Well for some people its not a problem that the pages do not validate. But there companies and clients who value validation. Its understandable because people are overhyping it. In this case, it would allow to validate out of the box, without any changes to your code. Making it easier for starting developers and create a W3C valid document.
    I am excited about the new HTML5 elements that will be introduced, hopefully making life easier.
    Well doesn't really make a life easier. I'm currently creating my online resume in HTML and its harder... Normally you would just use divs for almost every layout wrapper now you got to choose between aside, section, article, details, hgroup, header etc. So much elements to choose from, but using them wisely is the hard part.
    I am not excited about the fact that HTML5, being backward compatible, will come with the deficiencies of its predecesors
    I am confused about the near simultaneous release of XHTML2. Where is the logic? Cannot the regulators and validators agree on a standard? I guess not. Even the browser-producers cannot agree on a standard. Remember the confusion with audio and video tapes?
    All of this confusion only adds weight to my argument, who cares about W3C validation or Microsoft validation? if it works it works!
    Some people like it strict some people don't, for performance reasons i actually choose for the loose version. It allows me to build a more compressed file .
    Video codec wars are fun to.. Ogg  vs MPEG. Using flash as fallback or silver light for unsupported browsers, or just generate multiple formats.. Hard to choose.. I personally hope h.264 codec will be used because its quality wise its much better. But we will see what the browser vendors will decide. 

  • Assistance with Powershell custom attribute population

    I'm currently undertaking an exchange 2003 to exchange 2010 migration and as part of this am having to redesign the email address policies. Our legacy recipient policies have worked well by targeting exchange alias but in 2010 this won't work.
    We have a number of exchange domains and in order to update the email addresses for a group of users we have decided to use custom attribute 15 to target these AD groups, however updating this manually for over 2000 users would prove very time consuming.
    Exchange 2010 seems to be geared towards powershell and as it's still early days in my knowledge am looking for assistance.
    Does anyone know a powershell command I can run to update custom attribute 15 for users of a specific security group?
    Many Thanks

    I am no exchange expert but also not sure what you mean by custom attribute 15. Since you want to update "users" in a specific "group" I assume this will be in Active Directory?
    If so, you can use the AD cmdlets to get the job done. On a machine that has AD users and computers installed you can do something like this:
    Import-Module ActiveDirectory
    Get-ADGroupMember -Identity groupName | ForEach-Object{
    Set-ADUser -Identity $_ -Replace @{customeAttributeName = "Replacement"}
    This hasn't been tested as I do not have an environment to test in, and not sure on the custom attribute name or what needs to be replaced with, so you will need to replace groupName with the group in question, customAttributeName with the correct name and
    "Replacement" with what you are replacing.
    If you find that my post has answered your question, please mark it as the answer. If you find my post to be helpful in anyway, please click vote as helpful.
    Don't Retire Technet

  • Binding a subtree using custom State- and ObjectFactory

    Hi,
    first of all a very short example to illustrate my idea. I know that it would be complete rubbish to store the kind of data in the example in multiple classes and ldap entries. Currently I'm working with much larger objects that must be written according to special schema definitions. This example is really only for illustration!
    LDAP-Schema:
    objectclass ( 1.3.6.1.4.1... NAME 'myperson'
                  SUP top STRUCTURAL
                  MUST ( cn $ sn ) MAY ( email ) )
    objectclass ( 1.3.6.1.4.1... NAME 'myphoto'
                  SUP top STRUCTURAL
                  MUST ( cn $ jpegPhoto ) )
    Java-Classes:
    class MyPhoto {
        byte[] photo;
    class MyPerson {
        String cn;
        String sn;
        String email;
        MyPhoto photo; // This is the really relevant line :)
    }Now to the question:
    Is it possible to bind multiple java objects with one call to bind and to get a subtree by using custom State- and ObjectFactory-Classes?
    Structure of the LDAP-Database
    dn: cn=John Doe
    {  cn=John Doe
       sn=Doe
       [email protected]   }
    dn: cn=TheLogo, cn=John Doe    // Child of cn=John Doe
    { cn=TheLogo              // The cn is the same for all MyPhoto entries
                              // its only use is for building the dn
      jpegPhoto=[some binary data]   }I tried to solve the problem with a kind of recursion. When my StateFactory is called to bind an Object of Class MyPerson it builds the appropriate AttributeList. Before it returns, it calls bind for the Object of class MyPhoto with the dn: "cn=TheLogo,cn=John Doe".
    Of course this doesn't work because the entry for cn="John Doe" doesn't exist at this time. Now I don't know what to do. A possible solution would be to create everything by hand, but then I wouldn't have to use custom StateFactories at all. But if there is a simple solution to my problem I would like to use my own StateFactory instead of having to implement a persistance manager on my own.
    I hope you understand what I want to do and why it doesn't work out. If you don't please ask and I will try to clarify.

    Hello,
    A provisional solution is to use an external controller. For this approach to work, each class has to provide the list of objects being part of its properties. I have prepared two interfaces for this purpose:
    public interface HasSubordinates {
    Enumeration getSubordinates();
    boolean hasSubordinates();
    public interface Storable extends HasSubordinates {
    String getIdentifier();
    Then, you can use the controller to recursively get the object "tree" and store it in the directory (either using objects that implement the DirContext interface or using StateFactories - the last one is the one I have used)
    The code for the Controller is the following:
    import javax.naming.*;
    import javax.naming.directory.*;
    import javax.naming.spi.*;
    import java.util.*;
    import java.io.IOException;
    public class DatabaseAccessController {
    // Constants
    final static String ldapServerName = "localhost";
    final static String rootdn = "cn=juanluis, o=niaf";
    final static String rootpass = "secret";
    final static String rootContext = "o=niaf";
    private DirContext initialContext;
    private static Properties env = new Properties();
    static {
    env.put( Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory" );
    env.put( Context.STATE_FACTORIES, "database.PersonStateFactory:database.AddressStateFactory");
    env.put( Context.PROVIDER_URL, "ldap://"+ ldapServerName+"/"+rootContext);
    env.put( Context.SECURITY_PRINCIPAL, rootdn );
    env.put( Context.SECURITY_CREDENTIALS, rootpass );
    public DatabaseAccessController() {
    try {
    initialContext = new InitialDirContext( env );
    } catch( Exception e ) {
    e.printStackTrace();
    public void store( Storable object ) {   
    try {
    store( object, initialContext );
    } catch( NamingException ne ) {
    ne.printStackTrace();
    private void store( Storable object, DirContext ctx ) throws NamingException{
    DirStateFactory.Result result = DirectoryManager.getStateToBind( object, null, null, env, null );
    Attributes attributes = result.getAttributes();
    DirContext new_ctx = ctx.createSubcontext( dn(object), attributes );
    if( object.hasSubordinates() ) {
    Enumeration subordinates = object.getSubordinates();
    while( subordinates.hasMoreElements() ) {
    try {
    store( (Storable)subordinates.nextElement(), new_ctx );
    } catch( Exception e ) {
    e.printStackTrace();
    private String dn( Storable object ) {
    return "cn="+object.getIdentifier();
    This is an example of how it should work on two objects:
    public class Person implements Storable{
    String name;
    String surname;
    Address address;
    public Person(String n, String sn, Address addr) {
    name = n;
    surname = sn;
    address = addr;
    public boolean hasSubordinates() {
    return true;
    public Enumeration getSubordinates() {
    Hashtable h = new Hashtable();
    h.put("address", address );
    return h.elements();
    public String getIdentifier() {
    return name + " "+ surname;
    public class Address implements Storable {
    String street;
    int number;
    Attributes attrs;
    public Address( String s, int n) {
    street = s;
    number = n;
    public boolean hasSubordinates() {
    return false;
    public Enumeration getSubordinates() {
    return null;
    public String getIdentifier() {
    return street + number;
    And here it is the program that access to the directory:
    public class TestLDAP {
    public TestLDAP() {
    public static void main(String[] args) {
    try {
    System.out.println("Creating controller...");
    DatabaseAccessController controller = new DatabaseAccessController();
    System.out.println("Controller created");
    Person person = new Person("Juan Luis", "Manas", new Address("Street in Madrid", 33 ));
    System.out.println("Storing object in the directory...");
    controller.store(person);
    System.out.println("object stored successfully!");
    } catch( Exception e ) {
    e.printStackTrace();
    }���
    If you find a better way of performing the storage of complex objects in the directory, please, let me know.
    Regards,
    Juan Luis

  • Using AD Custom Attributes in UME

    Hello all,
    I want to get employee number and First/Last name which are maintained in AD as Custom Attributes.
    The question is how to bind UME user attribute to AD Custom Attribute?
    In MMC AD Custom Attributes are shown as "Custom Attribute 1", ... "Custom Attribute N".
    But what technical name should we use to refer it in UME datasource XML configuration?
    <attribute name="EmployeeNumber">
      <physicalAttribute name="?CustomAttribute1?"/>
    </attribute>
    Thanks,
    Anton.

    please check if this help's. We used this for SunOne LDAP, i am assuming it should also work for AD.
    http://help.sap.com/saphelp_nw70/helpdata/en/1a/2bee408a63732ae10000000a155106/frameset.htm
    http://help.sap.com/saphelp_nw70/helpdata/en/1a/2bee408a63732ae10000000a155106/frameset.htm

  • Custom search using boolean attribute set to True gives no result

    I am setting up an auto-query using the custom search portlet. This is to show all items where a boolean custom attribute is checked, ie = True.
    In step 3 I have tried to set the operator to Equals to and the default value to True. This gives no results even though several items have this attribute set to True.
    The Auto Query check box is checked.

    Found that True = 1 in database. When set to this the search works.

  • How to use the bind variable in custom.pll

    Hi,
    How to use the bind variable in custom.pll.Its through error.
    any one gem me.
    very urgent.
    M.Soundrapandian.

    Hello,
    Please, ask this kind of questions in the e-business forum.
    Francois

  • 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

  • Using Rich Text Editor with a Custom Attribute

    Hello All,
    Can anyone please tell me as how can I use the Rich Text Editor with a Custom Attribute?
    I want to create a custom attribute based on text datatype, but when entering the value for this attribute in a Custom Item, portal shows a normal textarea. I want that the user should see the Richt Text Editor.
    Thanks for help.
    Regards

    Hi,
    Can you tell me what steps you are using to produce this, and which Portal version you are using. When I tried it, I wasn't able to reproduce it. Here are my steps:
    1) Created Custom Item Type, based on Text, under
    Page Groups > Shared Objects > Item Types
    2) Selected Three attributes (Description, Name, Publish Date). Note Text and Display Name were already selected
    3) In Add Item Wizard, configured list to allow for my
    custom item type selection.
    4) Then I was able to see the Rich Text Editor when editin
    my custom item type.
    Regards,
    J.

Maybe you are looking for