001 package com.mentata.examples.nwu;
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.SG8EmailAttribute;
008 import com.mentata.sg8.SG8MLSAttribute;
009 import com.mentata.sg8.SG8Mailable;
010 import com.mentata.sg8.core.inetorgperson;
011
012 /**
013 * A person affiliated with Northwestern University.
014 */
015 public class person extends inetorgperson implements SG8Mailable {
016
017 /**
018 * Constructs an empty template.
019 *
020 * @param context a containing SG8 context
021 */
022 public person(L3DContext context)
023 throws L3DException {
024
025 // pass the context up the constructor chain
026 super(context);
027
028 // configure the object
029 useServlets( new String[] {"retrieve", "mail"} );
030 setFilter("(mail=*)");
031 setFormats();
032
033 // add the attributes unique to this object class
034 addAttribute("nustudentschooladdress", new SG8MLSAttribute() );
035 addAttribute("nucurriculum", new SG8StringAttribute() );
036 addAttribute("numailbox", new SG8EmailAttribute() );
037 applyLabels();
038
039 // set basic attribute lists for this object class
040 addAttributeList("l3d.identify", new String[] {"displayname"} );
041 addAttributeList("l3d.sort", new String[] {"sn", "givenname"} );
042 addAttributeList("sg8.search", new String[] {"sn", "cn", "title"} );
043 addAttributeList("sg8.sortable", new String[]
044 {"givenname", "sn", "nucurriculum", "title"} );
045 addAttributeList("sg8.hyperlink", getAttributeList("l3d.identify") );
046 addAttributeList("sg8.list", new String[] {"title"} );
047
048 // set attribute lists to support retrievability
049 addAttributeList("sg8.highlight", new String[]
050 {"telephonenumber", "nucurriculum", "postaladdress"} );
051 addAttributeList("sg8.r_tabtext", new String[]
052 {"sn", "givenname", "cn", "mail", "telephonenumber"} );
053 addAttributeList("sg8.r_html", new String[]
054 {"cn", "title", "nucurriculum", "numailbox", "telephonenumber",
055 "facsimiletelephonenumber", "pager", "postaladdress", "homepostaladdress",
056 "nustudentschooladdress"} );
057 addAttributeList("sg8.r_dsml", getAttributeList() );
058 addAttributeList("sg8.r_ldif", getAttributeList() );
059
060 // add attribute lists to support mailability
061 addAttributeList("sg8.mail", new String[] {"mail"} );
062 addAttributeList("sg8.mailalso", new String[] {"numailbox"} );
063 }
064 }