Including new tables in forms

I have always been unclear on how to get the xml for a new table e.g. Determiners, so that we can include it in our discipline form.

I have tried looking at all the forms that are currently associated with our database, but have been unable to find ‘Determiners’ in any of them.

Is there any guidance available on how to do this?

Thanks

@rdrinkwater Determiners is not a table. It displays as a query combo box on the determination form and is linked to the agent table. All agents are formatted the same way through the XML. You should be looking for the agent table in the XML in order to make any changes but those changes will be for ALL agent linkages - catalogers, collectors, accession agents, etc.

@AndyBentley Thanks for the clarification.

Hi @rdrinkwater,

You can add Determiners to the form by following this tutorial:

The process is the same as any other table. You need to copy both the <view> and <viewdef> components from either the for the new view you would like to modify and add that to your form definition in your database.


Additionally, if you want to migrate all of your existing determiners to the new table, you can use this guide to do so:

As of 6.8.02, Determiner is a new table that was added for the purpose of storing multiple determiners

oh $%#$. Forgot about that. So, there should be an XML table for determiners in the common.views.xml. If you want to change it, you will need to copy it over to your discipline specific view. You will need the view for determiner and determiners:

    <view name="Determiner"
          class="edu.ku.brc.specify.datamodel.Determiner"
          busrules="edu.ku.brc.specify.datamodel.busrules.DeterminerBusRules"
    >
        <desc><![CDATA[The Determiners Form.]]></desc>
        <altviews>
            <altview name="Determiner View" viewdef="Determiner" mode="view" validated="false" default="true"/>
            <altview name="Determiner Edit" viewdef="Determiner" mode="edit" validated="true"/>
        </altviews>
    </view>

    <view name="Determiners"
          class="edu.ku.brc.specify.datamodel.Determiner"
          busrules="edu.ku.brc.specify.datamodel.busrules.DeterminerBusRules"
    >
        <desc><![CDATA[The Determiners Subform.]]></desc>
        <altviews>
            <!-- <altview name="Determiners Icon View"  viewdef="DeterminersIconView" mode="view"/>
            <altview name="Determiners Icon Edit"  viewdef="DeterminersIconView" mode="edit"/>  -->
            <altview name="Determiners Table View" viewdef="Determiners Table"   mode="view"/>
            <altview name="Determiners Table Edit" viewdef="Determiners Table"   mode="edit" default="true"/>
        </altviews>
    </view>

and the view_def for determiner, determiners and associated views

    <viewdef
            type="form"
            name="Determiner"
            class="edu.ku.brc.specify.datamodel.Determiner"
            gettable="edu.ku.brc.af.ui.forms.DataGetterForObj"
            settable="edu.ku.brc.af.ui.forms.DataSetterForObj">
        <desc><![CDATA[The Determiner form.]]></desc>
        <enableRules/>

        <columnDef>105px,2px,210px,5px,100px,2px,98px,300px,p:g</columnDef>
        <columnDef os="lnx">135px,2px,230px,5px,120px,2px,118px,325px,p:g</columnDef>
        <columnDef os="mac">130px,2px,215px,5px,140px,2px,138px,395px,p:g</columnDef>
        <columnDef os="exp">p,2px,p:g,5px:g,p,2px,p:g,p:g(2),p:g</columnDef>
        <rowDef>p,2dlu,p:g,2dlu,p:g</rowDef>

        <rows>
            <row>
                <cell type="label" labelfor="1"/>
                <cell type="field" id="1" name="agent" uitype="querycbx" initialize="name=Agent;title=Agent"/>
            </row>
            <row>
                <cell type="label" labelfor="3"/>
                <cell type="field" id="3" name="remarks" uitype="textareabrief" rows="2" colspan="6"/>
            </row>
            <!--<row>
                <cell type="label" labelfor="9"/>
                <cell type="field" id="9" name="createdByAgent" uitype="label" readonly="true"  uifieldformatter="Agent"/>
                <cell type="label" labelfor="10"/>
                <cell type="field" id="10" name="modifiedByAgent" uitype="label" readonly="true"  uifieldformatter="Agent"/>
                <cell type="label" id="divLabel" label=" " initialize="align=right"/>
                <cell type="field" id="4" name="divisionCBX" uitype="combobox" ignore="true"/>
            </row>
            <row>
            	<cell type="field" id="34" uitype="checkbox" name="isPrimary"/>                	
            </row>
            <row>
                <cell type="label" labelfor="11"/>
                <cell type="field" id="11" name="timestampModified" uitype="label" readonly="true"/>
                <cell type="label" labelfor="12"/>
                <cell type="field" id="12" name="timestampCreated" uitype="label" readonly="true"/>
            </row>-->
        </rows>
    </viewdef>

    <viewdef
            type="formtable"
            name="Determiners Table"
            class="edu.ku.brc.specify.datamodel.Determiner"
            gettable="edu.ku.brc.af.ui.forms.DataGetterForObj"
            settable="edu.ku.brc.af.ui.forms.DataSetterForObj">
        <desc><![CDATA[Determiners grid view for Determination form.]]></desc>
        <definition>Determiners</definition>
    </viewdef>

    <viewdef
            type="iconview"
            name="DeterminersIconView"
            class="edu.ku.brc.specify.datamodel.Determiner"
            gettable="edu.ku.brc.af.ui.forms.DataGetterForObj"
            settable="edu.ku.brc.af.ui.forms.DataSetterForObj">
        <desc><![CDATA[The Determiners Icon Viewer]]></desc>
    </viewdef>

    <viewdef
            type="form"
            name="Determiners"
            class="edu.ku.brc.specify.datamodel.Determiner"
            gettable="edu.ku.brc.af.ui.forms.DataGetterForObj"
            settable="edu.ku.brc.af.ui.forms.DataSetterForObj">
        <desc><![CDATA[The Determiners form - UNKNOWN use in database.]]></desc>
        <enableRules/>

        <columnDef>p,5dlu,p:g,5dlu,p</columnDef>
        <rowDef auto="true" cell="p" sep="2px"/>

        <rows>
            <row>
                <cell type="label" labelfor="3"/>
                <cell type="field" id="3" name="agent.lastName" uitype="text" colspan="3"/>
            </row>
            <row>
                <cell type="label" labelfor="5"/>
                <cell type="field" id="5" name="agent.firstName" uitype="text" colspan="3"/>
            </row>
            <row>
                <cell type="label" labelfor="7"/>
                <cell type="field" id="7" name="remarks" uitype="text" colspan="3"/>
            </row>
        </rows>
    </viewdef>