NIHVIVO-2279 User a hard-coded namespace for permission set URIs.
This commit is contained in:
parent
984162bffe
commit
8a4060cdb7
1 changed files with 3 additions and 5 deletions
|
@ -45,7 +45,7 @@ public class PermissionSetsLoader implements ServletContextListener {
|
||||||
OntModel model = ModelContext.getBaseOntModelSelector(ctx)
|
OntModel model = ModelContext.getBaseOntModelSelector(ctx)
|
||||||
.getUserAccountsModel();
|
.getUserAccountsModel();
|
||||||
|
|
||||||
ModelWrapper wrapper = new ModelWrapper(model, ns);
|
ModelWrapper wrapper = new ModelWrapper(model);
|
||||||
wrapper.createPermissionSet("1", "Self Editor");
|
wrapper.createPermissionSet("1", "Self Editor");
|
||||||
wrapper.createPermissionSet("2", "Editor");
|
wrapper.createPermissionSet("2", "Editor");
|
||||||
wrapper.createPermissionSet("3", "Curator");
|
wrapper.createPermissionSet("3", "Curator");
|
||||||
|
@ -64,15 +64,13 @@ public class PermissionSetsLoader implements ServletContextListener {
|
||||||
|
|
||||||
private static class ModelWrapper {
|
private static class ModelWrapper {
|
||||||
private final OntModel model;
|
private final OntModel model;
|
||||||
private final String defaultNamespace;
|
|
||||||
|
|
||||||
private final Property typeProperty;
|
private final Property typeProperty;
|
||||||
private final Property labelProperty;
|
private final Property labelProperty;
|
||||||
private final Resource permissionSet;
|
private final Resource permissionSet;
|
||||||
|
|
||||||
public ModelWrapper(OntModel model, String defaultNamespace) {
|
public ModelWrapper(OntModel model) {
|
||||||
this.model = model;
|
this.model = model;
|
||||||
this.defaultNamespace = defaultNamespace;
|
|
||||||
|
|
||||||
typeProperty = model.createProperty(VitroVocabulary.RDF_TYPE);
|
typeProperty = model.createProperty(VitroVocabulary.RDF_TYPE);
|
||||||
labelProperty = model.createProperty(VitroVocabulary.LABEL);
|
labelProperty = model.createProperty(VitroVocabulary.LABEL);
|
||||||
|
@ -80,7 +78,7 @@ public class PermissionSetsLoader implements ServletContextListener {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void createPermissionSet(String uriSuffix, String label) {
|
public void createPermissionSet(String uriSuffix, String label) {
|
||||||
String uri = defaultNamespace + "permissionSet-" + uriSuffix;
|
String uri = "http://permissionSet-" + uriSuffix;
|
||||||
|
|
||||||
model.enterCriticalSection(Lock.WRITE);
|
model.enterCriticalSection(Lock.WRITE);
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue