Skip to content

Commit dbc57d9

Browse files
some XML schema pointers
1 parent 66e24b8 commit dbc57d9

1 file changed

Lines changed: 47 additions & 0 deletions

File tree

module-development/file-based/CLAUDE.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,53 @@ ORDER BY DisplayName
263263
</query>
264264
```
265265
266+
## XML Schema Reference
267+
268+
LabKey modules use various XML configuration files with specific schemas. When creating these files, always consult the official schema documentation for complete element and attribute references.
269+
270+
**Official Schema Documentation**: https://www.labkey.org/download/schema-docs/xml-schemas/
271+
272+
### Common XML File Types
273+
274+
| File Type | Purpose | Root Element | Namespace | Location |
275+
|-----------|---------|--------------|-----------|----------|
276+
| `.query.xml` | Query metadata (columns, validators, FKs) | `<query>` | `http://labkey.org/data/xml/query` | `resources/queries/[schema]/[query].query.xml` |
277+
| `.qview.xml` | Custom query views (filters, sorts) | `<cv:customView>` | `http://labkey.org/data/xml/queryCustomView` | `resources/queries/[schema]/[query]/[view].qview.xml` |
278+
| `.webpart.xml` | Web part configuration | `<webpart>` | `http://labkey.org/data/xml/webpart` | `resources/views/[view].webpart.xml` |
279+
| `.view.xml` | View with dependencies | `<view>` | `http://labkey.org/data/xml/view` | `resources/views/[view].view.xml` |
280+
| `.report.xml` | Report definitions (R, JS, etc.) | `<ReportDescriptor>` | `http://labkey.org/query/xml` | `resources/reports/schemas/[schema]/[query]/[report].report.xml` |
281+
| `.folderType.xml` | Custom folder types | `<ft:folderType>` | `http://labkey.org/data/xml/folderType` | `resources/folderTypes/[name].folderType.xml` |
282+
| `.task.xml` | Pipeline task definitions | `<task>` | `http://labkey.org/pipeline/xml` | `resources/pipeline/tasks/[task].task.xml` |
283+
| `.pipeline.xml` | Pipeline definitions | `<pipeline>` | `http://labkey.org/pipeline/xml` | `resources/pipeline/pipelines/[pipeline].pipeline.xml` |
284+
| `.template.xml` | Domain templates (Lists, DataClasses, SampleSets) | `<templates>` | `http://labkey.org/data/xml/domainTemplate` | `resources/domain-templates/[template].template.xml` |
285+
286+
### Finding Examples
287+
288+
Real-world examples of these XML files can be found in the LabKey testAutomation modules: https://github.com/LabKey/testAutomation/tree/develop/modules
289+
290+
Browse specific modules for examples:
291+
- **simpletest**: Basic queries, views, web parts, folder types
292+
- **scriptpad**: Reports and R scripts
293+
- **pipelinetest2**: Pipeline tasks and definitions
294+
- **editableModule**: Editable grid queries
295+
- **linkedschematest**: Schema templates and linked queries
296+
297+
### Key Points
298+
299+
- **Query metadata** (`.query.xml`) often uses two namespaces: the primary `query` namespace for the root element and the `data/xml` namespace for the `<tables>` element
300+
- **Report descriptors** (`.report.xml`) use two namespaces: `http://labkey.org/query/xml` for the main descriptor and `http://labkey.org/data/xml/reportProps` (prefix `rep:`) for properties
301+
- **Domain templates** (`.template.xml`) use `xsi:type` to specify template types: `ListTemplateType`, `DataClassTemplateType`, `SampleSetTemplateType`
302+
- **Pipeline tasks** (`.task.xml`) use `xsi:type` to specify task types: `ScriptTaskType`, `JavaTaskType`, `CommandTaskType`
303+
- **View files** (`.view.xml`) are used when you need to declare JavaScript/CSS dependencies; simple web parts only need `.webpart.xml`
304+
305+
### Typical Workflow
306+
307+
1. Create the primary resource file (`.sql`, `.html`, `.r`, etc.)
308+
2. Add the corresponding XML configuration file if needed
309+
3. Reference the online schema documentation for available elements and attributes
310+
4. Look at examples in the testAutomation modules on GitHub for real patterns
311+
5. Test your changes (most XML updates don't require server restart)
312+
266313
## Deployment and Testing
267314
268315
### Location

0 commit comments

Comments
 (0)