1. Made changes to the value objects structure/inheritance.
2. Removed unnecessary fields from BiboDocument. 3. Changes to the Query & Vis request handlers to incorporate changes to the VOs.
This commit is contained in:
parent
7bb0b8a17d
commit
4a74799a18
10 changed files with 114 additions and 108 deletions
|
@ -46,6 +46,9 @@ public class TestJava {
|
||||||
yearToPublicationCount.put("2090", 7);
|
yearToPublicationCount.put("2090", 7);
|
||||||
yearToPublicationCount.put("2087", 6);
|
yearToPublicationCount.put("2087", 6);
|
||||||
|
|
||||||
|
String emptyString = "";
|
||||||
|
System.out.println(emptyString.isEmpty());
|
||||||
|
|
||||||
// System.out.println(Collections.max(yearToPublicationCount.keySet()));
|
// System.out.println(Collections.max(yearToPublicationCount.keySet()));
|
||||||
// System.out.println(Collections.min(yearToPublicationCount.keySet()));
|
// System.out.println(Collections.min(yearToPublicationCount.keySet()));
|
||||||
|
|
||||||
|
|
|
@ -120,8 +120,11 @@ public class QueryHandler {
|
||||||
currentEmployee.addParentDepartment(currentDepartment);
|
currentEmployee.addParentDepartment(currentDepartment);
|
||||||
} else {
|
} else {
|
||||||
currentEmployee = new VivoEmployee(employeeNode.toString(), currentEmployeeType, currentDepartment);
|
currentEmployee = new VivoEmployee(employeeNode.toString(), currentEmployeeType, currentDepartment);
|
||||||
|
RDFNode authorLabelNode = solution.get(QueryFieldLabels.AUTHOR_LABEL);
|
||||||
|
if (authorLabelNode != null) {
|
||||||
|
currentEmployee.setIndividualLabel(authorLabelNode.toString());
|
||||||
|
}
|
||||||
employeeURLToVO.put(employeeNode.toString(), currentEmployee);
|
employeeURLToVO.put(employeeNode.toString(), currentEmployee);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
RDFNode documentNode = solution.get(QueryFieldLabels.DOCUMENT_URL);
|
RDFNode documentNode = solution.get(QueryFieldLabels.DOCUMENT_URL);
|
||||||
|
@ -203,11 +206,6 @@ public class QueryHandler {
|
||||||
biboDocument.setPublicationYear(publicationYearNode.toString());
|
biboDocument.setPublicationYear(publicationYearNode.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
RDFNode authorLabelNode = solution.get(QueryFieldLabels.AUTHOR_LABEL);
|
|
||||||
if (authorLabelNode != null) {
|
|
||||||
biboDocument.setAuthorLabel(authorLabelNode.toString());
|
|
||||||
}
|
|
||||||
|
|
||||||
return biboDocument;
|
return biboDocument;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -278,7 +276,7 @@ public class QueryHandler {
|
||||||
String ontologyHandle) {
|
String ontologyHandle) {
|
||||||
|
|
||||||
String sparqlQuery = " {?department " + ontologyHandle + " ?" + employeeHandle + " . "
|
String sparqlQuery = " {?department " + ontologyHandle + " ?" + employeeHandle + " . "
|
||||||
+ "?" + employeeHandle + " rdf:type foaf:Person; rdfs:label ?authorLabel. "
|
+ "?" + employeeHandle + " rdf:type foaf:Individual; rdfs:label ?authorLabel. "
|
||||||
+ "OPTIONAL { ?" + employeeHandle + " vivo:authorOf ?document ." +
|
+ "OPTIONAL { ?" + employeeHandle + " vivo:authorOf ?document ." +
|
||||||
" ?document rdf:type bibo:Document ." +
|
" ?document rdf:type bibo:Document ." +
|
||||||
" ?document rdfs:label ?documentLabel ." +
|
" ?document rdfs:label ?documentLabel ." +
|
||||||
|
|
|
@ -33,6 +33,7 @@ import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
|
||||||
import edu.cornell.mannlib.vitro.webapp.visualization.PDFDocument;
|
import edu.cornell.mannlib.vitro.webapp.visualization.PDFDocument;
|
||||||
import edu.cornell.mannlib.vitro.webapp.visualization.exceptions.MalformedQueryParametersException;
|
import edu.cornell.mannlib.vitro.webapp.visualization.exceptions.MalformedQueryParametersException;
|
||||||
import edu.cornell.mannlib.vitro.webapp.visualization.valueobjects.BiboDocument;
|
import edu.cornell.mannlib.vitro.webapp.visualization.valueobjects.BiboDocument;
|
||||||
|
import edu.cornell.mannlib.vitro.webapp.visualization.valueobjects.Individual;
|
||||||
import edu.cornell.mannlib.vitro.webapp.visualization.valueobjects.VivoCollegeOrSchool;
|
import edu.cornell.mannlib.vitro.webapp.visualization.valueobjects.VivoCollegeOrSchool;
|
||||||
import edu.cornell.mannlib.vitro.webapp.visualization.valueobjects.VivoDepartmentOrDivision;
|
import edu.cornell.mannlib.vitro.webapp.visualization.valueobjects.VivoDepartmentOrDivision;
|
||||||
import edu.cornell.mannlib.vitro.webapp.visualization.valueobjects.VivoEmployee;
|
import edu.cornell.mannlib.vitro.webapp.visualization.valueobjects.VivoEmployee;
|
||||||
|
@ -132,13 +133,16 @@ public class VisualizationRequestHandler {
|
||||||
* It is ugly!
|
* It is ugly!
|
||||||
* */
|
* */
|
||||||
if (DATA_RENDER_MODE_URL_VALUE.equalsIgnoreCase(renderMode)) {
|
if (DATA_RENDER_MODE_URL_VALUE.equalsIgnoreCase(renderMode)) {
|
||||||
prepareVisualizationQueryDataResponse(departmentToPublicationsOverTime,
|
prepareVisualizationQueryDataResponse(
|
||||||
|
departmentToPublicationsOverTime,
|
||||||
queryManager.getCollegeURLToVO());
|
queryManager.getCollegeURLToVO());
|
||||||
|
|
||||||
System.out.println(publishedYearsForCollege);
|
log.debug(publishedYearsForCollege);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
if (PDF_RENDER_MODE_URL_VALUE.equalsIgnoreCase(renderMode)) {
|
if (PDF_RENDER_MODE_URL_VALUE.equalsIgnoreCase(renderMode)) {
|
||||||
prepareVisualizationQueryPDFResponse(authorDocuments,
|
prepareVisualizationQueryPDFResponse(authorDocuments,
|
||||||
|
@ -263,7 +267,8 @@ public class VisualizationRequestHandler {
|
||||||
return departmentYearToPublicationCount;
|
return departmentYearToPublicationCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void prepareVisualizationQueryPDFResponse(List<BiboDocument> authorDocuments,
|
private void prepareVisualizationQueryPDFResponse(Individual college,
|
||||||
|
List<BiboDocument> authorDocuments,
|
||||||
Map<String, Integer> yearToPublicationCount) {
|
Map<String, Integer> yearToPublicationCount) {
|
||||||
|
|
||||||
String authorName = null;
|
String authorName = null;
|
||||||
|
@ -273,7 +278,7 @@ public class VisualizationRequestHandler {
|
||||||
* individual.
|
* individual.
|
||||||
* */
|
* */
|
||||||
if (authorDocuments.size() > 0) {
|
if (authorDocuments.size() > 0) {
|
||||||
authorName = ((BiboDocument) authorDocuments.get(0)).getAuthorLabel();
|
authorName = college.getIndividualLabel();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -298,29 +303,22 @@ public class VisualizationRequestHandler {
|
||||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||||
PdfWriter pdfWriter = PdfWriter.getInstance(document, baos);
|
PdfWriter pdfWriter = PdfWriter.getInstance(document, baos);
|
||||||
document.open();
|
document.open();
|
||||||
// document.add(new Paragraph("JSS Chintan Deepak Tank "));
|
|
||||||
// document.add(Chunk.NEWLINE);
|
|
||||||
// document.add(new Paragraph("The method used to generate this PDF was: TEST OPST"));
|
|
||||||
|
|
||||||
PDFDocument pdfDocument = new PDFDocument(authorName, yearToPublicationCount, document, pdfWriter);
|
|
||||||
|
|
||||||
|
|
||||||
|
PDFDocument pdfDocument = new PDFDocument(authorName,
|
||||||
|
yearToPublicationCount,
|
||||||
|
document,
|
||||||
|
pdfWriter);
|
||||||
document.close();
|
document.close();
|
||||||
|
|
||||||
// setting some response headers
|
|
||||||
response.setHeader("Expires", "0");
|
response.setHeader("Expires", "0");
|
||||||
response.setHeader("Cache-Control", "must-revalidate, post-check=0, pre-check=0");
|
response.setHeader("Cache-Control", "must-revalidate, post-check=0, pre-check=0");
|
||||||
response.setHeader("Pragma", "public");
|
response.setHeader("Pragma", "public");
|
||||||
// setting the content type
|
|
||||||
// the contentlength is needed for MSIE!!!
|
|
||||||
response.setContentLength(baos.size());
|
response.setContentLength(baos.size());
|
||||||
// write ByteArrayOutputStream to the ServletOutputStream
|
|
||||||
baos.writeTo(responseOutputStream);
|
baos.writeTo(responseOutputStream);
|
||||||
responseOutputStream.flush();
|
responseOutputStream.flush();
|
||||||
responseOutputStream.close();
|
responseOutputStream.close();
|
||||||
|
|
||||||
// System.out.println("done with response o/p stream");
|
|
||||||
|
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
} catch (DocumentException e) {
|
} catch (DocumentException e) {
|
||||||
|
@ -340,7 +338,7 @@ public class VisualizationRequestHandler {
|
||||||
* */
|
* */
|
||||||
// System.out.println(collegeURLToVO);
|
// System.out.println(collegeURLToVO);
|
||||||
if (collegeURLToVO.size() > 0) {
|
if (collegeURLToVO.size() > 0) {
|
||||||
// collegeName = ((VivoCollegeOrSchool) collegeURLToVO.entrySet().iterator().next()).getCollegeLabel();
|
collegeName = ((VivoCollegeOrSchool) collegeURLToVO.values().iterator().next()).getCollegeLabel();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -350,8 +348,7 @@ public class VisualizationRequestHandler {
|
||||||
collegeName = "";
|
collegeName = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
String outputFileName = slugify(collegeName + "depts-pub-count")
|
String outputFileName = slugify(collegeName + "depts-pub-count") + ".csv";
|
||||||
+ ".csv";
|
|
||||||
|
|
||||||
response.setContentType("application/octet-stream");
|
response.setContentType("application/octet-stream");
|
||||||
response.setHeader("Content-Disposition","attachment;filename=" + outputFileName);
|
response.setHeader("Content-Disposition","attachment;filename=" + outputFileName);
|
||||||
|
@ -439,7 +436,7 @@ public class VisualizationRequestHandler {
|
||||||
|
|
||||||
request.setAttribute("bodyJsp", "/templates/visualization/publication_count.jsp");
|
request.setAttribute("bodyJsp", "/templates/visualization/publication_count.jsp");
|
||||||
request.setAttribute("portalBean", portal);
|
request.setAttribute("portalBean", portal);
|
||||||
request.setAttribute("title", "Person Publication Count Visualization");
|
request.setAttribute("title", "Individual Publication Count Visualization");
|
||||||
request.setAttribute("scripts", "/templates/visualization/visualization_scripts.jsp");
|
request.setAttribute("scripts", "/templates/visualization/visualization_scripts.jsp");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -468,7 +465,7 @@ public class VisualizationRequestHandler {
|
||||||
RequestDispatcher requestDispatcher = request.getRequestDispatcher(Controllers.BASIC_JSP);
|
RequestDispatcher requestDispatcher = request.getRequestDispatcher(Controllers.BASIC_JSP);
|
||||||
request.setAttribute("bodyJsp", "/templates/visualization/visualization_error.jsp");
|
request.setAttribute("bodyJsp", "/templates/visualization/visualization_error.jsp");
|
||||||
request.setAttribute("portalBean", portal);
|
request.setAttribute("portalBean", portal);
|
||||||
request.setAttribute("title", "Visualization Query Error - Person Publication Count");
|
request.setAttribute("title", "Visualization Query Error - Individual Publication Count");
|
||||||
|
|
||||||
try {
|
try {
|
||||||
requestDispatcher.forward(request, response);
|
requestDispatcher.forward(request, response);
|
||||||
|
|
|
@ -24,6 +24,7 @@ import edu.cornell.mannlib.vitro.webapp.visualization.exceptions.MalformedQueryP
|
||||||
import edu.cornell.mannlib.vitro.webapp.visualization.sparqlutils.QueryConstants;
|
import edu.cornell.mannlib.vitro.webapp.visualization.sparqlutils.QueryConstants;
|
||||||
import edu.cornell.mannlib.vitro.webapp.visualization.sparqlutils.QueryFieldLabels;
|
import edu.cornell.mannlib.vitro.webapp.visualization.sparqlutils.QueryFieldLabels;
|
||||||
import edu.cornell.mannlib.vitro.webapp.visualization.valueobjects.BiboDocument;
|
import edu.cornell.mannlib.vitro.webapp.visualization.valueobjects.BiboDocument;
|
||||||
|
import edu.cornell.mannlib.vitro.webapp.visualization.valueobjects.Individual;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -39,6 +40,12 @@ public class QueryHandler {
|
||||||
private String queryParam, resultFormatParam, rdfResultFormatParam;
|
private String queryParam, resultFormatParam, rdfResultFormatParam;
|
||||||
private DataSource dataSource;
|
private DataSource dataSource;
|
||||||
|
|
||||||
|
private Individual author;
|
||||||
|
|
||||||
|
public Individual getAuthor() {
|
||||||
|
return author;
|
||||||
|
}
|
||||||
|
|
||||||
private Log log;
|
private Log log;
|
||||||
|
|
||||||
private static final String SPARQL_QUERY_COMMON_SELECT_CLAUSE = "" +
|
private static final String SPARQL_QUERY_COMMON_SELECT_CLAUSE = "" +
|
||||||
|
@ -106,14 +113,19 @@ public class QueryHandler {
|
||||||
biboDocument.setPublicationYear(publicationYearNode.toString());
|
biboDocument.setPublicationYear(publicationYearNode.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Since we are getting publication count for just one author at a time we need
|
||||||
|
* to create only one "Individual" instance. We test against the null for "author" to
|
||||||
|
* make sure that it has not already been instantiated.
|
||||||
|
* */
|
||||||
RDFNode authorURLNode = solution.get(QueryFieldLabels.AUTHOR_URL);
|
RDFNode authorURLNode = solution.get(QueryFieldLabels.AUTHOR_URL);
|
||||||
if (authorURLNode != null) {
|
if (authorURLNode != null && author == null) {
|
||||||
biboDocument.setAuthorURL(authorURLNode.toString());
|
author = new Individual(authorURLNode.toString());
|
||||||
}
|
|
||||||
|
|
||||||
RDFNode authorLabelNode = solution.get(QueryFieldLabels.AUTHOR_LABEL);
|
RDFNode authorLabelNode = solution.get(QueryFieldLabels.AUTHOR_LABEL);
|
||||||
if (authorLabelNode != null) {
|
if (authorLabelNode != null) {
|
||||||
biboDocument.setAuthorLabel(authorLabelNode.toString());
|
author.setIndividualLabel(authorLabelNode.toString());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
authorDocuments.add(biboDocument);
|
authorDocuments.add(biboDocument);
|
||||||
|
@ -154,7 +166,7 @@ public class QueryHandler {
|
||||||
+ SPARQL_QUERY_COMMON_SELECT_CLAUSE
|
+ SPARQL_QUERY_COMMON_SELECT_CLAUSE
|
||||||
+ "(str(<" + queryURI + ">) as ?authPersonLit) "
|
+ "(str(<" + queryURI + ">) as ?authPersonLit) "
|
||||||
+ "WHERE { "
|
+ "WHERE { "
|
||||||
+ "<" + queryURI + "> rdf:type foaf:Person ; vivo:authorOf ?document ; rdfs:label ?authorLabel. "
|
+ "<" + queryURI + "> rdf:type foaf:Individual ; vivo:authorOf ?document ; rdfs:label ?authorLabel. "
|
||||||
+ SPARQL_QUERY_COMMON_WHERE_CLAUSE
|
+ SPARQL_QUERY_COMMON_WHERE_CLAUSE
|
||||||
+ "}";
|
+ "}";
|
||||||
|
|
||||||
|
|
|
@ -31,6 +31,7 @@ import edu.cornell.mannlib.vitro.webapp.visualization.PDFDocument;
|
||||||
import edu.cornell.mannlib.vitro.webapp.visualization.VisualizationCodeGenerator;
|
import edu.cornell.mannlib.vitro.webapp.visualization.VisualizationCodeGenerator;
|
||||||
import edu.cornell.mannlib.vitro.webapp.visualization.exceptions.MalformedQueryParametersException;
|
import edu.cornell.mannlib.vitro.webapp.visualization.exceptions.MalformedQueryParametersException;
|
||||||
import edu.cornell.mannlib.vitro.webapp.visualization.valueobjects.BiboDocument;
|
import edu.cornell.mannlib.vitro.webapp.visualization.valueobjects.BiboDocument;
|
||||||
|
import edu.cornell.mannlib.vitro.webapp.visualization.valueobjects.Individual;
|
||||||
|
|
||||||
public class VisualizationRequestHandler {
|
public class VisualizationRequestHandler {
|
||||||
|
|
||||||
|
@ -104,14 +105,16 @@ public class VisualizationRequestHandler {
|
||||||
* It is ugly!
|
* It is ugly!
|
||||||
* */
|
* */
|
||||||
if (DATA_RENDER_MODE_URL_VALUE.equalsIgnoreCase(renderMode)) {
|
if (DATA_RENDER_MODE_URL_VALUE.equalsIgnoreCase(renderMode)) {
|
||||||
prepareVisualizationQueryDataResponse(authorDocuments,
|
prepareVisualizationQueryDataResponse(queryManager.getAuthor(),
|
||||||
|
authorDocuments,
|
||||||
yearToPublicationCount);
|
yearToPublicationCount);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (PDF_RENDER_MODE_URL_VALUE.equalsIgnoreCase(renderMode)) {
|
if (PDF_RENDER_MODE_URL_VALUE.equalsIgnoreCase(renderMode)) {
|
||||||
prepareVisualizationQueryPDFResponse(authorDocuments,
|
prepareVisualizationQueryPDFResponse(queryManager.getAuthor(),
|
||||||
|
authorDocuments,
|
||||||
yearToPublicationCount);
|
yearToPublicationCount);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -182,7 +185,7 @@ public class VisualizationRequestHandler {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void prepareVisualizationQueryPDFResponse(List<BiboDocument> authorDocuments,
|
private void prepareVisualizationQueryPDFResponse(Individual author, List<BiboDocument> authorDocuments,
|
||||||
Map<String, Integer> yearToPublicationCount) {
|
Map<String, Integer> yearToPublicationCount) {
|
||||||
|
|
||||||
String authorName = null;
|
String authorName = null;
|
||||||
|
@ -192,7 +195,7 @@ public class VisualizationRequestHandler {
|
||||||
* individual.
|
* individual.
|
||||||
* */
|
* */
|
||||||
if (authorDocuments.size() > 0) {
|
if (authorDocuments.size() > 0) {
|
||||||
authorName = ((BiboDocument) authorDocuments.get(0)).getAuthorLabel();
|
authorName = author.getIndividualLabel();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -239,7 +242,7 @@ public class VisualizationRequestHandler {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void prepareVisualizationQueryDataResponse(List<BiboDocument> authorDocuments,
|
private void prepareVisualizationQueryDataResponse(Individual author, List<BiboDocument> authorDocuments,
|
||||||
Map<String, Integer> yearToPublicationCount) {
|
Map<String, Integer> yearToPublicationCount) {
|
||||||
|
|
||||||
String authorName = null;
|
String authorName = null;
|
||||||
|
@ -249,7 +252,7 @@ public class VisualizationRequestHandler {
|
||||||
* individual.
|
* individual.
|
||||||
* */
|
* */
|
||||||
if (authorDocuments.size() > 0) {
|
if (authorDocuments.size() > 0) {
|
||||||
authorName = ((BiboDocument) authorDocuments.get(0)).getAuthorLabel();
|
authorName = author.getIndividualLabel();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -323,7 +326,7 @@ public class VisualizationRequestHandler {
|
||||||
|
|
||||||
request.setAttribute("bodyJsp", "/templates/visualization/publication_count.jsp");
|
request.setAttribute("bodyJsp", "/templates/visualization/publication_count.jsp");
|
||||||
request.setAttribute("portalBean", portal);
|
request.setAttribute("portalBean", portal);
|
||||||
request.setAttribute("title", "Person Publication Count visualization");
|
request.setAttribute("title", "Individual Publication Count visualization");
|
||||||
request.setAttribute("scripts", "/templates/visualization/visualization_scripts.jsp");
|
request.setAttribute("scripts", "/templates/visualization/visualization_scripts.jsp");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -352,7 +355,7 @@ public class VisualizationRequestHandler {
|
||||||
RequestDispatcher requestDispatcher = request.getRequestDispatcher(Controllers.BASIC_JSP);
|
RequestDispatcher requestDispatcher = request.getRequestDispatcher(Controllers.BASIC_JSP);
|
||||||
request.setAttribute("bodyJsp", "/templates/visualization/visualization_error.jsp");
|
request.setAttribute("bodyJsp", "/templates/visualization/visualization_error.jsp");
|
||||||
request.setAttribute("portalBean", portal);
|
request.setAttribute("portalBean", portal);
|
||||||
request.setAttribute("title", "Visualization Query Error - Person Publication Count");
|
request.setAttribute("title", "Visualization Query Error - Individual Publication Count");
|
||||||
|
|
||||||
try {
|
try {
|
||||||
requestDispatcher.forward(request, response);
|
requestDispatcher.forward(request, response);
|
||||||
|
|
|
@ -4,50 +4,24 @@ import java.util.Calendar;
|
||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
public class BiboDocument {
|
public class BiboDocument extends Individual{
|
||||||
|
|
||||||
public static final String DEFAULT_PUBLICATION_YEAR = "Unknown";
|
public static final String DEFAULT_PUBLICATION_YEAR = "Unknown";
|
||||||
public static final int MINIMUM_PUBLICATION_YEAR = 1800;
|
public static final int MINIMUM_PUBLICATION_YEAR = 1800;
|
||||||
private static final int CURRENT_YEAR = Calendar.getInstance().get(Calendar.YEAR);
|
private static final int CURRENT_YEAR = Calendar.getInstance().get(Calendar.YEAR);
|
||||||
|
|
||||||
private String authorURL;
|
|
||||||
private String authorLabel;
|
|
||||||
private String documentURL;
|
|
||||||
private String documentMoniker;
|
private String documentMoniker;
|
||||||
private String documentLabel;
|
|
||||||
private String documentBlurb;
|
private String documentBlurb;
|
||||||
private String documentDescription;
|
private String documentDescription;
|
||||||
private String publicationYear;
|
private String publicationYear;
|
||||||
private String parsedPublicationYear = DEFAULT_PUBLICATION_YEAR;
|
private String parsedPublicationYear = DEFAULT_PUBLICATION_YEAR;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public BiboDocument(String documentURL) {
|
public BiboDocument(String documentURL) {
|
||||||
this.documentURL = documentURL;
|
super(documentURL);
|
||||||
}
|
|
||||||
|
|
||||||
public String getAuthorURL() {
|
|
||||||
return authorURL;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAuthorURL(String authorURL) {
|
|
||||||
this.authorURL = authorURL;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getAuthorLabel() {
|
|
||||||
return authorLabel;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAuthorLabel(String authorLabel) {
|
|
||||||
this.authorLabel = authorLabel;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getDocumentURL() {
|
public String getDocumentURL() {
|
||||||
return documentURL;
|
return this.getIndividualURL();
|
||||||
}
|
|
||||||
|
|
||||||
public void setDocumentURL(String documentURL) {
|
|
||||||
this.documentURL = documentURL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getDocumentMoniker() {
|
public String getDocumentMoniker() {
|
||||||
|
@ -59,11 +33,11 @@ public class BiboDocument {
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getDocumentLabel() {
|
public String getDocumentLabel() {
|
||||||
return documentLabel;
|
return this.getIndividualLabel();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDocumentLabel(String documentLabel) {
|
public void setDocumentLabel(String documentLabel) {
|
||||||
this.documentLabel = documentLabel;
|
this.setIndividualLabel(documentLabel);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getDocumentBlurb() {
|
public String getDocumentBlurb() {
|
||||||
|
|
|
@ -0,0 +1,30 @@
|
||||||
|
package edu.cornell.mannlib.vitro.webapp.visualization.valueobjects;
|
||||||
|
|
||||||
|
public class Individual {
|
||||||
|
|
||||||
|
private String individualLabel;
|
||||||
|
private String individualURL;
|
||||||
|
|
||||||
|
public Individual(String individualURL, String individualLabel) {
|
||||||
|
this.individualLabel = individualLabel;
|
||||||
|
this.individualURL = individualURL;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Individual(String individualURL) {
|
||||||
|
this(individualURL, "");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getIndividualLabel() {
|
||||||
|
return individualLabel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIndividualLabel(String individualLabel) {
|
||||||
|
this.individualLabel = individualLabel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getIndividualURL() {
|
||||||
|
return individualURL;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -9,14 +9,12 @@ import java.util.Set;
|
||||||
* @author cdtank
|
* @author cdtank
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class VivoCollegeOrSchool {
|
public class VivoCollegeOrSchool extends Individual {
|
||||||
|
|
||||||
private String collegeURL;
|
|
||||||
private String collegeLabel;
|
|
||||||
private Set<VivoDepartmentOrDivision> departments = new HashSet<VivoDepartmentOrDivision>();
|
private Set<VivoDepartmentOrDivision> departments = new HashSet<VivoDepartmentOrDivision>();
|
||||||
|
|
||||||
public VivoCollegeOrSchool(String collegeURL) {
|
public VivoCollegeOrSchool(String collegeURL) {
|
||||||
this.collegeURL = collegeURL;
|
super(collegeURL);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Set<VivoDepartmentOrDivision> getDepartments() {
|
public Set<VivoDepartmentOrDivision> getDepartments() {
|
||||||
|
@ -28,19 +26,15 @@ public class VivoCollegeOrSchool {
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getCollegeURL() {
|
public String getCollegeURL() {
|
||||||
return collegeURL;
|
return this.getIndividualURL();
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getCollegeLabel() {
|
public String getCollegeLabel() {
|
||||||
if (collegeLabel != null) {
|
return this.getIndividualLabel();
|
||||||
return collegeLabel;
|
|
||||||
} else {
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCollegeLabel(String collegeLabel) {
|
public void setCollegeLabel(String collegeLabel) {
|
||||||
this.collegeLabel = collegeLabel;
|
this.setIndividualLabel(collegeLabel);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,14 +9,12 @@ import java.util.Set;
|
||||||
* @author cdtank
|
* @author cdtank
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class VivoDepartmentOrDivision {
|
public class VivoDepartmentOrDivision extends Individual {
|
||||||
|
|
||||||
private String departmentURL;
|
|
||||||
private String departmentLabel;
|
|
||||||
private Set<VivoCollegeOrSchool> parentColleges = new HashSet<VivoCollegeOrSchool>();
|
private Set<VivoCollegeOrSchool> parentColleges = new HashSet<VivoCollegeOrSchool>();
|
||||||
|
|
||||||
public VivoDepartmentOrDivision(String departmentURL, VivoCollegeOrSchool parentCollege) {
|
public VivoDepartmentOrDivision(String departmentURL, VivoCollegeOrSchool parentCollege) {
|
||||||
this.departmentURL = departmentURL;
|
super(departmentURL);
|
||||||
addParentCollege(parentCollege);
|
addParentCollege(parentCollege);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -29,19 +27,15 @@ public class VivoDepartmentOrDivision {
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getDepartmentURL() {
|
public String getDepartmentURL() {
|
||||||
return departmentURL;
|
return this.getIndividualURL();
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getDepartmentLabel() {
|
public String getDepartmentLabel() {
|
||||||
if (departmentLabel != null) {
|
return this.getIndividualLabel();
|
||||||
return departmentLabel;
|
|
||||||
} else {
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDepartmentLabel(String departmentLabel) {
|
public void setDepartmentLabel(String departmentLabel) {
|
||||||
this.departmentLabel = departmentLabel;
|
this.setIndividualLabel(departmentLabel);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,24 +11,25 @@ import edu.cornell.mannlib.vitro.webapp.visualization.valueobjects.VOConstants.E
|
||||||
* @author cdtank
|
* @author cdtank
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class VivoEmployee {
|
public class VivoEmployee extends Individual{
|
||||||
|
|
||||||
private String employeeURL;
|
|
||||||
private EmployeeType employeeType;
|
private EmployeeType employeeType;
|
||||||
private Set<VivoDepartmentOrDivision> parentDepartments = new HashSet<VivoDepartmentOrDivision>();
|
private Set<VivoDepartmentOrDivision> parentDepartments = new HashSet<VivoDepartmentOrDivision>();
|
||||||
private Set<BiboDocument> authorDocuments = new HashSet<BiboDocument>();
|
private Set<BiboDocument> authorDocuments = new HashSet<BiboDocument>();
|
||||||
|
|
||||||
public VivoEmployee(String employeeURL, EmployeeType employeeType, VivoDepartmentOrDivision parentDepartment) {
|
public VivoEmployee(String employeeURL,
|
||||||
this.employeeURL = employeeURL;
|
EmployeeType employeeType,
|
||||||
|
VivoDepartmentOrDivision parentDepartment) {
|
||||||
|
super(employeeURL);
|
||||||
addParentDepartment(parentDepartment);
|
addParentDepartment(parentDepartment);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getEmployeeURL() {
|
public String getEmployeeURL() {
|
||||||
return employeeURL;
|
return this.getIndividualURL();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setEmployeeURL(String employeeURL) {
|
public String getEmployeeName() {
|
||||||
this.employeeURL = employeeURL;
|
return this.getIndividualLabel();
|
||||||
}
|
}
|
||||||
|
|
||||||
public EmployeeType getEmployeeType() {
|
public EmployeeType getEmployeeType() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue