if (alias==null) {
alias = info.getName();
}
String key = group+"."+alias;
getLogger().info("Adding static APP key "+key);
Restlet app = makeApp(info,host.allowQueries(),host.allowEditClient(),key);
apps.put(key,app);
}
vhost.attach("/{group}/{alias}",new Restlet() {
public void handle(Request request, Response response) {
try {
String rgroup = request.getAttributes().get("group").toString();
String ralias = request.getAttributes().get("alias").toString();
String rkey = rgroup+"."+ralias;
Restlet restlet = apps.get(rkey);
if (restlet==null) {
for (DBInfo info : autodbList.values()) {
if (checkNames && !host.getDatabases().contains(info.getName())) {
continue;
}
String group = info.getGroup();
String alias = info.getAlias();
if (group==null) {
continue;
}
if (alias==null) {
alias = info.getName();
}
String key = group+"."+alias;
Restlet app = makeApp(info,host.allowQueries(),host.allowEditClient(),key);
getLogger().info("Adding dynamic APP key "+key);
apps.put(key,app);
restlet = app;
}
}