- TimeTaken tt = trans.start("Execute AAFCLI", Env.REMOTE);
- try {
- TaggedPrincipal p = trans.getUserPrincipal();
- // Access needs to be set after overall construction. Thus, the lazy create.
- AAFcli aafcli;
- AAFConHttp aafcon = gui.aafCon();
- aafcli= new AAFcli(gui.access,gui.env, pw,
- aafcon.hman(),
- aafcon.securityInfo(),
- new HTransferSS(p,AAF_GUI.app,
- aafcon.securityInfo()));
- aafcli.verbose(false);
- aafcli.gui(true);
+ String cmdStr = cmd.toString();
+ if (cmdStr.contains("--help")) {
+ cmdStr = cmdStr.replaceAll("--help", "help");
+ }
+ if (cmdStr.contains("--version")) {
+ cmdStr = cmdStr.replaceAll("--version", "version");
+ }
+ try {
+ aafcli.eval(cmdStr);
+ if(userPerm.matcher(cmdStr).matches()) {
+ trans.clearCache();
+ Cookie cookie = new Cookie(Page.AAF_THEME,trans.getProperty(Page.AAF_THEME));
+ cookie.setMaxAge(-1);
+ cookie.setComment("Remove AAF GUI Theme");
+ trans.hresp().addCookie(cookie);
+ }
+ pw.flush();
+ } catch (Exception e) {
+ pw.flush();
+ trans.error().log("Error", e.getMessage());
+ } finally {
+ aafcli.close();
+ }
+ } finally {
+ tt.done();
+ }