Changeset 6747


Ignore:
Timestamp:
Feb 18, 2015, 1:18:10 PM (7 years ago)
Author:
Nicklas Nordborg
Message:

References #1325: Lists of items (similar funcion as biomaterial lists)

Adding columns for subtypable items and registered items (=items that have an automatic registration date recorded). Note that most items use the same underlying database proprety execept samples and extracts which use the date from the linked creation event item.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/www/views/itemlists/members/list_members.jsp

    r6746 r6747  
    4141  import="net.sf.basedb.core.Shareable"
    4242  import="net.sf.basedb.core.Ownable"
     43  import="net.sf.basedb.core.Subtypable"
     44  import="net.sf.basedb.core.MeasuredBioMaterial"
     45  import="net.sf.basedb.core.Registered"
    4346  import="net.sf.basedb.core.Annotatable"
    4447  import="net.sf.basedb.core.AnnotationSet"
     
    113116  final boolean removable = Removable.class.isAssignableFrom(memberClass);
    114117  final boolean annotatable = Annotatable.class.isAssignableFrom(memberClass);
     118  final boolean subtypable = Subtypable.class.isAssignableFrom(memberClass);
     119  final boolean registered = Registered.class.isAssignableFrom(memberClass);
     120  final boolean measuredBioMaterial = MeasuredBioMaterial.class.isAssignableFrom(memberClass);
    115121 
    116122  final GuiContext guiContext = new GuiContext(itemType, GuiContext.Type.LIST, "listmembers."+list.getId());
     
    120126  final boolean removePermission = addPermission;
    121127 
     128  // Annotatable items
    122129  SnapshotManager manager = null;
    123130  if (annotatable)
     
    135142    }
    136143  }
     144 
     145  // Subtypable items
     146  final ItemQuery<ItemSubtype> subtypesQuery = subtypable ? Base.getSubtypesQuery(itemType) : null;
    137147
    138148  final Map<Plugin.MainType, Integer> pluginCount = PluginDefinition.countPlugins(dc, guiContext);
     
    150160  int numListed = 0;
    151161
     162  Formatter<Date> dateFormatter = FormatterFactory.getDateFormatter(sc);
    152163  JspContext jspContext = ExtensionsControl.createContext(dc, pageContext, guiContext, list);
    153164  ExtensionsInvoker invoker = ToolbarUtil.useExtensions(jspContext);
     
    214225      />
    215226      <tbl:columndef
     227        id="itemSubtype"
     228        property="itemSubtype"
     229        sortproperty="itemSubtype.name"
     230        exportproperty="itemSubtype.name:string"
     231        datatype="int"
     232        enumeration="<%=subtypable ? Enumeration.fromItems(subtypesQuery.list(dc), "-none-") : null%>"
     233        title="Type"
     234        sortable="true"
     235        filterable="true"
     236        exportable="true"
     237        show="<%=subtypable ? "auto" : "never" %>"
     238      />
     239      <tbl:columndef
     240        id="entryDate"
     241        property="<%=measuredBioMaterial ? "creationEvent.entryDate" : "entryDate"%>"
     242        datatype="date"
     243        title="Registered"
     244        sortable="true"
     245        filterable="true"
     246        exportable="true"
     247        formatter="<%=dateFormatter%>"
     248        show="<%=registered ? "auto" : "never" %>"
     249      />
     250      <tbl:columndef
    216251         id="id"
    217252        clazz="uniquecol"
     
    233268        show="<%=ownable ? "auto" : "never"%>"
    234269      />
     270     
    235271      <tbl:columndef
    236272        id="description"
     
    453489            Removable removableItem = null;
    454490            AnnotationSet annotationSet = null;
     491            Registered registeredItem = null;
     492           
    455493            while (members.hasNext())
    456494            {
     
    459497              removableItem = removable ? (Removable)item : null;
    460498              annotationSet = annotatable && ((Annotatable)item).isAnnotated() ? ((Annotatable)item).getAnnotationSet() : null;
     499              registeredItem = registered ? (Registered)item : null;
    461500             
    462501              int itemId = item.getId();
     
    518557                  tabindex="0"
    519558                  title="<%=tooltip%>"><%=name%></div></tbl:cell>
     559                <tbl:cell column="itemSubtype"><base:propertyvalue
     560                    item="<%=item%>"
     561                    property="itemSubtype"
     562                    enableEditLink="<%=mode.hasEditLink()%>"
     563                    enablePropertyLink="<%=mode.hasPropertyLink()%>"
     564                  /></tbl:cell>
     565                <tbl:cell column="entryDate" value="<%=registeredItem != null ? registeredItem.getEntryDate() : null%>" />
    520566                <tbl:cell column="id"><%=item.getId()%></tbl:cell>
    521567                <tbl:cell column="owner"
     
    549595                }
    550596                %>
    551                
    552597                <tbl:cell column="permission"><%=PermissionUtil.getShortPermissions(item)%></tbl:cell>
    553598                <tbl:cell column="sharedTo">
Note: See TracChangeset for help on using the changeset viewer.