parse error for result.xml domain in file based module

LabKey Support Forum (Inactive)
parse error for result.xml domain in file based module kevink  2013-03-15 14:01
Status: Closed
 
Unfortunately, no, it's not possible to define lists in file-based modules yet. It's something we've been wanting to do, but it's a little tricky to deal with schema changes and attaching the list to containers.

There are two options to workaround this limitation:

1) Use a folder or list archive and manually import it into the target folder. This lets you manage the data and design in source control, but still allows you to modify the design once imported.

2) Use a file-based module with sql scripts as you suggest. To insert data, either use SQL DML scripts or create an initialize.html view that will populate a table using LABKEY.Query.insertRows().

If you use (2) and you'd like to allow admins to add/remove fields from the table, you can add an LSID column to your hard-table and make it a foreign key to the exp.Object.ObjectUri column in the schema.xml file. This will allow you to define a domain for the table much like a list. The domain is per-folder so different containers may have different sets of fields.

For an example of how to do this, check out the server/customModules/reagent module's reagent.xml file. If wires up the LSID lookup to the exp.Object.ObjectUri column and adds an "Edit Fields" button that opens the domain editor.

      <ns:column columnName="Lsid">
        <ns:datatype>lsidtype</ns:datatype>
        <ns:isReadOnly>true</ns:isReadOnly>
        <ns:isHidden>true</ns:isHidden>
        <ns:isUserEditable>false</ns:isUserEditable>
        <ns:isUnselectable>true</ns:isUnselectable>
        <ns:fk>
          <ns:fkColumnName>ObjectUri</ns:fkColumnName>
          <ns:fkTable>Object</ns:fkTable>
          <ns:fkDbSchema>exp</ns:fkDbSchema>
        </ns:fk>
      </ns:column>

function editDomain(queryName)
{
    var url = LABKEY.ActionURL.buildURL("property", "editDomain", null, {
        domainKind: "ExtensibleTable",
        createOrEdit: true,
        schemaName: "reagent",
        queryName: queryName
    });
    window.location = url;
}