* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
public static final String AAF_URL_CADI_HELP = "aaf_url.cadi_help";
public static final String PERM_CA_TYPE = "certman";
public static final String PERM_NS = Define.ROOT_NS();
public static final String AAF_URL_CADI_HELP = "aaf_url.cadi_help";
public static final String PERM_CA_TYPE = "certman";
public static final String PERM_NS = Define.ROOT_NS();
- public static enum BROWSER {iPhone,html5,ie,ieOld};
+ public enum BROWSER {IPHONE, HTML5, IE, IEOLD};
public static final int MAX_LINE = 20;
protected static final String[] NO_FIELDS = new String[0];
private static final String BROWSER_TYPE = "BROWSER_TYPE";
public static final int MAX_LINE = 20;
protected static final String[] NO_FIELDS = new String[0];
private static final String BROWSER_TYPE = "BROWSER_TYPE";
{"ns","My Namespaces","/gui/ns"},
{"approve","My Approvals","/gui/approve"},
{"myrequests","My Pending Requests","/gui/myrequests"},
{"ns","My Namespaces","/gui/ns"},
{"approve","My Approvals","/gui/approve"},
{"myrequests","My Pending Requests","/gui/myrequests"},
{"passwd","Password Management","/gui/passwd"},
{"cui","Command Prompt","/gui/cui"},
{"api","AAF API","/gui/api"},
{"passwd","Password Management","/gui/passwd"},
{"cui","Command Prompt","/gui/cui"},
{"api","AAF API","/gui/api"},
public Page(AuthzEnv env, String name, String url, Enum<?>[] en, final NamedCode ...content) throws APIException, IOException {
super(CacheGen.PRETTY, new PageCode(env, 1, content));
fields = new String[en.length];
public Page(AuthzEnv env, String name, String url, Enum<?>[] en, final NamedCode ...content) throws APIException, IOException {
super(CacheGen.PRETTY, new PageCode(env, 1, content));
fields = new String[en.length];
}
public Page(AuthzEnv env, String name, String url, String [] fields, final NamedCode ... content) throws APIException,IOException {
this(env,name,url,1,fields,content);
}
}
public Page(AuthzEnv env, String name, String url, String [] fields, final NamedCode ... content) throws APIException,IOException {
this(env,name,url,1,fields,content);
}
public Page(AuthzEnv env, String name, String url, int backdots, String [] fields, final NamedCode ... content) throws APIException,IOException {
super(CacheGen.PRETTY, new PageCode(env, backdots, content));
if (fields==null) {
public Page(AuthzEnv env, String name, String url, int backdots, String [] fields, final NamedCode ... content) throws APIException,IOException {
super(CacheGen.PRETTY, new PageCode(env, backdots, content));
if (fields==null) {
private static class PageCode implements Code<HTMLGen> {
private static final String AAF_GUI_THEME = "aaf.gui.theme";
private static final String AAF_GUI_TITLE = "aaf_gui_title";
private static class PageCode implements Code<HTMLGen> {
private static final String AAF_GUI_THEME = "aaf.gui.theme";
private static final String AAF_GUI_TITLE = "aaf_gui_title";
private final ContentCode[] content;
private final Slot browserSlot;
private final int backdots;
private final ContentCode[] content;
private final Slot browserSlot;
private final int backdots;
props = new Properties();
themeProps.put(t.getName(), props);
}
props = new Properties();
themeProps.put(t.getName(), props);
}
protected Imports getImports(Env env, String theme, int backdots, BROWSER browser) {
List<String> ls = getThemeFiles(env,theme);
Imports imp = new Imports(backdots);
protected Imports getImports(Env env, String theme, int backdots, BROWSER browser) {
List<String> ls = getThemeFiles(env,theme);
Imports imp = new Imports(backdots);
- // Note: I found that App Storage saves everything about the page, or not. Thus, if you declare the page uncacheable, none of the
+ // Note: I found that App Storage saves everything about the page, or not. Thus, if you declare the page uncacheable, none of the
// Artifacts, like JPGs are stored, which makes this feature useless for Server driven elements
cache.dynamic(hgen, new DynamicCode<HTMLGen,AAF_GUI,AuthzTrans>() {
@Override
public void code(AAF_GUI state, AuthzTrans trans, final Cache<HTMLGen> cache, final HTMLGen hgen) throws APIException, IOException {
switch(browser(trans,browserSlot)) {
// Artifacts, like JPGs are stored, which makes this feature useless for Server driven elements
cache.dynamic(hgen, new DynamicCode<HTMLGen,AAF_GUI,AuthzTrans>() {
@Override
public void code(AAF_GUI state, AuthzTrans trans, final Cache<HTMLGen> cache, final HTMLGen hgen) throws APIException, IOException {
switch(browser(trans,browserSlot)) {
hgen.directive("!DOCTYPE html");
hgen.directive("meta", "http-equiv=X-UA-Compatible","content=IE=11");
default:
hgen.directive("!DOCTYPE html");
hgen.directive("meta", "http-equiv=X-UA-Compatible","content=IE=11");
default:
Mark head = hgen.head();
hgen.leaf(TITLE).text(title).end();
cache.dynamic(hgen, new DynamicCode<HTMLGen,AAF_GUI,AuthzTrans>() {
@Override
public void code(AAF_GUI state, AuthzTrans trans, final Cache<HTMLGen> cache, final HTMLGen hgen) throws APIException, IOException {
Mark head = hgen.head();
hgen.leaf(TITLE).text(title).end();
cache.dynamic(hgen, new DynamicCode<HTMLGen,AAF_GUI,AuthzTrans>() {
@Override
public void code(AAF_GUI state, AuthzTrans trans, final Cache<HTMLGen> cache, final HTMLGen hgen) throws APIException, IOException {
if(theme==null) {
for(String t : themes.keySet()) {
if(!t.equals(defaultTheme) && trans.fish(new AAFPermission(null,trans.user()+":id", AAF_GUI_THEME, t))) {
if(theme==null) {
for(String t : themes.keySet()) {
if(!t.equals(defaultTheme) && trans.fish(new AAFPermission(null,trans.user()+":id", AAF_GUI_THEME, t))) {
}
Cookie cookie = new Cookie(AAF_GUI_THEME,theme);
cookie.setMaxAge(604_800); // one week
}
Cookie cookie = new Cookie(AAF_GUI_THEME,theme);
cookie.setMaxAge(604_800); // one week
hgen.imports(getImports(env,theme,backdots,browser));
switch(browser) {
hgen.imports(getImports(env,theme,backdots,browser));
switch(browser) {
Mark body = hgen.body();
Mark header = hgen.header();
cache.dynamic(hgen, new DynamicCode<HTMLGen,AAF_GUI,AuthzTrans>() {
Mark body = hgen.body();
Mark header = hgen.header();
cache.dynamic(hgen, new DynamicCode<HTMLGen,AAF_GUI,AuthzTrans>() {
String env = trans.getProperty(Config.AAF_ENV,"N/A");
xgen.leaf(H1).text(title + " on " + env).end();
xgen.leaf("p","id=version").text("AAF Version: " + state.deployedVersion).end();
String env = trans.getProperty(Config.AAF_ENV,"N/A");
xgen.leaf(H1).text(title + " on " + env).end();
xgen.leaf("p","id=version").text("AAF Version: " + state.deployedVersion).end();
// Obtain User Info, and print
TaggedPrincipal p = trans.getUserPrincipal();
// Obtain User Info, and print
TaggedPrincipal p = trans.getUserPrincipal();
+ " does not support all HTML5 standards. Old, non TSS-Standard versions may not function correctly.").br()
.text(" For best results, use a highly compliant HTML5 browser like Firefox.")
.end();
+ " does not support all HTML5 standards. Old, non TSS-Standard versions may not function correctly.").br()
.text(" For best results, use a highly compliant HTML5 browser like Firefox.")
.end();
cache.dynamic(hgen, new DynamicCode<HTMLGen,AAF_GUI,AuthzTrans>() {
@Override
public void code(AAF_GUI state, AuthzTrans trans,Cache<HTMLGen> cache, HTMLGen xgen) throws APIException, IOException {
cache.dynamic(hgen, new DynamicCode<HTMLGen,AAF_GUI,AuthzTrans>() {
@Override
public void code(AAF_GUI state, AuthzTrans trans,Cache<HTMLGen> cache, HTMLGen xgen) throws APIException, IOException {
if(props!=null && "TRUE".equalsIgnoreCase(props.getProperty("enable_nav_btn"))) {
xgen.leaf("button", "id=navBtn").end();
}
if(props!=null && "TRUE".equalsIgnoreCase(props.getProperty("enable_nav_btn"))) {
xgen.leaf("button", "id=navBtn").end();
}
xgen.incr("h2").text("Navigation").end();
Mark mark = new Mark();
boolean selected = isSelected(trans.path(),Home.HREF);
xgen.incr("h2").text("Navigation").end();
Mark mark = new Mark();
boolean selected = isSelected(trans.path(),Home.HREF);
xgen.incr(mark,HTMLGen.UL)
.incr(HTMLGen.LI,selected?"class=selected":"")
.incr(HTMLGen.A, "href=home")
xgen.incr(mark,HTMLGen.UL)
.incr(HTMLGen.LI,selected?"class=selected":"")
.incr(HTMLGen.A, "href=home")
- String aaf_help = env.getProperty(AAF_URL_AAF_HELP,null);
- if (aaf_help!=null) {
- hgen.leaf(LI).leaf(A,"href="+env.getProperty(AAF_URL_AAF_HELP),"target=_blank").text("AAF WIKI").end(2);
+ String aafHelp = env.getProperty(AAF_URL_AAF_HELP,null);
+ if (aafHelp!=null) {
+ hgen.leaf(LI).leaf(A,HREF+env.getProperty(AAF_URL_AAF_HELP),TARGET_BLANK).text("AAF WIKI").end(2);
String sub = env.getProperty(AAF_URL_AAF_HELP+".sub");
if (sub!=null) {
hgen.incr(UL,"style=margin-left:5%");
for (String s : Split.splitTrim(',', sub)) {
String sub = env.getProperty(AAF_URL_AAF_HELP+".sub");
if (sub!=null) {
hgen.incr(UL,"style=margin-left:5%");
for (String s : Split.splitTrim(',', sub)) {
- hgen.leaf(LI).leaf(A,"href="+env.getProperty(AAF_URL_AAF_HELP+".sub."+s),"target=_blank").text(s.replace('+', ' ')).end(2);
+ hgen.leaf(LI).leaf(A,HREF+env.getProperty(AAF_URL_AAF_HELP+".sub."+s),TARGET_BLANK).text(s.replace('+', ' ')).end(2);
- aaf_help = env.getProperty(AAF_URL_CADI_HELP,null);
- if (aaf_help!=null) {
- hgen.leaf(LI).leaf(A,"href="+aaf_help,"target=_blank").text("CADI WIKI").end(2);
+ aafHelp = env.getProperty(AAF_URL_CADI_HELP,null);
+ if (aafHelp!=null) {
+ hgen.leaf(LI).leaf(A,HREF+aafHelp,TARGET_BLANK).text("CADI WIKI").end(2);
.leaf(HTMLGen.H3).text("Related Tools").end();
for (String tool : Split.splitTrim(',',tools)) {
.leaf(HTMLGen.H3).text("Related Tools").end();
for (String tool : Split.splitTrim(',',tools)) {
- hgen.leaf(LI).leaf(A,"href="+env.getProperty(AAF_URL_TOOL_DOT+tool),"target=_blank").text(tool.replace('+', ' ')).end(2);
+ hgen.leaf(LI).leaf(A,HREF+env.getProperty(AAF_URL_TOOL_DOT+tool),TARGET_BLANK).text(tool.replace('+', ' ')).end(2);
hgen.end(nav);
// Footer - Using older Footer to work with decrepit IE versions
Mark footer = hgen.divID("footer");
hgen.textCR(1, env.getProperty(AAF_GUI.AAF_GUI_COPYRIGHT))
.end(footer);
hgen.end(nav);
// Footer - Using older Footer to work with decrepit IE versions
Mark footer = hgen.divID("footer");
hgen.textCR(1, env.getProperty(AAF_GUI.AAF_GUI_COPYRIGHT))
.end(footer);
BROWSER br = trans.get(slot, null);
if (br==null) {
String agent = trans.agent();
BROWSER br = trans.get(slot, null);
if (br==null) {
String agent = trans.agent();