001 package com.mentata.examples;
002
003 // import necessary classes
004 import com.mentata.l3d.L3DContext;
005 import com.mentata.l3d.L3DException;
006 import com.mentata.sg8.SG8DateAttribute;
007 import com.mentata.sg8.SG8ImageAttribute;
008 import com.mentata.sg8.core.inetorgperson;
009
010 /**
011 * An American casualty from the invasion of Iraq in 2003.
012 */
013 public class casualty extends inetorgperson {
014
015 /**
016 * Constructs an empty template.
017 *
018 * @param context a containing SG8 context
019 */
020 public casualty(L3DContext context)
021 throws L3DException {
022
023 // pass the context up the constructor chain
024 super(context);
025
026 // configure the object
027 prependBase("ou=Casualties, ou=People");
028 minimizeScope();
029 setFormats();
030 setGlob();
031
032 // update the attributes
033 addAttribute("employeenumber", new SG8DateAttribute() );
034 addAttribute("labeleduri", new SG8ImageAttribute(0, 0, 3) );
035 applyLabels("com.mentata.examples.casualty");
036
037 // set basic attribute lists for this object class
038 addAttributeList("l3d.identify", new String[] {"cn"} );
039 addAttributeList("l3d.sort", new String[] {"employeenumber"} );
040 addAttributeList("sg8.search", new String[] {"cn", "postaladdress", "description"} );
041 addAttributeList("sg8.sortable", new String[]
042 {"sn", "businesscategory", "postalcode"} );
043 addAttributeList("sg8.hyperlink", getAttributeList("l3d.identify") );
044 addAttributeList("sg8.list", new String[] {"labeleduri", "description"} );
045
046 // set attribute lists to support retrievability
047 addAttributeList("sg8.r_html", new String[]
048 {"labeleduri", "businesscategory", "description", "employeenumber",
049 "postalcode", "postaladdress"} );
050 addAttributeList("sg8.r_tabtext", new String[]
051 {"businesscategory", "cn", "postaladdress", "description", "postalcode"} );
052 addAttributeList("sg8.r_ldif", getAttributeList() );
053 addAttributeList("sg8.r_dsml", getAttributeList() );
054 }
055 }