NIHVIVO-2675 Add vclass as a url parameter in the rdf link on individual list page

This commit is contained in:
ryounes 2011-05-31 22:08:28 +00:00
parent a5fbac6277
commit 498aea8ac0
3 changed files with 6 additions and 7 deletions

View file

@ -34,8 +34,8 @@ public class IndividualListRdfController extends VitroHttpServlet {
public void doGet (HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException { public void doGet (HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException {
// Make the query // Make the query
String classUri = (String) getServletContext().getAttribute("classuri"); String vclassUri = req.getParameter("vclass");
String queryStr = VitroLuceneTermNames.RDFTYPE + ":\"" + classUri + "\""; String queryStr = VitroLuceneTermNames.RDFTYPE + ":\"" + vclassUri + "\"";
SolrQuery query = new SolrQuery(queryStr); SolrQuery query = new SolrQuery(queryStr);
query.setStart(0) query.setStart(0)
.setRows(ENTITY_LIST_CONTROLLER_MAX_RESULTS) .setRows(ENTITY_LIST_CONTROLLER_MAX_RESULTS)
@ -67,7 +67,7 @@ public class IndividualListRdfController extends VitroHttpServlet {
for (SolrDocument doc : docs) { for (SolrDocument doc : docs) {
String uri = doc.get(VitroLuceneTermNames.URI).toString(); String uri = doc.get(VitroLuceneTermNames.URI).toString();
Resource resource = ResourceFactory.createResource(uri); Resource resource = ResourceFactory.createResource(uri);
RDFNode node = (RDFNode) ResourceFactory.createResource(classUri); RDFNode node = (RDFNode) ResourceFactory.createResource(vclassUri);
model.add(resource, RDF.type, node); model.add(resource, RDF.type, node);
} }

View file

@ -125,8 +125,8 @@ public class IndividualListController extends FreemarkerHttpServlet {
body.put("subtitle", vclass.getName()); body.put("subtitle", vclass.getName());
} }
body.put("title", title); body.put("title", title);
body.put("rdfUrl", vreq.getContextPath()+"/listrdf/"); body.put("rdfUrl", UrlBuilder.getUrl("/listrdf", "vclass", vclass.getURI()));
getServletContext().setAttribute("classuri", vclass.getURI());
} }
} catch (HelpException help){ } catch (HelpException help){

View file

@ -120,8 +120,7 @@ public class SolrIndividualListController extends FreemarkerHttpServlet {
body.put("subtitle", vclass.getName()); body.put("subtitle", vclass.getName());
} }
body.put("title", title); body.put("title", title);
body.put("rdfUrl", vreq.getContextPath() + "/listrdf/" + vclass.getLocalName() + ".rdf"); body.put("rdfUrl", UrlBuilder.getUrl("/listrdf", "vclass", vclass.getURI()));
getServletContext().setAttribute("classuri", vclass.getURI());
} }
} catch (HelpException help){ } catch (HelpException help){