NIHVIVO-2675 Add vclass as a url parameter in the rdf link on individual list page
This commit is contained in:
parent
a5fbac6277
commit
498aea8ac0
3 changed files with 6 additions and 7 deletions
|
@ -34,8 +34,8 @@ public class IndividualListRdfController extends VitroHttpServlet {
|
|||
public void doGet (HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException {
|
||||
|
||||
// Make the query
|
||||
String classUri = (String) getServletContext().getAttribute("classuri");
|
||||
String queryStr = VitroLuceneTermNames.RDFTYPE + ":\"" + classUri + "\"";
|
||||
String vclassUri = req.getParameter("vclass");
|
||||
String queryStr = VitroLuceneTermNames.RDFTYPE + ":\"" + vclassUri + "\"";
|
||||
SolrQuery query = new SolrQuery(queryStr);
|
||||
query.setStart(0)
|
||||
.setRows(ENTITY_LIST_CONTROLLER_MAX_RESULTS)
|
||||
|
@ -67,7 +67,7 @@ public class IndividualListRdfController extends VitroHttpServlet {
|
|||
for (SolrDocument doc : docs) {
|
||||
String uri = doc.get(VitroLuceneTermNames.URI).toString();
|
||||
Resource resource = ResourceFactory.createResource(uri);
|
||||
RDFNode node = (RDFNode) ResourceFactory.createResource(classUri);
|
||||
RDFNode node = (RDFNode) ResourceFactory.createResource(vclassUri);
|
||||
model.add(resource, RDF.type, node);
|
||||
}
|
||||
|
||||
|
|
|
@ -125,8 +125,8 @@ public class IndividualListController extends FreemarkerHttpServlet {
|
|||
body.put("subtitle", vclass.getName());
|
||||
}
|
||||
body.put("title", title);
|
||||
body.put("rdfUrl", vreq.getContextPath()+"/listrdf/");
|
||||
getServletContext().setAttribute("classuri", vclass.getURI());
|
||||
body.put("rdfUrl", UrlBuilder.getUrl("/listrdf", "vclass", vclass.getURI()));
|
||||
|
||||
}
|
||||
|
||||
} catch (HelpException help){
|
||||
|
|
|
@ -120,8 +120,7 @@ public class SolrIndividualListController extends FreemarkerHttpServlet {
|
|||
body.put("subtitle", vclass.getName());
|
||||
}
|
||||
body.put("title", title);
|
||||
body.put("rdfUrl", vreq.getContextPath() + "/listrdf/" + vclass.getLocalName() + ".rdf");
|
||||
getServletContext().setAttribute("classuri", vclass.getURI());
|
||||
body.put("rdfUrl", UrlBuilder.getUrl("/listrdf", "vclass", vclass.getURI()));
|
||||
}
|
||||
|
||||
} catch (HelpException help){
|
||||
|
|
Loading…
Add table
Reference in a new issue