Document settings = settingsView.getFirstDocument();
if (null == settings) {
settingsView.recycle();
XSPContext context = (XSPContext) resolveVariable("context");
UIViewRootEx2 view = (UIViewRootEx2) resolveVariable("view");
if (!view.getPageName().equals("/admin.xsp")) {
System.out.println("mypic: invalid configuration - " + view.getPageName());
validConfig = false;
context.redirectToPage("/admin.xsp");
}
} else {
SaveUrlInNab = settings.getItemValueString("saveMypicURLToNab");
EnableProfiles = settings.getItemValueString("enableProfiles");
StoreProfilesInNab = settings.getItemValueString("saveProfileToNab");
NabServer = settings.getItemValueString("nabServer");
NabFilePath = settings.getItemValueString("nabFilePath");
ShowApiInNav = settings.getItemValueString("enableAPIPage");
DefaultFormat = settings.getItemValueString("defaultFormat");
DefaultSize = settings.getItemValueString("defaultSize");
if (DefaultSize.trim().compareTo("") == 0) {
DefaultSize = "50";
}
if (DefaultFormat.trim().compareTo("") == 0) {
DefaultFormat = "png";
}
if ((SaveUrlInNab.equals("Yes") || StoreProfilesInNab.equals("Yes")) && (NabServer.isEmpty() || NabFilePath.isEmpty())) {
Messages.clear();
Messages.add("To save mypic URLs or Profile information to a Names and address book, "
+ "the NAB Server and File Path must be specified.");
UIViewRootEx2 view = (UIViewRootEx2) resolveVariable("view");
if (!view.getPageName().equals("/admin.xsp")) {
XSPContext context = (XSPContext) resolveVariable("context");
validConfig = false;
context.redirectToPage("/admin.xsp");
}
}
settings.recycle();