}
private void printPageNotActive(HttpServletResponse response, VariablesSecureApp vars)
throws IOException, ServletException {
ActivationKey activationKey = new ActivationKey();
response.setContentType("text/html; charset=UTF-8");
String discard[] = { "", "" };
if (activationKey.isOPSInstance()) {
if (activationKey.hasExpired()) {
// Renew
discard[0] = "OPSActivate";
discard[1] = "OPSRefresh";
} else {
// Refresh
discard[0] = "OPSActivate";
discard[1] = "OPSRefresh";
}
} else {
// Activate
discard[0] = "OPSRefresh";
discard[1] = "OPSRenew";
}
final PrintWriter out = response.getWriter();
final XmlDocument xmlDocument = xmlEngine.readXmlTemplate(
"org/openbravo/erpCommon/ad_forms/InstanceManagementActivateOnline", discard)
.createXmlDocument();
xmlDocument.setParameter("directory", "var baseDirectory = \"" + strReplaceWith + "/\";\n");
xmlDocument.setParameter("language", "defaultLang=\"" + vars.getLanguage() + "\";");
// Interface parameters
final ToolBar toolbar = new ToolBar(this, vars.getLanguage(), "InstanceManagement", false, "",
"", "", false, "ad_forms", strReplaceWith, false, true);
toolbar.prepareSimpleToolBarTemplate();
xmlDocument.setParameter("toolbar", toolbar.toString());
try {
final WindowTabs tabs = new WindowTabs(this, vars,
"org.openbravo.erpCommon.ad_forms.InstanceManagement");
xmlDocument.setParameter("theme", vars.getTheme());
final NavigationBar nav = new NavigationBar(this, vars.getLanguage(),
"InstanceManagement.html", classInfo.id, classInfo.type, strReplaceWith, tabs
.breadcrumb());
xmlDocument.setParameter("navigationBar", nav.toString());
final LeftTabsBar lBar = new LeftTabsBar(this, vars.getLanguage(), "InstanceManagement.html",
strReplaceWith);
xmlDocument.setParameter("leftTabs", lBar.manualTemplate());
} catch (final Exception ex) {
throw new ServletException(ex);
}
// Message
{
final OBError myMessage = vars.getMessage("InstanceManagement");
vars.removeMessage("InstanceManagement");
if (myMessage != null) {
xmlDocument.setParameter("messageType", myMessage.getType());
xmlDocument.setParameter("messageTitle", myMessage.getTitle());
xmlDocument.setParameter("messageMessage", myMessage.getMessage());
}
}
// Purpose combo
try {
ComboTableData comboTableData = new ComboTableData(this, "LIST", "", "InstancePurpose", "",
Utility.getContext(this, vars, "#AccessibleOrgTree", "InstanceManagement"), Utility
.getContext(this, vars, "#User_Client", "InstanceManagement"), 0);
Utility.fillSQLParameters(this, vars, null, comboTableData, "InstanceManagement",
activationKey.isOPSInstance() ? activationKey.getProperty("purpose") : null);
xmlDocument.setData("reportPurpose", "liststructure", comboTableData.select(false));
comboTableData = null;
} catch (Exception ex) {
ex.printStackTrace();
throw new ServletException(ex);
}
if (activationKey.hasActivationKey()) {
xmlDocument.setParameter("publicKey", activationKey.getPublicKey());
}
if (activationKey.isOPSInstance()) {
xmlDocument.setParameter("paramSelPurpose", activationKey.getProperty("purpose"));
xmlDocument.setParameter("instanceNo", activationKey.getProperty("instanceno"));
}
out.println(xmlDocument.print());
out.close();
}