Hello, where can I find the XML code to add containers to my collection object form?
Hi @fergashl,
We will soon launch the Collection Object Group table with the initial release of the Geology discipline in the first quarter of this year. This new table will replace the current one as the recommended mechanism to group together collection objects!
Please note that the data in this table will never be automatically deleted. It will remain accessible for the foreseeable future, but we can discuss migrating the data together at some point!
Containers are only fully supported in Specify 6, but you can use the following XML code you to add to your Collection Object form is as follows:
In Specify 6
XML Lines to add to Collection Object View Definition
<row>
<cell type="panel" id="ContainerPanel" name="ContainerPanel" coldef="p" rowdef="p" colspan="11">
<rows>
<row>
<cell type="panel" id="CPInner" name="CPInner" coldef="p" rowdef="p">
<rows>
<row>
<cell type="field" id="ContainerPlugin" uitype="plugin" name="this" initialize="name=ContainerPlugin"/>
</row>
</rows>
</cell>
</row>
</rows>
</cell>
</row>
In Specify 7
It is not fully supported, and is deprecated in favor of the future Collection Object Groups system, scheduled for launch in Q1 2025.
XML Lines to add to Collection Object View Definition
<cell type="label" labelfor="container"/>
<cell type="field" id="container" name="container" uitype="querycbx" isrequired="false" colspan="3"/>
<cell type="label" labelfor="containerOwner"/>
<cell type="field" id="containerOwner" name="containerOwner" uitype="querycbx" isrequired="false" colspan="3"/>
XML View Definition for Container
<viewdef name="Container" class="edu.ku.brc.specify.datamodel.Container" type="form" gettable="edu.ku.brc.af.ui.forms.DataGetterForObj" settable="edu.ku.brc.af.ui.forms.DataSetterForObj" useresourcelabels="true">
<desc>Container Description</desc>
<enableRules/>
<columnDef>100px,2px,178px,5px,108px,2px,130px,5px,100px,2px,195px,0px,15px,p:g</columnDef>
<columnDef os="lnx">115px,2px,196px,2px,113px,2px,150px,2px,115px,5px,215px,0px,15px,p:g</columnDef>
<columnDef os="mac">130px,2px,216px,2px,133px,2px,170px,2px,135px,5px,235px,0px,15px,p:g</columnDef>
<columnDef os="exp">p,2px,p:g,2px,p:g(2),5px,p:g,2px,p:g(2),5px:g,p,2px,p:g,0px,p,p:g</columnDef>
<rowDef auto="true" cell="p" sep="2px"/>
<rows>
<row>
<cell type="label" labelfor="nm"/>
<cell type="field" id="nm" name="name" uitype="text" colspan="3"/>
<cell type="label" labelfor="parent"/>
<cell type="field" id="parent" name="parent" uitype="querycbx" initialize="name=Container;displaydlg=ContainerDisplay;searchdlg=ContainerSearch" colspan="3"/>
</row>
<row>
<cell type="label" labelfor="remarks"/>
<cell type="field" id="remarks" name="description" uitype="textareabrief" colspan="10"/>
</row>
<row>
<cell type="subview" id="collectionObject" name="collectionObjects" viewname="AccessionItems" initialize="addsearch=true;title=COLOBJ_IN_CONTR" defaulttype="table" colspan="13"/>
</row>
<row>
<cell type="subview" id="children" name="children" viewname="ContainerBriefTable" initialize="addsearch=true;title=SUBCONTAINERS" defaulttype="table" colspan="13"/>
</row>
</rows>
</viewdef>
You can use this XML to display data captured in the Container table in Specify 7, and to a limited extent, add and remove data from it.
Ah, for some reason I thought the containers were available already! I will wait until it is ready to go then!
Thanks,
Ashley