diff options
Diffstat (limited to 'base/tps')
-rw-r--r-- | base/tps/shared/webapps/tps/index.html | 1 | ||||
-rw-r--r-- | base/tps/shared/webapps/tps/js/cert.js | 11 | ||||
-rw-r--r-- | base/tps/shared/webapps/tps/js/token.js | 8 | ||||
-rw-r--r-- | base/tps/shared/webapps/tps/ui/certs.html | 2 | ||||
-rw-r--r-- | base/tps/shared/webapps/tps/ui/index.html | 12 | ||||
-rw-r--r-- | base/tps/shared/webapps/tps/ui/token.html | 1 | ||||
-rw-r--r-- | base/tps/src/org/dogtagpki/server/tps/rest/TPSCertService.java | 17 |
7 files changed, 45 insertions, 7 deletions
diff --git a/base/tps/shared/webapps/tps/index.html b/base/tps/shared/webapps/tps/index.html index c48da3307..71d333450 100644 --- a/base/tps/shared/webapps/tps/index.html +++ b/base/tps/shared/webapps/tps/index.html @@ -17,6 +17,7 @@ --- END COPYRIGHT BLOCK --- --> <html> <head> + <title>Token Processing System</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link href="/pki/css/patternfly.css" rel="stylesheet" media="screen, print"> <script src="/pki/js/jquery.js"></script> diff --git a/base/tps/shared/webapps/tps/js/cert.js b/base/tps/shared/webapps/tps/js/cert.js index 016b56ee0..c8e8d5d02 100644 --- a/base/tps/shared/webapps/tps/js/cert.js +++ b/base/tps/shared/webapps/tps/js/cert.js @@ -90,9 +90,18 @@ var CertificatesPage = Page.extend({ load: function() { var self = this; + if (self.collection && self.collection.options && self.collection.options.tokenID) { + $(".pki-breadcrumb-tokens").show(); + $(".pki-breadcrumb-token a") + .attr("href", "#tokens/" + self.collection.options.tokenID) + .text("Token " + self.collection.options.tokenID); + $(".pki-breadcrumb-token").show(); + $(".pki-title").text("Certificates for Token " + self.collection.options.tokenID); + } + var table = new CertificatesTable({ el: $("table[name='certificates']"), - collection: new CertificateCollection() + collection: self.collection }); table.render(); diff --git a/base/tps/shared/webapps/tps/js/token.js b/base/tps/shared/webapps/tps/js/token.js index 2ea17714e..c1f27b132 100644 --- a/base/tps/shared/webapps/tps/js/token.js +++ b/base/tps/shared/webapps/tps/js/token.js @@ -153,6 +153,14 @@ var TokenPage = EntryPage.extend({ dialog.open(); }); + + self.showCertsLink = $("a[name='showCerts']", self.menu); + + self.showCertsLink.click(function(e) { + + e.preventDefault(); + window.location.hash = window.location.hash + "/certs"; + }); }, renderContent: function() { var self = this; diff --git a/base/tps/shared/webapps/tps/ui/certs.html b/base/tps/shared/webapps/tps/ui/certs.html index a87c2dd32..52e229f7b 100644 --- a/base/tps/shared/webapps/tps/ui/certs.html +++ b/base/tps/shared/webapps/tps/ui/certs.html @@ -18,6 +18,8 @@ <div class="pki-header"> <ol class="breadcrumb"> <li><a href="#">Home</a></li> + <li class="pki-breadcrumb-tokens" style="display: none;"><a href="#tokens">Tokens</a></li> + <li class="pki-breadcrumb-token" style="display: none;"><a href="#tokens/${tokenID}">Token ${id}</a></li> <li class="active"><strong>Certificates</strong></li> </ol> diff --git a/base/tps/shared/webapps/tps/ui/index.html b/base/tps/shared/webapps/tps/ui/index.html index eddceefd7..74adeadd1 100644 --- a/base/tps/shared/webapps/tps/ui/index.html +++ b/base/tps/shared/webapps/tps/ui/index.html @@ -17,6 +17,7 @@ --- END COPYRIGHT BLOCK --- --> <html> <head> + <title>Token Processing System</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link href="/pki/css/patternfly.css" rel="stylesheet" media="screen, print"> <link href="/pki/css/pki-ui.css" rel="stylesheet" type="text/css"> @@ -117,7 +118,8 @@ $(function() { router.route("certs", "certs", function() { new CertificatesPage({ el: content, - url: "certs.html" + url: "certs.html", + collection: new CertificateCollection() }).open(); }); @@ -276,6 +278,14 @@ $(function() { }).open(); }); + router.route("tokens/:id/certs", "certs", function(id) { + new CertificatesPage({ + el: content, + url: "certs.html", + collection: new CertificateCollection({ tokenID: id }) + }).open(); + }); + router.route("new-token", "new-token", function() { new TokenPage({ el: content, diff --git a/base/tps/shared/webapps/tps/ui/token.html b/base/tps/shared/webapps/tps/ui/token.html index 78384acfe..8be08f09a 100644 --- a/base/tps/shared/webapps/tps/ui/token.html +++ b/base/tps/shared/webapps/tps/ui/token.html @@ -29,6 +29,7 @@ <span class="pki-menu" style="display: none;"> <a name="edit" href="#">Edit</a><br> <a name="changeStatus" href="#">Change Status</a><br> +<a name="showCerts" href="#">Show Certificates</a><br> </span> <span class="pki-buttons" style="display: none;"> diff --git a/base/tps/src/org/dogtagpki/server/tps/rest/TPSCertService.java b/base/tps/src/org/dogtagpki/server/tps/rest/TPSCertService.java index 75314cd5d..074d3d034 100644 --- a/base/tps/src/org/dogtagpki/server/tps/rest/TPSCertService.java +++ b/base/tps/src/org/dogtagpki/server/tps/rest/TPSCertService.java @@ -21,7 +21,9 @@ package org.dogtagpki.server.tps.rest; import java.io.UnsupportedEncodingException; import java.net.URI; import java.net.URLEncoder; +import java.util.HashMap; import java.util.Iterator; +import java.util.Map; import javax.servlet.http.HttpServletRequest; import javax.ws.rs.core.Context; @@ -61,7 +63,7 @@ public class TPSCertService extends PKIService implements TPSCertResource { private HttpServletRequest servletRequest; public TPSCertService() { - System.out.println("TPSCertService.<init>()"); + CMS.debug("TPSCertService.<init>()"); } public TPSCertData createCertData(TPSCertRecord certRecord) { @@ -108,14 +110,19 @@ public class TPSCertService extends PKIService implements TPSCertResource { } @Override - public Response findCerts(String filter, Integer start, Integer size) { + public Response findCerts(String filter, String tokenID, Integer start, Integer size) { - System.out.println("TPSCertService.findCerts()"); + CMS.debug("TPSCertService.findCerts(" + filter + ", " + tokenID + ", " + start + ", " + size + ")"); if (filter != null && filter.length() < MIN_FILTER_LENGTH) { throw new BadRequestException("Filter is too short."); } + Map<String, String> attributes = new HashMap<String, String>(); + if (tokenID != null) { + attributes.put("tokenID", tokenID); + } + start = start == null ? 0 : start; size = size == null ? DEFAULT_SIZE : size; @@ -123,7 +130,7 @@ public class TPSCertService extends PKIService implements TPSCertResource { TPSSubsystem subsystem = (TPSSubsystem)CMS.getSubsystem(TPSSubsystem.ID); TPSCertDatabase database = subsystem.getCertDatabase(); - Iterator<TPSCertRecord> activities = database.findRecords(filter).iterator(); + Iterator<TPSCertRecord> activities = database.findRecords(filter, attributes).iterator(); TPSCertCollection response = new TPSCertCollection(); int i = 0; @@ -163,7 +170,7 @@ public class TPSCertService extends PKIService implements TPSCertResource { if (certID == null) throw new BadRequestException("Certificate ID is null."); - System.out.println("TPSCertService.getCert(\"" + certID + "\")"); + CMS.debug("TPSCertService.getCert(\"" + certID + "\")"); try { TPSSubsystem subsystem = (TPSSubsystem)CMS.getSubsystem(TPSSubsystem.ID); |