use of com.ibm.designer.runtime.domino.adapter.HttpService in project org.openntf.xsp.jakartaee by OpenNTF.
the class PostInstallFactory method getServices.
@Override
public HttpService[] getServices(LCDEnvironment env) {
System.out.println("postinstall start");
try {
Session session = NotesFactory.createSession();
try {
for (String nsfName : NSFS) {
Database database = session.getDatabase("", nsfName);
if (database == null || !database.isOpen()) {
throw new RuntimeException("Could not find " + nsfName);
}
ACL acl = database.getACL();
ACLEntry anon = acl.getEntry("Anonymous");
if (anon == null) {
anon = acl.createACLEntry("Anonymous", ACL.LEVEL_AUTHOR);
} else {
anon.setLevel(ACL.LEVEL_AUTHOR);
}
ACLEntry admin = acl.createACLEntry("CN=Jakarta EE Test/O=OpenNTFTest", ACL.LEVEL_MANAGER);
try {
admin.enableRole("[Admin]");
} catch (NotesException e) {
// Failing here is fine, in case the NSF doesn't have the role
}
acl.save();
database.getView("Persons");
session.sendConsoleCommand("", "load updall " + nsfName);
}
session.sendConsoleCommand("", "tell http osgi diag");
} finally {
session.recycle();
}
} catch (NotesException e) {
e.printStackTrace();
} finally {
System.out.println("Done with postinstall");
}
return new HttpService[0];
}
Aggregations