parse error for result.xml domain in file based module

LabKey Support Forum (Inactive)
parse error for result.xml domain in file based module Anthony Corbett  2013-03-14 14:32
Status: Closed
 
I'm getting the following parse error when creating a new assay design from a custom file-based assay. It is stating that it isn't expecting the RangeURI element inside the PropertyDescriptor... though this element looks to be in the definition in the schema docs.

Unable to load assay template: 500 There was an error processing the request.
Unable to parse [GelCard]assay/gelcard/domains/result.xml: error:
cvc-complex-type.2.4a: Expected elements '
SearchTerms@http://cpas.fhcrc.org/exp/xml
SemanticType@http://cpas.fhcrc.org/exp/xml
Format@http://cpas.fhcrc.org/exp/xml
URL@http://cpas.fhcrc.org/exp/xml
FK@http://cpas.fhcrc.org/exp/xml
ImportAliases@http://cpas.fhcrc.org/exp/xml
MvEnabled@http://cpas.fhcrc.org/exp/xml
DefaultType@http://cpas.fhcrc.org/exp/xml
DefaultValue@http://cpas.fhcrc.org/exp/xml
PropertyValidator@http://cpas.fhcrc.org/exp/xml
ConditionalFormats@http://cpas.fhcrc.org/exp/xml' instead of 'RangeURI@http://cpas.fhcrc.org/exp/xml' here in element PropertyDescriptor@http://cpas.fhcrc.org/exp/xml

Attached is the result.xml file I'm using.
 
 
jeckels responded:  2013-03-14 14:50
Hi Anthony,

This may be an XML ordering issue. Can you try putting the <RangeURI> before the <Label>?

Thanks,
Josh
 
Anthony Corbett responded:  2013-03-14 16:33
Yup, that was it; I had to move Label and RangeURI. Thanks!

I didn't even think to look at the PropertyDescriptorType declaration to see the sequence in the complexType declaration. Is Labkey planning to move to XSD 1.1? It lifts the restriction of minOccurs="0" and maxOccurs="1" for the xs:all group element. I'm sure the restrictive sequence trips up a lot of people. :)

Thanks again!

-
Anthony
 
Anthony Corbett responded:  2013-03-14 16:52
While on the subject of defining domains in file-based modules, I have one more question. In the originally attached result.xml I would like the CellsUsed and ReactionPhase fields to be FK to a lookup. Is it possible to define lists in a file-based module? Or would I need to create a custom Schema for this module and write the DDL and DML statements to populate it in the module's SQL scripts? I would prefer to use lists, I don't want to restriction what the values can be and rather have the user of the assay define it as they wish.

I see in customeModules for idri visual assay's result.xml has some PropertyDescriptors with FK to list.Timepoints and lists.Temperature; however, I don't see where the list is defined in the idri module source. If the list doesn't exist does it create it?

Thanks,

Anthony
 
kevink responded:  2013-03-15 14:01
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;
}
 
Anthony Corbett responded:  2013-03-16 15:51

Thanks Kevin. I'll look into both options to determine which best fits use-case this file based assay best.