001    package com.mentata.examples.psu;
002    
003    // import necessary classes
004    import com.mentata.l3d.L3DContext;
005    import com.mentata.l3d.L3DException;
006    import com.mentata.sg8.SG8StringAttribute;
007    import com.mentata.sg8.SG8UTCAttribute;
008    import com.mentata.sg8.SG8MLSAttribute;
009    import com.mentata.sg8.core.inetorgperson;
010    
011    /**
012    * A person affiliated with Penn State University.
013    */
014    public class person extends inetorgperson {
015    
016            /**
017            * Constructs an empty template.
018            *
019            * @param context a containing SG8 context
020            */
021            public person(L3DContext context)
022                    throws L3DException {
023    
024                    // pass the context up the constructor chain
025                    super(context);
026    
027                    // configure the object
028                    addObjectclasses(new String[] {"psuperson"});
029                    setBatch(40);
030                    setFormats();
031                    setLocal();
032    
033                    // add the attributes unique to this object class
034                    addAttribute("psdiridn", new SG8StringAttribute() );
035                    addAttribute("psmailid", new SG8StringAttribute() );
036                    addAttribute("psofficeaddress", new SG8MLSAttribute() );
037                    addAttribute("edupersonprimaryaffiliation", new SG8StringAttribute() );
038                    addAttribute("psdepartment", new SG8StringAttribute() );
039                    addAttribute("pscampus", new SG8StringAttribute() );
040                    addAttribute("modifytimestamp", new SG8UTCAttribute() );
041                    addAttribute("psofficelocation", new SG8MLSAttribute() );
042                    applyLabels();
043    
044                    // set basic attribute lists for this object class
045                    addAttributeList("l3d.identify", new String[] {"psdiridn", "cn"} );
046                    addAttributeList("l3d.sort", new String[] {"sn", "givenname"} );
047                    addAttributeList("sg8.search", new String[] {"sn", "cn", "title", "psdepartment"} );
048                    addAttributeList("sg8.sortable", new String[] 
049                            {"uid", "givenname", "sn", "cn", "title", "edupersonprimaryaffiliation", 
050                            "psdepartment"} );
051                    addAttributeList("sg8.hyperlink", getAttributeList("l3d.identify") );
052                    addAttributeList("sg8.list", new String[] {"psdepartment"} );
053    
054                    // set attribute lists to support retrievability
055                    addAttributeList("sg8.highlight", new String[] {"title", "edupersonprimaryaffiliation",
056                            "psdepartment", "pscampus", "mail", "psmailid", "telephonenumber", "pager", 
057                            "facsimiletelephonenumber", "psofficeaddress", "psofficelocation", "labeleduri",
058                            "postaladdress"} );
059                    addAttributeList("sg8.r_tabtext", new String[] 
060                            {"psdiridn", "uid", "givenname", "sn", "cn", "mail", "telephonenumber", 
061                            "facsimiletelephonenumber", "pager", "title", "edupersonprimaryaffiliation",
062                            "psdepartment", "modifytimestamp"} );
063                    addAttributeList("sg8.r_html", new String[] 
064                            {"uid", "givenname", "sn", "title", "edupersonprimaryaffiliation", "psdepartment", 
065                            "pscampus", "mail", "labeleduri", "psmailid", "telephonenumber", "pager", 
066                            "facsimiletelephonenumber", "psofficeaddress", "psofficelocation", "postaladdress",
067                            "modifytimestamp"} );
068                    addAttributeList("sg8.r_dsml", getAttributeList() ); 
069                    addAttributeList("sg8.r_ldif", getAttributeList() ); 
070            }
071    }