|
[HepData-svn] r1674 - in trunk/hepdata-webapp/src/main: java/cedar/hepdata/formats java/cedar/hepdata/webapp/pages resources/cedar/hepdata/webapp/pagesblackhole at projects.hepforge.org blackhole at projects.hepforge.orgWed Nov 13 20:02:34 GMT 2013
Author: watt Date: Wed Nov 13 20:02:34 2013 New Revision: 1674 Log: Added CDS ID and updated Experiment link to INSPIRE Modified: trunk/hepdata-webapp/src/main/java/cedar/hepdata/formats/HepMLFormatter.java trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/pages/AllIds.java trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/pages/Search.java trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/pages/ViewBase.java trunk/hepdata-webapp/src/main/resources/cedar/hepdata/webapp/pages/Search.tml trunk/hepdata-webapp/src/main/resources/cedar/hepdata/webapp/pages/View.tml Modified: trunk/hepdata-webapp/src/main/java/cedar/hepdata/formats/HepMLFormatter.java ============================================================================== --- trunk/hepdata-webapp/src/main/java/cedar/hepdata/formats/HepMLFormatter.java Wed Nov 13 11:49:22 2013 (r1673) +++ trunk/hepdata-webapp/src/main/java/cedar/hepdata/formats/HepMLFormatter.java Wed Nov 13 20:02:34 2013 (r1674) @@ -29,6 +29,7 @@ // else { s.append(" spiresId=''"); } if(p.getInspireId() != null) { s.append(" inspireId='" + p.getInspireId() + "'"); } // else { s.append(" inspireId=''"); } + if(p.getCdsId() != null) { s.append(" cdsId='" + p.getCdsId() + "'"); } if(p.getRedId() != null) { s.append(" redId='" + p.getRedId() + "'"); } else { s.append(" RedId=''"); } s.append(" preprintDate=''>\n"); Modified: trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/pages/AllIds.java ============================================================================== --- trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/pages/AllIds.java Wed Nov 13 11:49:22 2013 (r1673) +++ trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/pages/AllIds.java Wed Nov 13 20:02:34 2013 (r1674) @@ -47,6 +47,14 @@ return _paper.getInspireId(); } } + public Long getCdsId(){ + Long zero= new Long("0"); + if(_paper.getCdsId() == null){ + return zero; + } else{ + return _paper.getCdsId(); + } + } public Long getSpiresId(){ Long zero= new Long("0"); if(_paper.getSpiresId() == null){ Modified: trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/pages/Search.java ============================================================================== --- trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/pages/Search.java Wed Nov 13 11:49:22 2013 (r1673) +++ trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/pages/Search.java Wed Nov 13 20:02:34 2013 (r1674) @@ -370,6 +370,9 @@ else if(_paper.getSpiresId() != null) { ctx.add("irn" + Long.toString(_paper.getSpiresId())); } + else if(_paper.getCdsId() != null) { + ctx.add("cds" + Long.toString(_paper.getCdsId())); + } else if(_paper.getRedId() != null) { ctx.add("red" + Long.toString(_paper.getRedId())); } @@ -395,6 +398,9 @@ else if(_paper.getSpiresId() != null) { ctx.add("irn" + Long.toString(_paper.getSpiresId())); } + else if(_paper.getCdsId() != null) { + ctx.add("cds" + Long.toString(_paper.getCdsId())); + } else if(_paper.getRedId() != null) { ctx.add("red" + Long.toString(_paper.getRedId())); } Modified: trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/pages/ViewBase.java ============================================================================== --- trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/pages/ViewBase.java Wed Nov 13 11:49:22 2013 (r1673) +++ trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/pages/ViewBase.java Wed Nov 13 20:02:34 2013 (r1674) @@ -121,6 +121,11 @@ _params.put("ins", m.group(1)); continue; } + m = Pattern.compile("\\A" + "cds" + "(\\d+)\\Z").matcher(ps); + if (m.matches()) { + _params.put("cds", m.group(1)); + continue; + } m = Pattern.compile("\\A" + "10.1016" + "\\Z").matcher(ps); if (m.matches()) { String doi2=context.get(String.class, i+1); @@ -253,11 +258,19 @@ } return ctx; } + public List<String> getCdsContext() { + List<String> ctx = new Vector<String>(); + if (getPaper() != null) { + ctx.add("cds" + getPaper().getCdsId()); + } + return ctx; + } public List<String> getPaperContext() { List<String> ctx = new Vector<String>(); String p = getQueryParam("p"); String irn = getQueryParam("irn"); String ins = getQueryParam("ins"); + String cds = getQueryParam("cds"); String red = getQueryParam("red"); String doi = getQueryParam("doi"); if (p != null) { @@ -266,6 +279,8 @@ ctx.add("irn" + irn); } else if (ins != null) { ctx.add("ins" + ins); + } else if (cds != null) { + ctx.add("cds" + cds); } else if (red != null) { ctx.add("red" + red); } else if (doi != null) { @@ -314,12 +329,14 @@ String p = getQueryParam("p"); String irn = getQueryParam("irn"); String ins = getQueryParam("ins"); + String cds = getQueryParam("cds"); String red = getQueryParam("red"); String doi = getQueryParam("doi"); String paper = null; if (p != null) paper = "p" + p; else if (irn != null) paper = "irn" + irn; else if (ins != null) paper = "ins" + ins; + else if (cds != null) paper = "cds" + cds; else if (red != null) paper = "red" + red; else if (doi != null) paper = "doi" + doi; return paper; @@ -484,6 +501,9 @@ } else if (getQueryParam("ins") != null) { pid = getQueryParam("ins"); qs.append("p._inspireId = :pid"); + } else if (getQueryParam("cds") != null) { + pid = getQueryParam("cds"); + qs.append("p._cdsId = :pid"); } else if (getQueryParam("red") != null) { pid = getQueryParam("red"); qs.append("p._redId = :pid"); @@ -519,6 +539,9 @@ Long first = (Long) q2.list().get(0); pid = first.toString(); qs.append(" p._hepdataId = :pid" ); + } else if (getQueryParam("cds") != null) { + pid = getQueryParam("cds"); + qs.append(" p._cdsId = :pid"); } else if (getQueryParam("red") != null) { pid = getQueryParam("red"); qs.append(" p._redId = :pid"); Modified: trunk/hepdata-webapp/src/main/resources/cedar/hepdata/webapp/pages/Search.tml ============================================================================== --- trunk/hepdata-webapp/src/main/resources/cedar/hepdata/webapp/pages/Search.tml Wed Nov 13 11:49:22 2013 (r1673) +++ trunk/hepdata-webapp/src/main/resources/cedar/hepdata/webapp/pages/Search.tml Wed Nov 13 20:02:34 2013 (r1674) @@ -50,8 +50,9 @@ title="Display the complete data record"><b>${paper.shortname}</b></a> – Experiment: - <a href="http://slac.stanford.edu/cgi-bin/spiface/experiments/www2?fin+expt+${paper.experimentname}" - title="View ${paper.experimentname} entry in Spires experiments database"> + <!-- <a href="http://slac.stanford.edu/cgi-bin/spiface/experiments/www2?fin+expt+${paper.experimentname}" + title="View ${paper.experimentname} entry in Spires experiments database"> --> + <a href="http://inspirehep.net/search?ln=en&cc=Experiments&p=119__a:${paper.experimentName}&of=hd" title="View ${paper.experimentname} entry in INSPIRE experiments database"> <b>${paper.experimentname}</b></a> (${paper.informalname}) <br/> <t:if test="paper.firstPublished"> @@ -85,10 +86,20 @@ title="View the complete data record">Full data record</a> | <a href="#" t:type="pagelink" t:page="view" t:context="shortpaperidcontext" title="Just view the table headers for this record">Short data record</a> +<!-- <t:if test="paper.spiresId"> | <a href="http://inspirebeta.net/search?p=irn+${paper.spiresId}&search_action=Search" title="View the Spires database record for paper with IRN code ${paper.spiresId}">Spires record (${paper.spiresId})</a> </t:if> +--> + <t:if test="paper.inspireId"> + | <a href="http://inspirehep.net/search?p=f+recid+${paper.inspireId}&search_action=Search" + title="View the INSPIRE database record for this paper"><b>INSPIRE</b></a> + </t:if> + <t:if test="paper.cdsId"> + | <a href=" http://cds.cern.ch/record/${paper.cdsId}" + title="View the CERN Document Server record for this paper"><b>CDS</b></a> + </t:if> <br/> <t:loop source="otherPapers" value="otherPaper"> <a href="#" t:type="pagelink" t:page="view" t:context="${otherpaperidcontext}" @@ -109,7 +120,11 @@ --> <t:if test="paper.inspireId"> | <a href="http://inspirehep.net/search?p=f+recid+${paper.inspireId}&search_action=Search" - title="View the INSPIRE database record for this paper (${paper.spiresId}/${paper.inspireId})"><b>INSPIRE</b></a> + title="View the INSPIRE database record for this paper"><b>INSPIRE</b></a> + </t:if> + <t:if test="paper.cdsId"> + | <a href=" http://cds.cern.ch/record/${paper.cdsId}" + title="View the CERN Document Server record for this paper"><b>CDS</b></a> </t:if> <t:if test="paper.haveRivet"> | <a href="http://projects.hepforge.org/rivet/analyses#${paper.rivetName}"><b>Rivet</b></a> Modified: trunk/hepdata-webapp/src/main/resources/cedar/hepdata/webapp/pages/View.tml ============================================================================== --- trunk/hepdata-webapp/src/main/resources/cedar/hepdata/webapp/pages/View.tml Wed Nov 13 11:49:22 2013 (r1673) +++ trunk/hepdata-webapp/src/main/resources/cedar/hepdata/webapp/pages/View.tml Wed Nov 13 20:02:34 2013 (r1674) @@ -110,7 +110,8 @@ <p> Experiment: - <a href="http://slac.stanford.edu/cgi-bin/spiface/experiments/www2?fin+expt+${paper.experimentName}"> + <!-- <a href="http://slac.stanford.edu/cgi-bin/spiface/experiments/www2?fin+expt+${paper.experimentName}"> --> + <a href="http://inspirehep.net/search?ln=en&cc=Experiments&p=119__a:${paper.experimentName}&of=hd" title="View ${paper.experimentname} entry in INSPIRE experiments database"> <b>${paper.experimentName} (${paper.informalName})</b></a> <br/> <t:if test="paper.firstPublished"> @@ -142,10 +143,15 @@ <br/> </t:if> <t:if test="paper.inspireId"> - Record in: - <a href="http://inspirehep.net/search?p=f+recid+${paper.inspireId}&search_action=Search"><b>INSPIRE</b></a> + Record in: + <a href="http://inspirehep.net/search?p=f+recid+${paper.inspireId}&search_action=Search" title="View the INSPIRE database record for this paper"><b>INSPIRE</b></a> <br/> </t:if> + <t:if test="paper.cdsId"> + Record in: + <a href=" http://cds.cern.ch/record/${paper.cdsId}"><b>CERN Document Server</b></a> + <br/> + </t:if> <t:if test="paper.haveRivet"> Rivet Analysis: <a href="http://projects.hepforge.org/rivet/analyses#${paper.rivetName}"><b>${paper.rivetName}</b></a> @@ -326,9 +332,16 @@ </div> <p class="permalinks"> Permalinks: - <a href="#" t:type="pagelink" t:page="view" t:context="hdpaperContext">by HepData ID</a> | - <a href="#" t:type="pagelink" t:page="view" t:context="spiresContext">by Spires ID</a> | - <a href="#" t:type="pagelink" t:page="view" t:context="InspireContext">by Inspire ID</a> + <!-- <a href="#" t:type="pagelink" t:page="view" t:context="hdpaperContext">by HepData ID</a> --> + <t:if test="paper.spiresId"> + | <a href="#" t:type="pagelink" t:page="view" t:context="spiresContext">by Spires ID</a> + </t:if> + <t:if test="paper.inspireId"> + | <a href="#" t:type="pagelink" t:page="view" t:context="InspireContext">by Inspire ID</a> + </t:if> + <t:if test="paper.cdsId"> + | <a href="#" t:type="pagelink" t:page="view" t:context="CdsContext">by CDS ID</a> + </t:if> <br/> (Reaction db ID=${paper.id}, RED=${paper.redid}) <br/>
More information about the HepData-svn mailing list |