Class UtilityFunctions


  • public class UtilityFunctions
    extends Object
    • Constructor Detail

      • UtilityFunctions

        public UtilityFunctions()
    • Method Detail

      • 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)
      • 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 - URI
        vitroRequest - Vitro Request
      • getIndividualLabelFromDAO

        public static String getIndividualLabelFromDAO​(edu.cornell.mannlib.vitro.webapp.controller.VitroRequest vitroRequest,
                                                       String entityURI)