Class UtilityFunctions
- java.lang.Object
-
- edu.cornell.mannlib.vitro.webapp.visualization.visutils.UtilityFunctions
-
public class UtilityFunctions extends Object
-
-
Constructor Summary
Constructors Constructor Description UtilityFunctions()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Map<String,Set<Collaborator>>getActivityYearToCollaborators(CollaborationData collaborationData)This method is used to return a mapping between activity year & all the collaborators that published with ego in that year.static StringgetCollaboratorshipNetworkLink(String individualURI, String visType, String visMode)static StringgetCSVDownloadURL(String individualURI, String visType, String visMode)static StringgetIndividualLabelFromDAO(edu.cornell.mannlib.vitro.webapp.controller.VitroRequest vitroRequest, String entityURI)static StringgetIndividualLocalName(String givenURI, edu.cornell.mannlib.vitro.webapp.controller.VitroRequest vitroRequest)This method will test whether the current uri is based off of default namespace.static org.joda.time.DateTimegetValidParsedDateTimeObject(String unparsedDateTime)static StringgetValidYearFromCoreDateTimeString(String inputDate, String defaultYearInCaseOfError)This method will be called to get the inferred end year for the entity.static Map<String,Integer>getYearToActivityCount(Collection<Activity> activities)static Map<String,Integer>getYearToActivityCount(Set<Activity> activities)static edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.ResponseValueshandleMalformedParameters(String errorPageTitle, String errorMessage, edu.cornell.mannlib.vitro.webapp.controller.VitroRequest vitroRequest)static voidhandleMalformedParameters(String errorMessage, javax.servlet.http.HttpServletResponse response, org.apache.commons.logging.Log log)static booleanisEntityAPerson(edu.cornell.mannlib.vitro.webapp.controller.VitroRequest vreq, String individualURI)static Stringslugify(String textToBeSlugified)Currently the approach for slugifying filenames is naive.
-
-
-
Method Detail
-
getYearToActivityCount
public static Map<String,Integer> getYearToActivityCount(Set<Activity> activities)
-
getYearToActivityCount
public static Map<String,Integer> getYearToActivityCount(Collection<Activity> activities)
-
getActivityYearToCollaborators
public static Map<String,Set<Collaborator>> getActivityYearToCollaborators(CollaborationData collaborationData)
This method is used to return a mapping between activity year & all the collaborators that published with ego in that year.- Parameters:
collaborationData- Collaboration data
-
slugify
public static String slugify(String textToBeSlugified)
Currently the approach for slugifying filenames is naive. In future if there is need, we can write more sophisticated method.- Parameters:
textToBeSlugified- Text to process
-
handleMalformedParameters
public static edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.ResponseValues handleMalformedParameters(String errorPageTitle, String errorMessage, edu.cornell.mannlib.vitro.webapp.controller.VitroRequest vitroRequest)
-
handleMalformedParameters
public static void handleMalformedParameters(String errorMessage, javax.servlet.http.HttpServletResponse response, org.apache.commons.logging.Log log) throws IOException
- Throws:
IOException
-
getValidParsedDateTimeObject
public static org.joda.time.DateTime getValidParsedDateTimeObject(String unparsedDateTime)
-
getValidYearFromCoreDateTimeString
public static String getValidYearFromCoreDateTimeString(String inputDate, String defaultYearInCaseOfError)
This method will be called to get the inferred end year for the entity. The 2 choices, in order, are, 1. parsed year from core:DateTime object saved in core:dateTimeValue 2. Default Entity Year
-
getCSVDownloadURL
public static String getCSVDownloadURL(String individualURI, String visType, String visMode)
-
getCollaboratorshipNetworkLink
public static String getCollaboratorshipNetworkLink(String individualURI, String visType, String visMode)
-
isEntityAPerson
public static boolean isEntityAPerson(edu.cornell.mannlib.vitro.webapp.controller.VitroRequest vreq, String individualURI) throws MalformedQueryParametersException
-
getIndividualLocalName
public static String getIndividualLocalName(String givenURI, edu.cornell.mannlib.vitro.webapp.controller.VitroRequest vitroRequest)
This method will test whether the current uri is based off of default namespace. If so, go ahead & provide local name.- Parameters:
givenURI- URIvitroRequest- Vitro Request
-
-