Changeset 1283 for extensions/net.sf.basedb.reggie
- Timestamp:
- Feb 1, 2011, 1:54:18 PM (13 years ago)
- Location:
- extensions/net.sf.basedb.reggie/trunk
- Files:
-
- 10 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/net.sf.basedb.reggie/trunk/build.xml
r1282 r1283 54 54 <fileset dir="." includes="README,LICENSE,RELEASE,build.xml" /> 55 55 <fileset dir="." includes="src/**,resources/**,META-INF/**" /> 56 <fileset dir="." includes="lib/ compile/*" />56 <fileset dir="." includes="lib/reggie/*" /> 57 57 <fileset file="${jar.name}" /> 58 58 </copy> … … 92 92 > 93 93 <fail unless="base.home" message="base.home is not set to the path of BASE installation." /> 94 <copy todir="${base.home}/www/WEB-INF/extensions" file="${jar.name}" /> 94 <copy todir="${base.home}/www/WEB-INF/extensions"> 95 <fileset dir="." includes="lib/reggie/*" /> 96 <fileset file="${jar.name}" /> 97 </copy> 98 95 99 </target> 96 100 … … 113 117 <compilerarg value="${javac.arg}" /> 114 118 </javac> 115 <copy todir="${build}">116 <fileset dir="." includes="META-INF/*" />117 <fileset dir="." includes="resources/**" />118 </copy>119 119 <jar 120 120 jarfile="${jar.name}" 121 basedir="${build}"121 manifest="META-INF/MANIFEST.MF" 122 122 > 123 <fileset dir="${build}" /> 124 <fileset dir="." includes="META-INF/**" /> 125 <fileset dir="." includes="resources/**" /> 123 126 </jar> 124 127 </target> -
extensions/net.sf.basedb.reggie/trunk/resources/index.jsp
r1282 r1283 27 27 <base:body> 28 28 29 <p:path> 30 <p:pathelement title="Reggie" /> 31 </p:path> 29 <p:path> 30 <p:pathelement title="Reggie" /> 31 </p:path> 32 33 <table border="0" cellspacing="0" cellpadding="0" width="100%"> 34 <tr valign="top"> 35 <td width="50%"> 36 37 <h3 class="light">Reggie wizards</h3> 38 <div class="boxedbottom"> 39 <ul> 40 <li><a href="persinfo.jsp?ID=<%=ID%>">Personal information registration</a> 41 </ul> 42 43 </div> 44 </td> 45 <td width="50%"> 46 </td> 47 </tr> 48 </table> 32 49 33 50 -
extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/Reggie.java
r1282 r1283 1 1 package net.sf.basedb.reggie; 2 3 import java.util.List; 4 5 import net.sf.basedb.core.Annotatable; 6 import net.sf.basedb.core.AnnotationSet; 7 import net.sf.basedb.core.AnnotationType; 8 import net.sf.basedb.core.DbControl; 9 import net.sf.basedb.core.Include; 10 import net.sf.basedb.core.InvalidDataException; 11 import net.sf.basedb.core.Item; 12 import net.sf.basedb.core.ItemNotFoundException; 13 import net.sf.basedb.core.ItemQuery; 14 import net.sf.basedb.core.Type; 15 import net.sf.basedb.core.query.Expressions; 16 import net.sf.basedb.core.query.Hql; 17 import net.sf.basedb.core.query.Restrictions; 2 18 3 19 /** … … 8 24 { 9 25 26 /** 27 The name of the "Personal number" annotation type, used 28 to store 12-digit personal number for biosources. The 29 number should be unique and is stored as a string. 30 */ 31 public static final String PERSONAL_NUMBER = "PersonalNumber"; 32 33 public static final String FAMILY_NAME = "FamilyName"; 34 35 public static final String ALL_FIRST_NAMES = "AllFirstNames"; 36 37 public static final String GENDER = "Gender"; 38 39 public static final String DATE_OF_BIRTH = "DateOfBirth"; 40 41 public static final String LATERALITY = "Laterality"; 42 43 44 public static AnnotationType findAnnotationType(DbControl dc, Item itemType, String name) 45 { 46 ItemQuery<AnnotationType> query = AnnotationType.getQuery(itemType); 47 query.restrict(Restrictions.eq(Hql.property("name"), Expressions.parameter("name", name, Type.STRING))); 48 query.include(Include.ALL); 49 List<AnnotationType> result = query.list(dc); 50 if (result.size() == 0) 51 { 52 throw new ItemNotFoundException("AnnotationType["+name+"]"); 53 } 54 else if (result.size() > 1) 55 { 56 throw new InvalidDataException("Found > 1 AnnotationType["+name+"]"); 57 } 58 return result.get(0); 59 } 60 61 public static Object getAnnotationValue(Annotatable item, AnnotationType at) 62 { 63 if (!item.isAnnotated()) return null; 64 AnnotationSet as = item.getAnnotationSet(); 65 if (!as.hasAnnotation(at)) return null; 66 return as.getAnnotation(at).getValues().get(0); 67 } 68 10 69 }
Note: See TracChangeset
for help on using the changeset viewer.