From 7c622a4e5714af8f83ce30022c970cc36c2ee597 Mon Sep 17 00:00:00 2001 From: Endi Sukma Dewata Date: Tue, 28 Aug 2012 14:14:54 -0500 Subject: Added common ROOT webapp. The current ROOT webapp will redirect users coming to the root URL path to the proper path of the subsystem's webapp. Since now a single Tomcat instance may have multiple subsystems, a new ROOT webapp has been added to present the user with a menu of all available webapps from all subsystems in the instance. Ticket #89 --- base/ca/shared/webapps/ca/WEB-INF/web.xml | 2 + base/common/CMakeLists.txt | 2 +- .../shared/webapps/ROOT/META-INF/context.xml | 27 +++ base/common/shared/webapps/ROOT/WEB-INF/web.xml | 25 +++ base/common/shared/webapps/ROOT/index.jsp | 209 +++++++++++++++++++++ base/deploy/src/scriptlets/instance_layout.py | 25 ++- base/deploy/src/scriptlets/pkiparser.py | 22 +-- base/deploy/src/scriptlets/slot_substitution.py | 8 - base/kra/shared/webapps/kra/WEB-INF/web.xml | 2 + base/ocsp/shared/webapps/ocsp/WEB-INF/web.xml | 2 + base/tks/shared/webapps/tks/WEB-INF/web.xml | 2 + 11 files changed, 289 insertions(+), 37 deletions(-) create mode 100644 base/common/shared/webapps/ROOT/META-INF/context.xml create mode 100644 base/common/shared/webapps/ROOT/WEB-INF/web.xml create mode 100644 base/common/shared/webapps/ROOT/index.jsp (limited to 'base') diff --git a/base/ca/shared/webapps/ca/WEB-INF/web.xml b/base/ca/shared/webapps/ca/WEB-INF/web.xml index af474872e..c1b2738c8 100644 --- a/base/ca/shared/webapps/ca/WEB-INF/web.xml +++ b/base/ca/shared/webapps/ca/WEB-INF/web.xml @@ -3,6 +3,8 @@ PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "file:///usr/share/pki/setup/web-app_2_3.dtd"> + Certificate Authority + csadmin-wizard com.netscape.cms.servlet.wizard.WizardServlet diff --git a/base/common/CMakeLists.txt b/base/common/CMakeLists.txt index f602ae943..1a308ebb9 100644 --- a/base/common/CMakeLists.txt +++ b/base/common/CMakeLists.txt @@ -33,7 +33,7 @@ install( DESTINATION ${DATA_INSTALL_DIR}/shared/ PATTERN - "lib/" EXCLUDE + "lib/*" EXCLUDE ) # install empty directories diff --git a/base/common/shared/webapps/ROOT/META-INF/context.xml b/base/common/shared/webapps/ROOT/META-INF/context.xml new file mode 100644 index 000000000..c29b4586e --- /dev/null +++ b/base/common/shared/webapps/ROOT/META-INF/context.xml @@ -0,0 +1,27 @@ + + + + + + + diff --git a/base/common/shared/webapps/ROOT/WEB-INF/web.xml b/base/common/shared/webapps/ROOT/WEB-INF/web.xml new file mode 100644 index 000000000..54e880610 --- /dev/null +++ b/base/common/shared/webapps/ROOT/WEB-INF/web.xml @@ -0,0 +1,25 @@ + + + + + + PKI + + diff --git a/base/common/shared/webapps/ROOT/index.jsp b/base/common/shared/webapps/ROOT/index.jsp new file mode 100644 index 000000000..f45272f54 --- /dev/null +++ b/base/common/shared/webapps/ROOT/index.jsp @@ -0,0 +1,209 @@ + + + + +Certificate System + + + + + + + + + + + +
+ +
+
+ +
+ - +
+ + +
+
+ +
+ + +
+ +<% + ServletContext caContext = getServletContext().getContext("/ca"); + String caName = caContext.getServletContextName(); + String caPath = caContext.getContextPath(); + if (!"".equals(caPath)) { +%> +

+ +<%= caName %> + +

+ + + + + +<% + if (request.isSecure()) { +%> + + + + + + +<% + } +%> +
+
  • + End Users Services +
  • +
  • + Agent Services +
  • +
  • + Admin Services +
  • + +
    + +<% + } + + ServletContext kraContext = getServletContext().getContext("/kra"); + String kraName = kraContext.getServletContextName(); + String kraPath = kraContext.getContextPath(); + if (!"".equals(kraPath) && request.isSecure()) { +%> +

    + +<%= kraName %> + +

    + + + + + + + + +
    +
  • + Agent Services +
  • +
  • + Admin Services +
  • + +
    + +<% + } + + ServletContext ocspContext = getServletContext().getContext("/ocsp"); + String ocspName = ocspContext.getServletContextName(); + String ocspPath = ocspContext.getContextPath(); + if (!"".equals(ocspPath) && request.isSecure()) { +%> +

    + +<%= ocspName %> + +

    + + + + + + + + +
    +
  • + Agent Services +
  • +
  • + Admin Services +
  • + +
    + +<% + } + + ServletContext tksContext = getServletContext().getContext("/tks"); + String tksName = tksContext.getServletContextName(); + String tksPath = tksContext.getContextPath(); + if (!"".equals(tksPath) && request.isSecure()) { +%> +

    + +<%= tksName %> + +

    + + + + + + + + +
    +
  • + Agent Services +
  • +
  • + Admin Services +
  • + +
    + +<% + } +%> + +
    + + + + + diff --git a/base/deploy/src/scriptlets/instance_layout.py b/base/deploy/src/scriptlets/instance_layout.py index 72ccad16a..245df5a5f 100644 --- a/base/deploy/src/scriptlets/instance_layout.py +++ b/base/deploy/src/scriptlets/instance_layout.py @@ -50,11 +50,6 @@ class PkiScriptlet(pkiscriptlet.AbstractBasePkiScriptlet): util.directory.create(master['pki_tomcat_common_lib_path']) util.directory.create(master['pki_tomcat_tmpdir_path']) util.directory.create(master['pki_tomcat_webapps_path']) - util.directory.create(master['pki_tomcat_webapps_root_path']) - util.directory.create(master['pki_tomcat_webapps_root_webinf_path']) - util.file.copy(master['pki_source_webapps_root_web_xml'], - master['pki_tomcat_webapps_root_webinf_web_xml'], - overwrite_flag=True) util.directory.create(master['pki_tomcat_webapps_common_path']) util.directory.copy( os.path.join( @@ -62,6 +57,15 @@ class PkiScriptlet(pkiscriptlet.AbstractBasePkiScriptlet): "common-ui"), master['pki_tomcat_webapps_common_path'], overwrite_flag=True) + util.directory.create(master['pki_tomcat_webapps_root_path']) + util.directory.copy( + os.path.join( + config.PKI_DEPLOYMENT_SOURCE_ROOT, + "shared", + "webapps", + "ROOT"), + master['pki_tomcat_webapps_root_path'], + overwrite_flag=True) util.directory.create(master['pki_tomcat_work_path']) util.directory.create(master['pki_tomcat_work_catalina_path']) util.directory.create(master['pki_tomcat_work_catalina_host_path']) @@ -168,11 +172,16 @@ class PkiScriptlet(pkiscriptlet.AbstractBasePkiScriptlet): "common-ui"), master['pki_tomcat_webapps_common_path'], overwrite_flag=True) + util.directory.copy( + os.path.join( + config.PKI_DEPLOYMENT_SOURCE_ROOT, + "shared", + "webapps", + "ROOT"), + master['pki_tomcat_webapps_root_path'], + overwrite_flag=True) util.directory.modify(master['pki_tomcat_webapps_root_path']) util.directory.modify(master['pki_tomcat_webapps_root_webinf_path']) - util.file.copy(master['pki_source_webapps_root_web_xml'], - master['pki_tomcat_webapps_root_webinf_web_xml'], - overwrite_flag=True) util.directory.modify(master['pki_tomcat_work_path']) util.directory.modify(master['pki_tomcat_work_catalina_path']) util.directory.modify(master['pki_tomcat_work_catalina_host_path']) diff --git a/base/deploy/src/scriptlets/pkiparser.py b/base/deploy/src/scriptlets/pkiparser.py index 64852f433..dd70874fe 100644 --- a/base/deploy/src/scriptlets/pkiparser.py +++ b/base/deploy/src/scriptlets/pkiparser.py @@ -406,9 +406,9 @@ def compose_pki_master_dictionary(): "lib") config.pki_master_dict['pki_tomcat_systemd'] =\ config.PKI_DEPLOYMENT_TOMCAT_SYSTEMD - config.pki_master_dict['pki_source_webapps_path'] =\ + config.pki_master_dict['pki_shared_webapps_path'] =\ os.path.join(config.PKI_DEPLOYMENT_SOURCE_ROOT, - config.pki_master_dict['pki_subsystem'].lower(), + "shared", "webapps") config.pki_master_dict['pki_source_catalina_properties'] =\ os.path.join(config.pki_master_dict['pki_source_shared_path'], @@ -425,15 +425,6 @@ def compose_pki_master_dictionary(): config.pki_master_dict['pki_source_tomcat_conf'] =\ os.path.join(config.pki_master_dict['pki_source_shared_path'], "tomcat.conf") - config.pki_master_dict['pki_source_index_jsp'] =\ - os.path.join(config.pki_master_dict['pki_source_webapps_path'], - "ROOT", - "index.jsp") - config.pki_master_dict['pki_source_webapps_root_web_xml'] =\ - os.path.join(config.pki_master_dict['pki_source_webapps_path'], - "ROOT", - "WEB-INF", - "web.xml") if config.pki_master_dict['pki_subsystem'] == "CA": config.pki_master_dict['pki_source_emails'] =\ os.path.join(config.PKI_DEPLOYMENT_SOURCE_ROOT, @@ -573,11 +564,6 @@ def compose_pki_master_dictionary(): os.path.join( config.pki_master_dict['pki_tomcat_webapps_root_path'], "WEB-INF") - config.pki_master_dict['pki_tomcat_webapps_root_webinf_web_xml'] =\ - os.path.join( - config.pki_master_dict\ - ['pki_tomcat_webapps_root_webinf_path'], - "web.xml") config.pki_master_dict['pki_tomcat_work_path'] =\ os.path.join(config.pki_master_dict['pki_instance_path'], "work") @@ -1012,10 +998,6 @@ def compose_pki_master_dictionary(): os.path.join( config.pki_master_dict['pki_instance_configuration_path'], "tomcat.conf") - config.pki_master_dict['pki_target_index_jsp'] =\ - os.path.join( - config.pki_master_dict['pki_tomcat_webapps_root_path'], - "index.jsp") # in-place slot substitution name/value pairs config.pki_master_dict['pki_target_auth_properties'] =\ os.path.join( diff --git a/base/deploy/src/scriptlets/slot_substitution.py b/base/deploy/src/scriptlets/slot_substitution.py index 482d1d9cb..39887611a 100644 --- a/base/deploy/src/scriptlets/slot_substitution.py +++ b/base/deploy/src/scriptlets/slot_substitution.py @@ -65,10 +65,6 @@ class PkiScriptlet(pkiscriptlet.AbstractBasePkiScriptlet): master['pki_source_tomcat_conf'], master['pki_target_tomcat_conf'], overwrite_flag=True) - util.file.copy_with_slot_substitution( - master['pki_source_index_jsp'], - master['pki_target_index_jsp'], - overwrite_flag=True) util.file.apply_slot_substitution( master['pki_target_auth_properties']) util.file.apply_slot_substitution( @@ -126,10 +122,6 @@ class PkiScriptlet(pkiscriptlet.AbstractBasePkiScriptlet): master['pki_source_tomcat_conf'], master['pki_target_tomcat_conf'], overwrite_flag=True) - util.file.copy_with_slot_substitution( - master['pki_source_index_jsp'], - master['pki_target_index_jsp'], - overwrite_flag=True) util.file.apply_slot_substitution( master['pki_target_auth_properties']) util.file.apply_slot_substitution( diff --git a/base/kra/shared/webapps/kra/WEB-INF/web.xml b/base/kra/shared/webapps/kra/WEB-INF/web.xml index 9208507c3..1a5b6aaf5 100644 --- a/base/kra/shared/webapps/kra/WEB-INF/web.xml +++ b/base/kra/shared/webapps/kra/WEB-INF/web.xml @@ -3,6 +3,8 @@ PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "file:///usr/share/pki/setup/web-app_2_3.dtd"> + Key Recovery Authority + csadmin-wizard com.netscape.cms.servlet.wizard.WizardServlet diff --git a/base/ocsp/shared/webapps/ocsp/WEB-INF/web.xml b/base/ocsp/shared/webapps/ocsp/WEB-INF/web.xml index b1e625975..040e7f7ed 100644 --- a/base/ocsp/shared/webapps/ocsp/WEB-INF/web.xml +++ b/base/ocsp/shared/webapps/ocsp/WEB-INF/web.xml @@ -7,6 +7,8 @@ PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "file:///usr/share/pki/setup/web-app_2_3.dtd"> + Online Certificate Status Protocol Manager + csadmin-wizard com.netscape.cms.servlet.wizard.WizardServlet diff --git a/base/tks/shared/webapps/tks/WEB-INF/web.xml b/base/tks/shared/webapps/tks/WEB-INF/web.xml index 80bb24bc1..a06b2f213 100644 --- a/base/tks/shared/webapps/tks/WEB-INF/web.xml +++ b/base/tks/shared/webapps/tks/WEB-INF/web.xml @@ -7,6 +7,8 @@ PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "file:///usr/share/pki/setup/web-app_2_3.dtd"> + Token Key Service + csadmin-wizard com.netscape.cms.servlet.wizard.WizardServlet -- cgit