From 9216cebd5e044b11cb1244165ae97f00fd1a54d8 Mon Sep 17 00:00:00 2001 From: Graham Triggs Date: Thu, 23 Jun 2016 18:53:53 +0100 Subject: [PATCH 01/60] Changes required for releasing to Maven Central --- pom.xml | 119 +++++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 87 insertions(+), 32 deletions(-) diff --git a/pom.xml b/pom.xml index 851f0260..900c9d35 100644 --- a/pom.xml +++ b/pom.xml @@ -10,6 +10,30 @@ 1.9.0-SNAPSHOT pom + VIVO + VIVO project + http://vivoweb.org/ + + + + BSD 3-Clause License + https://raw.github.com/vivo-project/VIVO/develop/LICENSE + repo + + + + + + scm:git:git@github.com:vivo-project/VIVO.git + scm:git:git@github.com:vivo-project/VIVO.git + git@github.com:vivo-project/VIVO.git + HEAD + + ${project.version} ${basedir} @@ -17,8 +41,6 @@ ${maven.build.timestamp} - VIVO - api webapp @@ -59,6 +81,63 @@ ${vivo-installer-dir} + + doclint-java8-disable + + [1.8,) + + + -Xdoclint:none + + + + release + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.9.1 + + + attach-javadocs + + jar + + + + + true + ${javadoc.opts} + + + + org.apache.maven.plugins + maven-source-plugin + 2.2.1 + + + attach-sources + + jar-no-fork + + + + + + org.sonatype.plugins + nexus-staging-maven-plugin + 1.6.3 + true + + ossrh + https://oss.sonatype.org/ + true + + + + + @@ -86,25 +165,6 @@ - - org.codehaus.mojo - properties-maven-plugin - 1.0.0 - - - initialize - - read-project-properties - - - - build.properties - - true - - - - org.apache.maven.plugins maven-compiler-plugin @@ -147,15 +207,10 @@ - - - scm:git:git@github.com:vivo-project/VIVO.git - scm:git:git@github.com:vivo-project/VIVO.git - git@github.com:vivo-project/VIVO.git - HEAD - + + + ossrh + https://oss.sonatype.org/content/repositories/snapshots + + From c364dec722a5f0fc0e0a7aee3f55c229fde6886b Mon Sep 17 00:00:00 2001 From: Graham Triggs Date: Thu, 23 Jun 2016 19:12:05 +0100 Subject: [PATCH 02/60] Exclude installer from Maven Central deployment --- installer/pom.xml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/installer/pom.xml b/installer/pom.xml index 62d9ee4b..7f98035b 100644 --- a/installer/pom.xml +++ b/installer/pom.xml @@ -21,6 +21,13 @@ true + + maven-deploy-plugin + 2.7 + + true + + From 20ab5259c09b9a70b69ad5ae3c3571581e110006 Mon Sep 17 00:00:00 2001 From: Graham Triggs Date: Thu, 23 Jun 2016 20:03:22 +0100 Subject: [PATCH 03/60] JavaDoc changes required to prevent the release process breaking. --- .../mannlib/semservices/bo/BaseObject.java | 3 -- .../semservices/bo/SemanticServicesError.java | 6 ++-- .../service/ExternalConceptService.java | 9 ++---- .../service/impl/AgrovocService.java | 6 ++-- .../service/impl/GemetService.java | 30 +++++++------------ .../semservices/service/impl/LCSHService.java | 6 ++-- .../semservices/service/impl/UMLSService.java | 11 +++---- .../mannlib/semservices/util/XMLUtils.java | 28 ++++++++--------- .../VisualizationsDependencyInjector.java | 3 +- .../AddGrantRoleToPersonGenerator.java | 6 ++-- .../AddRoleToPersonTwoStageGenerator.java | 2 -- .../CoAuthorshipRequestHandler.java | 9 ++---- .../CoAuthorshipVisCodeGenerator.java | 4 +-- .../CoPIGrantCountRequestHandler.java | 9 ++---- .../CoPIVisCodeGenerator.java | 4 +-- .../PersonGrantCountRequestHandler.java | 17 +++++------ .../PersonGrantCountVisCodeGenerator.java | 6 ++-- .../PersonPublicationCountRequestHandler.java | 19 +++++------- ...ersonPublicationCountVisCodeGenerator.java | 5 ++-- .../utilities/CachingRDFServiceExecutor.java | 20 +++++-------- .../utilities/VisualizationCaches.java | 2 +- .../visualization/valueobjects/Activity.java | 2 -- .../visualization/visutils/PDFDocument.java | 12 ++++---- .../visutils/UtilityFunctions.java | 12 +++----- 24 files changed, 89 insertions(+), 142 deletions(-) diff --git a/api/src/main/java/edu/cornell/mannlib/semservices/bo/BaseObject.java b/api/src/main/java/edu/cornell/mannlib/semservices/bo/BaseObject.java index 6be8ebcb..ce4d8aa6 100644 --- a/api/src/main/java/edu/cornell/mannlib/semservices/bo/BaseObject.java +++ b/api/src/main/java/edu/cornell/mannlib/semservices/bo/BaseObject.java @@ -5,9 +5,6 @@ public class BaseObject { /** * Simple JavaBean domain object with an id property. * Used as a base class for objects needing this property. - * - * @author Ken Krebs - * @author Juergen Hoeller */ private Integer id; diff --git a/api/src/main/java/edu/cornell/mannlib/semservices/bo/SemanticServicesError.java b/api/src/main/java/edu/cornell/mannlib/semservices/bo/SemanticServicesError.java index e6107e94..1a1a63c5 100644 --- a/api/src/main/java/edu/cornell/mannlib/semservices/bo/SemanticServicesError.java +++ b/api/src/main/java/edu/cornell/mannlib/semservices/bo/SemanticServicesError.java @@ -17,9 +17,9 @@ public class SemanticServicesError { /** - * @param exception - * @param message - * @param severity + * @param exception Exception description + * @param message Error message + * @param severity Severity */ public SemanticServicesError(String exception, String message, String severity) { super(); diff --git a/api/src/main/java/edu/cornell/mannlib/semservices/service/ExternalConceptService.java b/api/src/main/java/edu/cornell/mannlib/semservices/service/ExternalConceptService.java index 034df4e3..dc19fdff 100644 --- a/api/src/main/java/edu/cornell/mannlib/semservices/service/ExternalConceptService.java +++ b/api/src/main/java/edu/cornell/mannlib/semservices/service/ExternalConceptService.java @@ -9,21 +9,18 @@ import edu.cornell.mannlib.semservices.bo.Concept; public interface ExternalConceptService { /** - * @param term - * @return + * @param term Term */ List processResults(String term) throws Exception; /** - * @param term - * @return + * @param term Term * @throws Exception */ List getConcepts(String term) throws Exception; /** - * @param uri - * @return + * @param uri URI */ List getConceptsByURIWithSparql(String uri) throws Exception; diff --git a/api/src/main/java/edu/cornell/mannlib/semservices/service/impl/AgrovocService.java b/api/src/main/java/edu/cornell/mannlib/semservices/service/impl/AgrovocService.java index 8f636c07..d8fe9b87 100644 --- a/api/src/main/java/edu/cornell/mannlib/semservices/service/impl/AgrovocService.java +++ b/api/src/main/java/edu/cornell/mannlib/semservices/service/impl/AgrovocService.java @@ -481,8 +481,7 @@ public class AgrovocService implements ExternalConceptService { } /** - * @param uri - * @return + * @param uri The URI */ protected String stripConceptId(String uri) { String conceptId = new String(); @@ -492,8 +491,7 @@ public class AgrovocService implements ExternalConceptService { } /** - * @param str - * @return + * @param str The String */ protected String extractConceptId(String str) { try { diff --git a/api/src/main/java/edu/cornell/mannlib/semservices/service/impl/GemetService.java b/api/src/main/java/edu/cornell/mannlib/semservices/service/impl/GemetService.java index 6f78ba2d..d3911fbf 100644 --- a/api/src/main/java/edu/cornell/mannlib/semservices/service/impl/GemetService.java +++ b/api/src/main/java/edu/cornell/mannlib/semservices/service/impl/GemetService.java @@ -75,8 +75,7 @@ public class GemetService implements ExternalConceptService { } /** - * @param results - * @return + * @param results Results to process */ private List processOutput(String results) throws Exception { @@ -145,9 +144,8 @@ public class GemetService implements ExternalConceptService { /** * Get a string from a json object or an empty string if there is no value for the given key - * @param obj - * @param key - * @return + * @param obj JSON Object + * @param key Key to retrieve */ protected String getJsonValue(JSONObject obj, String key) { if (obj.has(key)) { @@ -159,8 +157,7 @@ public class GemetService implements ExternalConceptService { /** - * @param concept_uri - * @return + * @param concept_uri Concept URI * @throws Exception */ protected String getAvailableLangs(String concept_uri) throws Exception { @@ -177,8 +174,7 @@ public class GemetService implements ExternalConceptService { } /** - * @param concept_uri - * @return + * @param concept_uri concept URI * @throws Exception */ protected String getConcept(String concept_uri) throws Exception { @@ -196,9 +192,8 @@ public class GemetService implements ExternalConceptService { } /** - * @param concept_uri - * @param property - * @return + * @param concept_uri Concept URI + * @param property Property * @throws Exception */ protected String getAllTranslationsForConcept(String concept_uri, String property) throws Exception { @@ -235,9 +230,8 @@ public class GemetService implements ExternalConceptService { /** - * @param concept_uri - * @param relation - * @return + * @param concept_uri Concept URI + * @param relation Relations * @throws Exception */ protected String getRelatedConcepts(String concept_uri, String relation) throws Exception { @@ -266,8 +260,7 @@ public class GemetService implements ExternalConceptService { /** - * @param keyword - * @return + * @param keyword Keyword * @throws Exception */ protected String getConceptsMatchingKeyword(String keyword) throws Exception { @@ -288,8 +281,7 @@ public class GemetService implements ExternalConceptService { } /** - * @param url - * @return + * @param url URI */ protected String getGemetResults(String url) throws Exception { String results = new String(); diff --git a/api/src/main/java/edu/cornell/mannlib/semservices/service/impl/LCSHService.java b/api/src/main/java/edu/cornell/mannlib/semservices/service/impl/LCSHService.java index 582977aa..4e5146ed 100644 --- a/api/src/main/java/edu/cornell/mannlib/semservices/service/impl/LCSHService.java +++ b/api/src/main/java/edu/cornell/mannlib/semservices/service/impl/LCSHService.java @@ -221,8 +221,7 @@ public class LCSHService implements ExternalConceptService { } /** - * @param uri - * @return + * @param uri URI */ protected String stripConceptId(String uri) { String conceptId = new String(); @@ -232,8 +231,7 @@ public class LCSHService implements ExternalConceptService { } /** - * @param str - * @return + * @param str String with concept id */ protected String extractConceptId(String str) { try { diff --git a/api/src/main/java/edu/cornell/mannlib/semservices/service/impl/UMLSService.java b/api/src/main/java/edu/cornell/mannlib/semservices/service/impl/UMLSService.java index ef930223..d29955de 100644 --- a/api/src/main/java/edu/cornell/mannlib/semservices/service/impl/UMLSService.java +++ b/api/src/main/java/edu/cornell/mannlib/semservices/service/impl/UMLSService.java @@ -97,8 +97,7 @@ public class UMLSService implements ExternalConceptService { } /** - * @param uri - * @return + * @param uri URI */ public List getConceptsByURIWithSparql(String uri) throws Exception { @@ -108,8 +107,7 @@ public class UMLSService implements ExternalConceptService { } /** - * @param results - * @return + * @param results Results to process */ private List processOutput(String results) throws Exception { @@ -193,9 +191,8 @@ public class UMLSService implements ExternalConceptService { /** * Get a string from a json object or an empty string if there is no value for the given key - * @param obj - * @param key - * @return + * @param obj JSON Object + * @param key Key to retrieve */ protected String getJsonValue(JSONObject obj, String key) { if (obj.has(key)) { diff --git a/api/src/main/java/edu/cornell/mannlib/semservices/util/XMLUtils.java b/api/src/main/java/edu/cornell/mannlib/semservices/util/XMLUtils.java index faa2c913..8afbb484 100644 --- a/api/src/main/java/edu/cornell/mannlib/semservices/util/XMLUtils.java +++ b/api/src/main/java/edu/cornell/mannlib/semservices/util/XMLUtils.java @@ -50,7 +50,6 @@ public class XMLUtils { /** - * @return * @throws ParserConfigurationException */ public static DocumentBuilder getDocumentBuilder() @@ -68,8 +67,7 @@ public class XMLUtils { } /** - * @param xmlString - * @return + * @param xmlString XML String * @throws IOException * @throws SAXException * @throws ParserConfigurationException @@ -82,8 +80,7 @@ public class XMLUtils { } /** - * @param stream - * @return + * @param stream Input stream * @throws IOException * @throws SAXException * @throws ParserConfigurationException @@ -94,9 +91,8 @@ public class XMLUtils { } /** - * @param document - * @param name - * @return + * @param document DOM Document + * @param name Name */ public static String getElementByName(Document document, String name) { NodeList nodes = document.getElementsByTagName(name); @@ -109,7 +105,7 @@ public class XMLUtils { } /** - * @param doc + * @param doc DOM Document * @throws IOException */ @SuppressWarnings("deprecation") @@ -130,7 +126,7 @@ public class XMLUtils { } /** - * @param xml + * @param xml XML String */ public static void prettyPrint(String xml) { Source xmlInput = new StreamSource(new StringReader(xml)); @@ -160,7 +156,7 @@ public class XMLUtils { } /** - * @param xml + * @param xml XML String */ public static String prettyPrintToString(String xml) { Source xmlInput = new StreamSource(new StringReader(xml)); @@ -190,7 +186,7 @@ public class XMLUtils { } /** - * @param node + * @param node DOM Node */ public static void displayNodeInfo(Node node) { switch (node.getNodeType()) { @@ -222,7 +218,7 @@ public class XMLUtils { } /** - * @param node + * @param node DOM Node * @throws IOException */ public static void serializeNode(Node node) throws IOException { @@ -308,7 +304,7 @@ public class XMLUtils { } /** - * @param s + * @param s String * @throws IOException */ private static void print(String s) throws IOException { @@ -336,8 +332,8 @@ public class XMLUtils { } /** - * @param doc (either a Document or a Node) - * @param expression + * @param obj (either a Document or a Node) + * @param expression Expression * @return string contents */ public static Node getNodeWithXpath(Object obj, String expression) { diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/visualization/VisualizationsDependencyInjector.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/visualization/VisualizationsDependencyInjector.java index d358e196..c7918202 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/visualization/VisualizationsDependencyInjector.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/visualization/VisualizationsDependencyInjector.java @@ -19,8 +19,7 @@ public class VisualizationsDependencyInjector { * This method is used to inject vis dependencies i.e. the vis algorithms that are * being implemented into the vis controller. Modified Dependency Injection pattern is * used here. XML file containing the location of all the vis is saved in accessible folder. - * @param servletContext - * @return + * @param servletContext Servlet context */ private synchronized static Map initVisualizations( ServletContext servletContext) { diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddGrantRoleToPersonGenerator.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddGrantRoleToPersonGenerator.java index 6a543eea..de29375e 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddGrantRoleToPersonGenerator.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddGrantRoleToPersonGenerator.java @@ -556,9 +556,9 @@ public class AddGrantRoleToPersonGenerator implements EditConfigurationGenerator /** * Prepare edit configuration for update - * @param vreq - * @param session - * @param editConfiguration + * @param vreq - current VitroRequest + * @param session - the HTTP session + * @param editConfiguration - Edit configuration */ private void prepareForUpdate(VitroRequest vreq, HttpSession session, EditConfigurationVTwo editConfiguration) { diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddRoleToPersonTwoStageGenerator.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddRoleToPersonTwoStageGenerator.java index 575c0345..e7dfa60f 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddRoleToPersonTwoStageGenerator.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddRoleToPersonTwoStageGenerator.java @@ -436,7 +436,6 @@ public abstract class AddRoleToPersonTwoStageGenerator extends BaseEditConfigura /** * Utility method for subclasses to make a query for type from a ChildVClassesOptions object. - * @throws Exception */ protected String getActivityTypeQueryForChildVClassOptions(VitroRequest vreq, ChildVClassesOptions opts){ log.debug("objectClassUri = " + opts.getClassUri()); @@ -447,7 +446,6 @@ public abstract class AddRoleToPersonTwoStageGenerator extends BaseEditConfigura /** * Utility method for subclasses to make a query for type from a IndividualsViaClassGroupOptions object. - * @throws Exception */ protected String getActivityTypeQueryForIndividualsViaClassGroupOptions(VitroRequest vreq, IndividualsViaClassGroupOptions opts){ log.debug("ClassGroupUri = " + opts.getClassGroupUri()); diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/coauthorship/CoAuthorshipRequestHandler.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/coauthorship/CoAuthorshipRequestHandler.java index 032fe280..032eecf5 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/coauthorship/CoAuthorshipRequestHandler.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/coauthorship/CoAuthorshipRequestHandler.java @@ -177,8 +177,7 @@ public class CoAuthorshipRequestHandler implements VisualizationRequestHandler { /** * Provides response when a csv file containing number & names of unique co-authors per * year is requested. - * @param authorNodesAndEdges - * @param response + * @param authorNodesAndEdges Author nodes and edges */ private Map prepareCoauthorsCountPerYearDataResponse( CollaborationData authorNodesAndEdges) { @@ -214,8 +213,7 @@ public class CoAuthorshipRequestHandler implements VisualizationRequestHandler { /** * Provides response when a csv file containing number & names of unique co-authors per * year is requested. - * @param authorNodesAndEdges - * @param response + * @param coAuthorshipData Co authorship data */ private Map prepareCoauthorsListDataResponse( CollaborationData coAuthorshipData) { @@ -246,8 +244,7 @@ public class CoAuthorshipRequestHandler implements VisualizationRequestHandler { /** * Provides a response when graphml formatted co-authorship network is requested, typically by * the flash vis. - * @param authorNodesAndEdges - * @param response + * @param authorNodesAndEdges Author nodes and edges */ private Map prepareNetworkStreamDataResponse( CollaborationData authorNodesAndEdges) { diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/coauthorship/CoAuthorshipVisCodeGenerator.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/coauthorship/CoAuthorshipVisCodeGenerator.java index 28423d1e..a29405b0 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/coauthorship/CoAuthorshipVisCodeGenerator.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/coauthorship/CoAuthorshipVisCodeGenerator.java @@ -62,8 +62,8 @@ public class CoAuthorshipVisCodeGenerator { /** * This method is used to setup parameters for the sparkline value object. These parameters * will be used in the template to construct the actual html/javascript code. - * @param visMode - * @param visContainer + * @param visMode Visualization mode + * @param providedVisContainerID Container ID */ private SparklineData setupSparklineParameters(String visMode, String providedVisContainerID) { diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/coprincipalinvestigator/CoPIGrantCountRequestHandler.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/coprincipalinvestigator/CoPIGrantCountRequestHandler.java index 46b03088..ccab1d45 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/coprincipalinvestigator/CoPIGrantCountRequestHandler.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/coprincipalinvestigator/CoPIGrantCountRequestHandler.java @@ -174,8 +174,7 @@ public class CoPIGrantCountRequestHandler implements VisualizationRequestHandler /** * Provides response when a csv file containing number & names of unique co-pis per * year is requested. - * @param piNodesAndEdges - * @param response + * @param piNodesAndEdges PI nodes and edges */ private Map prepareCoPIsCountPerYearDataResponse( CollaborationData piNodesAndEdges) { @@ -211,8 +210,7 @@ public class CoPIGrantCountRequestHandler implements VisualizationRequestHandler /** * Provides response when a csv file containing number & names of unique co-pis per * year is requested. - * @param coPIData - * @param response + * @param coPIData Co Principal Investigator Data */ private Map prepareCoPIsListDataResponse(CollaborationData coPIData) { @@ -242,8 +240,7 @@ public class CoPIGrantCountRequestHandler implements VisualizationRequestHandler /** * Provides a response when graphml formatted co-pi network is requested, typically by * the flash vis. - * @param coPIData - * @param response + * @param coPIData Co Investigator data */ private Map prepareNetworkStreamDataResponse(CollaborationData coPIData) { diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/coprincipalinvestigator/CoPIVisCodeGenerator.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/coprincipalinvestigator/CoPIVisCodeGenerator.java index 73c38f47..67040ba7 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/coprincipalinvestigator/CoPIVisCodeGenerator.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/coprincipalinvestigator/CoPIVisCodeGenerator.java @@ -69,8 +69,8 @@ public class CoPIVisCodeGenerator { /** * This method is used to setup parameters for the sparkline value object. These parameters * will be used in the template to construct the actual html/javascript code. - * @param visMode - * @param visContainer + * @param visMode Visualization mode + * @param providedVisContainerID Container ID */ private SparklineData setupSparklineParameters(String visMode, String providedVisContainerID) { diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/persongrantcount/PersonGrantCountRequestHandler.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/persongrantcount/PersonGrantCountRequestHandler.java index 30951355..edaba894 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/persongrantcount/PersonGrantCountRequestHandler.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/persongrantcount/PersonGrantCountRequestHandler.java @@ -199,9 +199,8 @@ public class PersonGrantCountRequestHandler implements VisualizationRequestHandl /** * Provides response when csv file containing the grant count over the years * is requested. - * @param investigator - * @param yearToGrantCount - * @return + * @param investigator Investigator entiry + * @param yearToGrantCount Year / grant counts */ private Map prepareDataResponse( SubEntity investigator, @@ -225,9 +224,8 @@ public class PersonGrantCountRequestHandler implements VisualizationRequestHandl /** * Provides response when an entire page dedicated to grant sparkline is requested. - * @param vreq - * @param valueObjectContainer - * @return + * @param vreq Vitro Request + * @param valueObjectContainer Sparkline data */ private TemplateResponseValues prepareStandaloneResponse(VitroRequest vreq, SparklineData valueObjectContainer) { @@ -245,10 +243,9 @@ public class PersonGrantCountRequestHandler implements VisualizationRequestHandl /** * Provides response when the grant sparkline has to be rendered in already existing * page, e.g. profile page. - * @param vreq - * @param valueObjectContainer - * @param shouldVIVOrenderVis - * @return + * @param vreq Vitro Request + * @param valueObjectContainer Sparkline data + * @param shouldVIVOrenderVis Flag to render visualization */ private TemplateResponseValues prepareDynamicResponse( VitroRequest vreq, diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/persongrantcount/PersonGrantCountVisCodeGenerator.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/persongrantcount/PersonGrantCountVisCodeGenerator.java index 9afbdb05..b237e3a8 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/persongrantcount/PersonGrantCountVisCodeGenerator.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/persongrantcount/PersonGrantCountVisCodeGenerator.java @@ -60,10 +60,8 @@ public class PersonGrantCountVisCodeGenerator { /** * This method is used to setup parameters for the sparkline value object. These parameters * will be used in the template to construct the actual html/javascript code. - * @param visMode - * @param visContainer - * @param authorDocuments - * @return + * @param visMode Visualisation mode + * @param providedVisContainerID Container ID */ private SparklineData setupSparklineParameters(String visMode, String providedVisContainerID) { diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/personpubcount/PersonPublicationCountRequestHandler.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/personpubcount/PersonPublicationCountRequestHandler.java index 45215ee7..72acecfe 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/personpubcount/PersonPublicationCountRequestHandler.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/personpubcount/PersonPublicationCountRequestHandler.java @@ -217,10 +217,8 @@ VisualizationRequestHandler { * Provides response when csv file containing the publication count over the * years is requested. * - * @param author - * @param authorDocuments - * @param yearToPublicationCount - * @return + * @param authorName Name of author + * @param yearToPublicationCount Year / publication counts */ private Map prepareDataResponse(String authorName, Map yearToPublicationCount) { @@ -251,9 +249,8 @@ VisualizationRequestHandler { * Provides response when an entire page dedicated to publication sparkline * is requested. * - * @param vreq - * @param valueObjectContainer - * @return + * @param vreq Vitro Request + * @param valueObjectContainer Sparkline Data */ private TemplateResponseValues prepareStandaloneResponse(VitroRequest vreq, SparklineData valueObjectContainer) { @@ -272,10 +269,10 @@ VisualizationRequestHandler { * Provides response when the publication sparkline has to be rendered in * already existing page, e.g. profile page. * - * @param vreq - * @param valueObjectContainer - * @param yearToPublicationCount - * @return + * @param vreq Vitro Request + * @param valueObjectContainer Sparkline data + * @param shouldVIVOrenderVis Flag to render visualization + * @param requestingTemplate Requesting template name */ private TemplateResponseValues prepareDynamicResponse(VitroRequest vreq, SparklineData valueObjectContainer, boolean shouldVIVOrenderVis, String requestingTemplate) { diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/personpubcount/PersonPublicationCountVisCodeGenerator.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/personpubcount/PersonPublicationCountVisCodeGenerator.java index 46d6af8e..00daf01e 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/personpubcount/PersonPublicationCountVisCodeGenerator.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/personpubcount/PersonPublicationCountVisCodeGenerator.java @@ -62,9 +62,8 @@ public class PersonPublicationCountVisCodeGenerator { /** * This method is used to setup parameters for the sparkline value object. These parameters * will be used in the template to construct the actual html/javascript code. - * @param visMode - * @param visContainer - * @return + * @param visMode Visualization mode + * @param providedVisContainerID container id */ private SparklineData setupSparklineParameters(String visMode, String providedVisContainerID) { diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/utilities/CachingRDFServiceExecutor.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/utilities/CachingRDFServiceExecutor.java index a028b711..2b9e9f8a 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/utilities/CachingRDFServiceExecutor.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/utilities/CachingRDFServiceExecutor.java @@ -59,7 +59,6 @@ public class CachingRDFServiceExecutor { * Will wait for completion if the cache is not already populated, otherwise the refresh will happen in the background. * * @param rdfService an RDF service to use, in foreground mode, if the background service is missing - * @return */ public synchronized T get(RDFService rdfService) { // First, check if there are results from the previous background task, and update the cache @@ -171,7 +170,7 @@ public class CachingRDFServiceExecutor { /** * Create and start a background thread using the configured task - * @param rdfService + * @param rdfService An RDFService */ private void startBackgroundTask(RDFService rdfService) { // Ensure that there isn't already a task @@ -271,7 +270,7 @@ public class CachingRDFServiceExecutor { /** * Set the RDF service to be used for background threads (called from a startup servlet) - * @param rdfService + * @param rdfService An RDFService */ public static void setBackgroundRDFService(RDFService rdfService) { backgroundRDFService = rdfService; @@ -299,13 +298,13 @@ public class CachingRDFServiceExecutor { /** * Constructor that allows an affinity object to be supplied - * @param affinity + * @param affinity Affinity */ public RDFServiceCallable(Affinity affinity) { this.affinity = affinity; } /** * Set the RDF service to be used - * @param rdfService + * @param rdfService An RDFService */ final void setRDFService(RDFService rdfService) { this.rdfService = rdfService; @@ -313,7 +312,6 @@ public class CachingRDFServiceExecutor { /** * Entry point for the background threads, ensuring the right start / cleanup is done - * @return * @throws Exception */ @Override @@ -349,8 +347,7 @@ public class CachingRDFServiceExecutor { /** * Method for users to implement, to return the results - * @param rdfService - * @return + * @param rdfService An RDFService * @throws Exception */ protected abstract T callWithService(RDFService rdfService) throws Exception; @@ -358,8 +355,7 @@ public class CachingRDFServiceExecutor { /** * Method to determine if the cache should be invalidated for the current results * Default implementation dynamically adjusts the cache time based on the efficiency of creating results - * @param timeCached - * @return + * @param timeCached The time of caching */ boolean invalidateCache(long timeCached) { if (executionTime > -1) { @@ -416,8 +412,8 @@ public class CachingRDFServiceExecutor { /** * Adds a thread to the map, returns whether the thread needs to wait - * @param thread - * @param time + * @param thread The thread to add + * @param time start time of the thread * @return true if the thread needs to wait, false if it can continue */ private synchronized boolean queueThis(Thread thread, Long time) { diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/utilities/VisualizationCaches.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/utilities/VisualizationCaches.java index 4195239d..fd062f1a 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/utilities/VisualizationCaches.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/utilities/VisualizationCaches.java @@ -82,7 +82,7 @@ final public class VisualizationCaches { /** * Rebuild the specifield caches - * @param executors + * @param executors Caching RDF executors */ public static void rebuild(CachingRDFServiceExecutor... executors) { if (executors != null) { diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/valueobjects/Activity.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/valueobjects/Activity.java index cf015d8a..eb3c9867 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/valueobjects/Activity.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/valueobjects/Activity.java @@ -36,7 +36,6 @@ public class Activity extends Individual { * The 2 choices, in order, are, * 1. parsed year from xs:DateTime object saved in core:dateTimeValue * 2. Default Publication Year - * @return */ public String getParsedActivityYear() { @@ -47,7 +46,6 @@ public class Activity extends Individual { /** * This method should be used to get the raw date & not the parsed publication year. * For the later use getParsedPublicationYear. - * @return */ public String getActivityDate() { return activityDate; diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/visutils/PDFDocument.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/visutils/PDFDocument.java index d6a737cf..15b72e32 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/visutils/PDFDocument.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/visutils/PDFDocument.java @@ -155,9 +155,9 @@ public class PDFDocument { /** * Prints a square and fills half of it with a gray rectangle. - * @param x - * @param y - * @param cb + * @param x X coordinate + * @param y Y coordinate + * @param cb Content byte * @throws Exception */ public void pictureBackdrop(float x, float y, PdfContentByte cb) throws Exception { @@ -172,9 +172,9 @@ public class PDFDocument { /** * Prints 3 circles in different colors that intersect with eachother. - * @param x - * @param y - * @param cb + * @param x X coordinate + * @param y Y coordinate + * @param cb Content byte * @throws Exception */ public void pictureCircles(float x, float y, PdfContentByte cb) throws Exception { diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/visutils/UtilityFunctions.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/visutils/UtilityFunctions.java index 4a99553c..247ea0cb 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/visutils/UtilityFunctions.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/visualization/visutils/UtilityFunctions.java @@ -77,8 +77,7 @@ public class UtilityFunctions { /** * This method is used to return a mapping between activity year & all the collaborators * that published with ego in that year. - * @param collaborationData - * @return + * @param collaborationData Collaboration data */ public static Map> getActivityYearToCollaborators( CollaborationData collaborationData) { @@ -121,8 +120,7 @@ public class UtilityFunctions { /** * Currently the approach for slugifying filenames is naive. In future if there is need, * we can write more sophisticated method. - * @param textToBeSlugified - * @return + * @param textToBeSlugified Text to process */ public static String slugify(String textToBeSlugified) { String textBlockSeparator = "-"; @@ -186,7 +184,6 @@ public class UtilityFunctions { * The 2 choices, in order, are, * 1. parsed year from core:DateTime object saved in core:dateTimeValue * 2. Default Entity Year - * @return */ public static String getValidYearFromCoreDateTimeString(String inputDate, String defaultYearInCaseOfError) { @@ -279,9 +276,8 @@ public class UtilityFunctions { * * This method will test whether the current uri is based off of default namespace. If so, * go ahead & provide local name. - * @param givenURI - * @param vitroRequest - * @return + * @param givenURI URI + * @param vitroRequest Vitro Request */ public static String getIndividualLocalName(String givenURI, VitroRequest vitroRequest) { From c14362b2453b89ed87a4a7eb50a54e5249c9a683 Mon Sep 17 00:00:00 2001 From: Graham Triggs Date: Thu, 23 Jun 2016 21:35:19 +0100 Subject: [PATCH 04/60] Ensure staged deployments are not automatically closed --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 900c9d35..914baa33 100644 --- a/pom.xml +++ b/pom.xml @@ -132,7 +132,7 @@ ossrh https://oss.sonatype.org/ - true + false From 020486145420a912c0ce85472ac5fe0b9d056386 Mon Sep 17 00:00:00 2001 From: Graham Triggs Date: Thu, 23 Jun 2016 21:51:20 +0100 Subject: [PATCH 05/60] Add GPG signing --- pom.xml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pom.xml b/pom.xml index 914baa33..cc8e1c51 100644 --- a/pom.xml +++ b/pom.xml @@ -124,6 +124,19 @@ + + org.apache.maven.plugins + maven-gpg-plugin + + + sign-artifacts + verify + + sign + + + + org.sonatype.plugins nexus-staging-maven-plugin From a584ae39ebf4f59b9576bc870c3b997928fb3582 Mon Sep 17 00:00:00 2001 From: Graham Triggs Date: Thu, 23 Jun 2016 22:22:45 +0100 Subject: [PATCH 06/60] Add developer information --- pom.xml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pom.xml b/pom.xml index cc8e1c51..53503423 100644 --- a/pom.xml +++ b/pom.xml @@ -22,6 +22,15 @@ + + + Graham Triggs + gtriggs@duraspace.org + DuraSpace + http://vivoweb.org/ + + + + + org.vivoweb + vivo-project + 1.9.0-SNAPSHOT + + VIVO Installer diff --git a/pom.xml b/pom.xml index 312ed083..7a7696f6 100644 --- a/pom.xml +++ b/pom.xml @@ -169,6 +169,24 @@ false + + org.codehaus.mojo + buildnumber-maven-plugin + 1.4 + + + validate + + create + + + + + false + false + 7 + + @@ -208,24 +226,6 @@ 1.7 - - org.codehaus.mojo - buildnumber-maven-plugin - 1.4 - - - validate - - create - - - - - false - false - 7 - - From 275f6f335b7432768242898466d3638161e424d5 Mon Sep 17 00:00:00 2001 From: Graham Triggs Date: Fri, 24 Jun 2016 20:28:26 +0100 Subject: [PATCH 10/60] Simplify dependency management --- api/pom.xml | 1 - home/pom.xml | 1 - installer/home/pom.xml | 1 - installer/pom.xml | 32 ++++++++++++++++++++++++++++++++ installer/solr/pom.xml | 1 - installer/webapp/pom.xml | 2 -- pom.xml | 12 ++++++++++++ 7 files changed, 44 insertions(+), 6 deletions(-) diff --git a/api/pom.xml b/api/pom.xml index d89a09ae..4c2c5e72 100644 --- a/api/pom.xml +++ b/api/pom.xml @@ -27,7 +27,6 @@ org.vivoweb vitro-dependencies - 1.9.0-SNAPSHOT pom diff --git a/home/pom.xml b/home/pom.xml index ba4c3c4a..a4d19b27 100644 --- a/home/pom.xml +++ b/home/pom.xml @@ -70,7 +70,6 @@ org.vivoweb vitro-home - 1.9.0-SNAPSHOT tar.gz diff --git a/installer/home/pom.xml b/installer/home/pom.xml index 0761559e..16568121 100644 --- a/installer/home/pom.xml +++ b/installer/home/pom.xml @@ -109,7 +109,6 @@ org.vivoweb vivo-home - 1.9.0-SNAPSHOT tar.gz diff --git a/installer/pom.xml b/installer/pom.xml index 046eca92..441a7ea8 100644 --- a/installer/pom.xml +++ b/installer/pom.xml @@ -22,6 +22,10 @@ VIVO Installer + + ${project.version} + + @@ -47,6 +51,34 @@ webapp + + + + org.vivoweb + vitro-solr + ${vitro-version} + war + + + org.vivoweb + vivo-home + ${vitro-version} + tar.gz + + + org.vivoweb + vivo-api + ${vitro-version} + + + org.vivoweb + vivo-webapp + ${vitro-version} + war + + + + skip-install diff --git a/installer/solr/pom.xml b/installer/solr/pom.xml index 70e7550f..6f2466f0 100644 --- a/installer/solr/pom.xml +++ b/installer/solr/pom.xml @@ -128,7 +128,6 @@ org.vivoweb vitro-solr - 1.9.0-SNAPSHOT war diff --git a/installer/webapp/pom.xml b/installer/webapp/pom.xml index 2e66f7f8..16ce72af 100644 --- a/installer/webapp/pom.xml +++ b/installer/webapp/pom.xml @@ -129,12 +129,10 @@ org.vivoweb vivo-api - 1.9.0-SNAPSHOT org.vivoweb vivo-webapp - 1.9.0-SNAPSHOT war diff --git a/pom.xml b/pom.xml index 7a7696f6..5f899060 100644 --- a/pom.xml +++ b/pom.xml @@ -206,6 +206,18 @@ test-jar test + + org.vivoweb + vitro-dependencies + ${vitro-version} + pom + + + org.vivoweb + vitro-home + ${vitro-version} + tar.gz + org.vivoweb vitro-webapp From 20fcf5958624d77fdb419bcbc49ecdcf8fc2e3d9 Mon Sep 17 00:00:00 2001 From: Graham Triggs Date: Fri, 24 Jun 2016 20:52:48 +0100 Subject: [PATCH 11/60] Skip GPG in installer --- installer/pom.xml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/installer/pom.xml b/installer/pom.xml index 441a7ea8..431a4817 100644 --- a/installer/pom.xml +++ b/installer/pom.xml @@ -35,6 +35,13 @@ true + + org.apache.maven.plugins + maven-gpg-plugin + + true + + maven-deploy-plugin 2.7 From fac3f75f456305e2bb9eb7496c092ae9a3f0252c Mon Sep 17 00:00:00 2001 From: Graham Triggs Date: Fri, 24 Jun 2016 20:57:50 +0100 Subject: [PATCH 12/60] Skip staging plugin --- installer/pom.xml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/installer/pom.xml b/installer/pom.xml index 431a4817..d93a2175 100644 --- a/installer/pom.xml +++ b/installer/pom.xml @@ -49,6 +49,15 @@ true + + org.sonatype.plugins + nexus-staging-maven-plugin + 1.6.3 + true + + true + + From 5123620051e652c061c8b93e7ba91be290dc7e69 Mon Sep 17 00:00:00 2001 From: Graham Triggs Date: Sun, 26 Jun 2016 15:36:39 +0100 Subject: [PATCH 13/60] Add GPG version --- installer/pom.xml | 11 +---------- pom.xml | 1 + 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/installer/pom.xml b/installer/pom.xml index d93a2175..50b81d4e 100644 --- a/installer/pom.xml +++ b/installer/pom.xml @@ -10,16 +10,6 @@ 1.9.0-SNAPSHOT pom - - - org.vivoweb - vivo-project - 1.9.0-SNAPSHOT - - VIVO Installer @@ -38,6 +28,7 @@ org.apache.maven.plugins maven-gpg-plugin + 1.6 true diff --git a/pom.xml b/pom.xml index 5f899060..99708dbd 100644 --- a/pom.xml +++ b/pom.xml @@ -148,6 +148,7 @@ org.apache.maven.plugins maven-gpg-plugin + 1.6 sign-artifacts From b434285fa9b389a7a14992373a19a57ee18d851c Mon Sep 17 00:00:00 2001 From: Graham Triggs Date: Sun, 26 Jun 2016 15:45:16 +0100 Subject: [PATCH 14/60] Clean overlays from web apps --- installer/solr/pom.xml | 10 ++++++++++ installer/webapp/pom.xml | 12 +++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/installer/solr/pom.xml b/installer/solr/pom.xml index 6f2466f0..60abe9ef 100644 --- a/installer/solr/pom.xml +++ b/installer/solr/pom.xml @@ -121,6 +121,16 @@ true + + maven-clean-plugin + + + + overlays + + + + diff --git a/installer/webapp/pom.xml b/installer/webapp/pom.xml index 16ce72af..3ec6943f 100644 --- a/installer/webapp/pom.xml +++ b/installer/webapp/pom.xml @@ -58,7 +58,7 @@ - pinstall + install tomcat-dir @@ -122,6 +122,16 @@ true + + maven-clean-plugin + + + + overlays + + + + From f8f3c0b53265f3b52f0328189cd74f876a126436 Mon Sep 17 00:00:00 2001 From: grahamtriggs Date: Tue, 28 Jun 2016 22:35:54 +0100 Subject: [PATCH 15/60] Add tar long file mode --- home/pom.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/home/pom.xml b/home/pom.xml index a4d19b27..f20d691f 100644 --- a/home/pom.xml +++ b/home/pom.xml @@ -25,6 +25,7 @@ maven-assembly-plugin 2.5.5 + posix src/main/assembly/home.xml From 3fdbefef328c65558d8d2c308f9d305f3cd9a91d Mon Sep 17 00:00:00 2001 From: Mike Conlon Date: Tue, 28 Jun 2016 17:36:07 -0400 Subject: [PATCH 16/60] Remove reference to prototype vivosearch.org (#37) --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 10cd9559..543b8767 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,7 @@ VIVO is an open source semantic web tool for research discovery -- finding peopl VIVO supports editing, searching, browsing and visualizing research activity in order to discover people, programs, facilities, funding, scholarly works and events. VIVO's search returns results faceted by type for rapid retrieval of -desired information across disciplines at one institution or, through a prototype at vivosearch.org, across multiple -distributed institutions. +desired information across disciplines. ## Resources From 3cfe8745a566b79c997454d677bec01e08086830 Mon Sep 17 00:00:00 2001 From: Graham Triggs Date: Mon, 4 Jul 2016 15:00:37 +0100 Subject: [PATCH 17/60] Remove unnecessary config from pom.xml --- installer/pom.xml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/installer/pom.xml b/installer/pom.xml index 50b81d4e..afa6bb66 100644 --- a/installer/pom.xml +++ b/installer/pom.xml @@ -40,15 +40,6 @@ true - - org.sonatype.plugins - nexus-staging-maven-plugin - 1.6.3 - true - - true - - From 605a88b4ff7c4682c02aff65faab48776aa91cf2 Mon Sep 17 00:00:00 2001 From: Graham Triggs Date: Mon, 4 Jul 2016 19:13:20 +0100 Subject: [PATCH 18/60] [VIVO-1237] Add sitemap for profiles --- .../webapp/sitemap/SiteMapServlet.java | 115 ++++++++++++++++++ webapp/src/main/webapp/WEB-INF/web.xml | 14 +++ 2 files changed, 129 insertions(+) create mode 100644 api/src/main/java/org/vivoweb/webapp/sitemap/SiteMapServlet.java diff --git a/api/src/main/java/org/vivoweb/webapp/sitemap/SiteMapServlet.java b/api/src/main/java/org/vivoweb/webapp/sitemap/SiteMapServlet.java new file mode 100644 index 00000000..ac1cb4f4 --- /dev/null +++ b/api/src/main/java/org/vivoweb/webapp/sitemap/SiteMapServlet.java @@ -0,0 +1,115 @@ +/* $This file is distributed under the terms of the license in /doc/license.txt$ */ + +package org.vivoweb.webapp.sitemap; + +import com.hp.hpl.jena.query.QuerySolution; +import edu.cornell.mannlib.vitro.webapp.controller.VitroHttpServlet; +import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; +import edu.cornell.mannlib.vitro.webapp.controller.freemarker.UrlBuilder; +import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFServiceException; +import edu.cornell.mannlib.vitro.webapp.rdfservice.ResultSetConsumer; +import edu.cornell.mannlib.vitro.webapp.visualization.constants.QueryConstants; +import org.apache.axis.utils.StringUtils; +import org.apache.commons.io.IOUtils; + +import javax.servlet.ServletException; +import javax.servlet.ServletOutputStream; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; + +public class SiteMapServlet extends VitroHttpServlet { + @Override + protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + String requestURI = request.getRequestURI(); + + if (requestURI != null) { + if (requestURI.contains("robots.txt")) { + String robotsPath = getServletContext().getRealPath("/robots.txt"); + String contextPath = request.getContextPath(); + + StringBuilder builder = new StringBuilder("Sitemap: "); + builder.append(getSchemeAndServer(request)); + + if (!"/".equals(contextPath)) { + builder.append(contextPath); + } + builder.append("/sitemap.xml"); + + response.getOutputStream().println(builder.toString()); + response.getOutputStream().println(); + + InputStream is = null; + try { + is = new FileInputStream(robotsPath); + IOUtils.copy(is, response.getOutputStream()); + } finally { + if (is != null) { + is.close(); + } + } + } else { + final String schemeAndServer = getSchemeAndServer(request); + + String query = QueryConstants.getSparqlPrefixQuery() + + "SELECT ?person\n" + + "WHERE\n" + + "{\n" + + " ?person a foaf:Person .\n" + + "}\n"; + + final VitroRequest vreq = new VitroRequest(request); + final ServletOutputStream out = response.getOutputStream(); + + out.println(""); + out.println(""); + + try { + vreq.getRDFService().sparqlSelectQuery(query, new ResultSetConsumer() { + @Override + protected void processQuerySolution(QuerySolution qs) { + String person = qs.getResource("person").getURI(); + + String profileUrl = UrlBuilder.getIndividualProfileUrl(person, vreq); + + if (!StringUtils.isEmpty(profileUrl)) { + try { + out.println(" "); + out.println(" " + schemeAndServer + profileUrl + ""); + out.println(" weekly"); + out.println(" "); + } catch (Exception e) { + } + } + } + }); + } catch (RDFServiceException rse) { + } + + out.println(""); + } + } + super.doGet(request, response); + } + + private String getSchemeAndServer(HttpServletRequest request) { + String serverName = request.getServerName(); + int serverPort = request.getServerPort(); + String scheme = request.getScheme(); + + if ("http".equalsIgnoreCase(scheme) || "https".equalsIgnoreCase(scheme)) { + StringBuilder builder = new StringBuilder(); + builder.append(scheme).append("://").append(serverName); + if (("http".equalsIgnoreCase(scheme) && serverPort != 80) || ("https".equalsIgnoreCase(scheme) && serverPort != 443) ) { + builder.append(":").append(serverPort); + } + + return builder.toString(); + } + + return ""; + } +} diff --git a/webapp/src/main/webapp/WEB-INF/web.xml b/webapp/src/main/webapp/WEB-INF/web.xml index 2f7b50ce..525428a7 100644 --- a/webapp/src/main/webapp/WEB-INF/web.xml +++ b/webapp/src/main/webapp/WEB-INF/web.xml @@ -1324,6 +1324,20 @@ /selectLocale + + SiteMap support + SiteMapServlet + org.vivoweb.webapp.sitemap.SiteMapServlet + + + SiteMapServlet + /robots.txt + + + SiteMapServlet + /sitemap.xml + + From a389d5cbeb139112450c0377fabfe93186332aae Mon Sep 17 00:00:00 2001 From: Graham Triggs Date: Mon, 4 Jul 2016 20:33:47 +0100 Subject: [PATCH 19/60] Remove overlays on clean --- webapp/pom.xml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/webapp/pom.xml b/webapp/pom.xml index 7191930e..0316965e 100644 --- a/webapp/pom.xml +++ b/webapp/pom.xml @@ -48,6 +48,16 @@ + + maven-clean-plugin + + + + overlays + + + + From b649eb09f21f05bf9a6821b9ffdd5ff2a1ac9b28 Mon Sep 17 00:00:00 2001 From: Graham Triggs Date: Tue, 5 Jul 2016 17:52:34 +0100 Subject: [PATCH 20/60] [VIVO-1237] Add ability to generate meta tags --- .../individual/propStatement-dataDefault.ftl | 106 ++++++++++++++++++ .../freemarker/lib/lib-meta-tags.ftl | 48 ++++++++ .../webapp/themes/wilma/templates/head.ftl | 4 + 3 files changed, 158 insertions(+) create mode 100644 webapp/src/main/webapp/templates/freemarker/body/partials/individual/propStatement-dataDefault.ftl create mode 100644 webapp/src/main/webapp/templates/freemarker/lib/lib-meta-tags.ftl diff --git a/webapp/src/main/webapp/templates/freemarker/body/partials/individual/propStatement-dataDefault.ftl b/webapp/src/main/webapp/templates/freemarker/body/partials/individual/propStatement-dataDefault.ftl new file mode 100644 index 00000000..7891a72e --- /dev/null +++ b/webapp/src/main/webapp/templates/freemarker/body/partials/individual/propStatement-dataDefault.ftl @@ -0,0 +1,106 @@ +<#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> + +<#-- VIVO-specific default data property statement template. + + This template must be self-contained and not rely on other variables set for the individual page, because it + is also used to generate the property statement during a deletion. + --> +<#import "lib-datetime.ftl" as dt> +<#if property.rangeDatatypeURI?? && property.rangeDatatypeURI?contains("#")> + <#assign datatype = property.rangeDatatypeURI?substring(property.rangeDatatypeURI?last_index_of("#")+1) /> +<#else> + <#assign datatype = "none" /> + +<@showStatement statement datatype /> + +<#macro showStatement statement datatype> + <#assign theValue = statement.value /> + + <#if theValue?contains("