Class AddRoleToPersonTwoStageGenerator

  • All Implemented Interfaces:
    edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.EditConfigurationGenerator
    Direct Known Subclasses:
    AddAttendeeRoleToPersonGenerator, AddClinicalRoleToPersonGenerator, AddEditorRoleToPersonGenerator, AddHeadOfRoleToPersonGenerator, AddMemberRoleToPersonGenerator, AddOrganizerRoleToPersonGenerator, AddOutreachProviderRoleToPersonGenerator, AddResearcherRoleToPersonGenerator, AddReviewerRoleToPersonGenerator, AddServiceProviderRoleToPersonGenerator, AddTeacherRoleToPersonGenerator

    public abstract class AddRoleToPersonTwoStageGenerator
    extends edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.BaseEditConfigurationGenerator
    implements edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.EditConfigurationGenerator
    Generates the edit configuration for adding a Role to a Person. Stage one is selecting the type of the non-person thing associated with the Role with the intention of reducing the number of Individuals that the user has to select from. Stage two is selecting the non-person Individual to associate with the Role. This is intended to create a set of statements like: ?person core:hasResearchActivityRole ?newRole. ?newRole rdf:type core:ResearchActivityRole ; roleToActivityPredicate ?someActivity . ?someActivity rdf:type core:ResearchActivity . ?someActivity rdfs:label "activity title" . Important: This form cannot be directly used as a custom form. It has parameters that must be set. See addClinicalRoleToPerson.jsp for an example. roleToActivityPredicate and activityToRolePredicate are both dependent on the type of the activity itself. For a new statement, the predicate type is not known. For an existing statement, the predicate is known but may change based on the type of the activity newly selected. bdc34: TODO: figure out what needs to be customized per role form, document it here in comments TODO: rewrite class as an abstract class with simple, documented, required methods to override AddRoleToPersonTwoStageGenerator is abstract, each subclass will need to configure: From the old JSP version: showRoleLabelField boolean roleType URI roleToActivityPredicate URI activityToRolePredicate URI roleActivityType_optionsType roleActivityType_objectClassURI roleActivityType_literalOptions For the new generator version: template
    • Constructor Detail

      • AddRoleToPersonTwoStageGenerator

        public AddRoleToPersonTwoStageGenerator()
    • Method Detail

      • getEditConfiguration

        public edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.EditConfigurationVTwo getEditConfiguration​(edu.cornell.mannlib.vitro.webapp.controller.VitroRequest vreq,
                                                                                                               javax.servlet.http.HttpSession session)
                                                                                                        throws Exception
        URI of predicate between role context node and activity
        Specified by:
        getEditConfiguration in interface edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.EditConfigurationGenerator
        Throws:
        Exception
      • getActivityTypeQueryForConstantOptions

        protected String getActivityTypeQueryForConstantOptions​(edu.cornell.mannlib.vitro.webapp.controller.VitroRequest vreq,
                                                                edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.fields.ConstantFieldOptions fieldOptions)
                                                         throws Exception
        Utility method for subclasses to make a query for type from a ConstantFieldOptions object.
        Throws:
        Exception
      • getActivityTypeQueryForChildVClassOptions

        protected String getActivityTypeQueryForChildVClassOptions​(edu.cornell.mannlib.vitro.webapp.controller.VitroRequest vreq,
                                                                   edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.fields.ChildVClassesOptions opts)
        Utility method for subclasses to make a query for type from a ChildVClassesOptions object.
      • getActivityTypeQueryForIndividualsViaClassGroupOptions

        protected String getActivityTypeQueryForIndividualsViaClassGroupOptions​(edu.cornell.mannlib.vitro.webapp.controller.VitroRequest vreq,
                                                                                edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.fields.IndividualsViaClassGroupOptions opts)
        Utility method for subclasses to make a query for type from a IndividualsViaClassGroupOptions object.
      • getRoleToActivityPredicate

        public String getRoleToActivityPredicate​(edu.cornell.mannlib.vitro.webapp.controller.VitroRequest vreq)
      • getPossibleRoleToActivityPredicates

        public List<String> getPossibleRoleToActivityPredicates()
      • getPossibleActivityToRolePredicates

        public List<String> getPossibleActivityToRolePredicates()
      • getEditMode

        public edu.cornell.mannlib.vitro.webapp.utils.FrontEndEditingUtils.EditMode getEditMode​(edu.cornell.mannlib.vitro.webapp.controller.VitroRequest vreq)
      • addFormSpecificData

        public void addFormSpecificData​(edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.EditConfigurationVTwo editConfiguration,
                                        edu.cornell.mannlib.vitro.webapp.controller.VitroRequest vreq)
      • getFilterRoleToActivityPredicate

        public String getFilterRoleToActivityPredicate​(String predicateVar)
      • getStartDatePrecision

        protected String getStartDatePrecision()
      • getEndDatePrecision

        protected String getEndDatePrecision()