Skip to content

Commit f67988f

Browse files
committed
ValidateDomainAndFieldNamesAction to use domainKind generateDomainURI() when applicable
1 parent 1bd6621 commit f67988f

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

experiment/src/org/labkey/experiment/controllers/property/PropertyController.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -521,8 +521,13 @@ public Object execute(DomainApiForm form, BindException errors)
521521
DomainKind kind = PropertyService.get().getDomainKindByName(kindName);
522522
if (kind == null)
523523
throw new IllegalArgumentException("No domain kind matches name '" + kindName + "'");
524-
String typeURI = "urn:lsid:labkey.com:" + kindName + ".Folder-1000.1001:1002"; // note using a fake lsid here, since not all domain kinds override generateDomainURI
525-
Domain domain = PropertyService.get().createDomain(getContainer(), typeURI, "test");
524+
525+
// try using the DomainKind to generate a domain URI, if it supports it. default to using a fake / representative URI
526+
String typeURI = kind.generateDomainURI("schemaName", "queryName", getContainer(), getUser());
527+
if (typeURI == null)
528+
typeURI = "urn:lsid:labkey.com:" + kindName + ".Folder-21085:Test+Domain+Name-115c61b7-4faa-103e-8e7f-a47ad552213c";
529+
530+
Domain domain = PropertyService.get().createDomain(getContainer(), typeURI, "queryName");
526531

527532
boolean checkFieldNames = !domainDesign.getFields().isEmpty();
528533
boolean checkDomainName = domainDesign.getName() != null;

0 commit comments

Comments
 (0)