From 6f41e5c8b1f0eba1aac4af7f1a9e369a1170c8ea Mon Sep 17 00:00:00 2001 From: tworrall Date: Thu, 21 Nov 2013 15:06:47 -0500 Subject: [PATCH] add group, team, et all to drop down lists for service roles --- .../forms/addOutreachProviderRoleToPerson.ftl | 57 ++++++++++--------- .../forms/addServiceProviderRoleToPerson.ftl | 57 ++++++++++--------- ...OutreachProviderRoleToPersonGenerator.java | 6 +- ...dServiceProviderRoleToPersonGenerator.java | 45 +++++++++++++-- 4 files changed, 102 insertions(+), 63 deletions(-) diff --git a/productMods/templates/freemarker/edit/forms/addOutreachProviderRoleToPerson.ftl b/productMods/templates/freemarker/edit/forms/addOutreachProviderRoleToPerson.ftl index 074605aa..f9362afb 100644 --- a/productMods/templates/freemarker/edit/forms/addOutreachProviderRoleToPerson.ftl +++ b/productMods/templates/freemarker/edit/forms/addOutreachProviderRoleToPerson.ftl @@ -1,29 +1,30 @@ -<#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> -<#--Two stage form for service provider role--> - -<#-- -Required Values to be set for each form that includes addRoleToPersonTwoStage.ftl are: -roleDescriptor. -The other required values (roleType, optionsType, objectClassUri, and literalOptions are -set in the JAVA class corresponding to the form, e.g. AddOutreachProviderRoleToPersonGenerator.java. - -Optional values can be set, but each of these has default values -set in addRoleToPersonTwoStage.ftl: - -buttonText -typeSelectorLabel -numDateFields -showRoleLAbelField -roleExamples--> - - -<#--Variable assignments for Add Clinical Role To Person--> -<#assign roleDescriptor = "${i18n().outreach_comm_service}" /> -<#assign typeSelectorLabel = "${i18n().outreach_comm_service_in}" /> -<#assign genericLabel = "${i18n().organization_capitalized}" /> - -<#assign acTypes = "{activity: 'http://xmlns.com/foaf/0.1/Organization'}" /> - - -<#--Each of the two stage forms will include the form below--> +<#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> +<#--Two stage form for service provider role--> + +<#-- +Required Values to be set for each form that includes addRoleToPersonTwoStage.ftl are: +roleDescriptor. +The other required values (roleType, optionsType, objectClassUri, and literalOptions are +set in the JAVA class corresponding to the form, e.g. AddOutreachProviderRoleToPersonGenerator.java. + +Optional values can be set, but each of these has default values +set in addRoleToPersonTwoStage.ftl: + +buttonText +typeSelectorLabel +numDateFields +showRoleLAbelField +roleExamples--> + + +<#--Variable assignments for Add Clinical Role To Person--> +<#assign roleDescriptor = "${i18n().outreach_comm_service}" /> +<#assign typeSelectorLabel = "${i18n().outreach_comm_service_in}" /> +<#assign genericLabel = "${i18n().organization_capitalized}" /> + +<#assign acMultipleTypes = "'true'" /> +<#assign acTypes = "{activity: 'http://xmlns.com/foaf/0.1/Organization,http://xmlns.com/foaf/0.1/Group,http://purl.obolibrary.org/obo/OBI_0000835,http://purl.org/NET/c4dm/event.owl#Event'}" /> + + +<#--Each of the two stage forms will include the form below--> <#include "addRoleToPersonTwoStage.ftl"> \ No newline at end of file diff --git a/productMods/templates/freemarker/edit/forms/addServiceProviderRoleToPerson.ftl b/productMods/templates/freemarker/edit/forms/addServiceProviderRoleToPerson.ftl index 59775e5a..61f73913 100644 --- a/productMods/templates/freemarker/edit/forms/addServiceProviderRoleToPerson.ftl +++ b/productMods/templates/freemarker/edit/forms/addServiceProviderRoleToPerson.ftl @@ -1,29 +1,30 @@ -<#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> -<#--Two stage form for service provider role--> - -<#-- -Required Values to be set for each form that includes addRoleToPersonTwoStage.ftl are: -roleDescriptor. -The other required values (roleType, optionsType, objectClassUri, and literalOptions are -set in the JAVA class corresponding to the form, e.g. AddServiceProviderRoleToPersonGenerator.java. - -Optional values can be set, but each of these has default values -set in addRoleToPersonTwoStage.ftl: - -buttonText -typeSelectorLabel -numDateFields -showRoleLAbelField -roleExamples--> - - -<#--Variable assignments for Add Service Provider Role To Person--> -<#assign roleDescriptor = "${i18n().service_to_profession}" /> -<#assign typeSelectorLabel = "${i18n().service_to_profession_in}" /> -<#assign genericLabel = "${i18n().organization_capitalized}" /> - -<#assign acTypes = "{activity: 'http://xmlns.com/foaf/0.1/Organization'}" /> - - -<#--Each of the two stage forms will include the form below--> +<#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> +<#--Two stage form for service provider role--> + +<#-- +Required Values to be set for each form that includes addRoleToPersonTwoStage.ftl are: +roleDescriptor. +The other required values (roleType, optionsType, objectClassUri, and literalOptions are +set in the JAVA class corresponding to the form, e.g. AddServiceProviderRoleToPersonGenerator.java. + +Optional values can be set, but each of these has default values +set in addRoleToPersonTwoStage.ftl: + +buttonText +typeSelectorLabel +numDateFields +showRoleLAbelField +roleExamples--> + + +<#--Variable assignments for Add Service Provider Role To Person--> +<#assign roleDescriptor = "${i18n().service_to_profession}" /> +<#assign typeSelectorLabel = "${i18n().service_to_profession_in}" /> +<#assign genericLabel = "${i18n().organization_capitalized}" /> + +<#assign acMultipleTypes = "'true'" /> +<#assign acTypes = "{activity: 'http://xmlns.com/foaf/0.1/Organization,http://xmlns.com/foaf/0.1/Group,http://purl.obolibrary.org/obo/OBI_0000835,http://purl.org/NET/c4dm/event.owl#Event'}" /> + + +<#--Each of the two stage forms will include the form below--> <#include "addRoleToPersonTwoStage.ftl"> \ No newline at end of file diff --git a/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddOutreachProviderRoleToPersonGenerator.java b/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddOutreachProviderRoleToPersonGenerator.java index 5caa2647..55daf34d 100644 --- a/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddOutreachProviderRoleToPersonGenerator.java +++ b/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddOutreachProviderRoleToPersonGenerator.java @@ -26,11 +26,13 @@ public class AddOutreachProviderRoleToPersonGenerator extends AddRoleToPersonTwo FieldOptions getRoleActivityFieldOptions(VitroRequest vreq) throws Exception { return new ConstantFieldOptions( "","Select type", + "http://vivoweb.org/ontology/core#AcademicDepartment","Academic Department", "http://vivoweb.org/ontology/core#Association","Association", "http://vivoweb.org/ontology/core#Center","Center", "http://vivoweb.org/ontology/core#ClinicalOrganization","Clinical Organization", "http://vivoweb.org/ontology/core#College","College", "http://vivoweb.org/ontology/core#Committee","Committee", + "http://vivoweb.org/ontology/core#Company","Company", "http://vivoweb.org/ontology/core#Consortium","Consortium", "http://vivoweb.org/ontology/core#CoreLaboratory","Core Laboratory", "http://vivoweb.org/ontology/core#Department","Department", @@ -40,18 +42,20 @@ public class AddOutreachProviderRoleToPersonGenerator extends AddRoleToPersonTwo "http://vivoweb.org/ontology/core#Foundation","Foundation", "http://vivoweb.org/ontology/core#FundingOrganization","Funding Organization", "http://vivoweb.org/ontology/core#GovernmentAgency","Government Agency", + "http://xmlns.com/foaf/0.1/Group","Group", "http://vivoweb.org/ontology/core#Hospital","Hospital", "http://vivoweb.org/ontology/core#Institute","Institute", "http://vivoweb.org/ontology/core#Laboratory","Laboratory", "http://vivoweb.org/ontology/core#Library","Library", + "http://purl.obolibrary.org/obo/OBI_0000835","Manufacturer", "http://vivoweb.org/ontology/core#Museum","Museum", "http://xmlns.com/foaf/0.1/Organization","Organization", "http://vivoweb.org/ontology/core#PrivateCompany","Private Company", "http://vivoweb.org/ontology/core#Program","Program", "http://vivoweb.org/ontology/core#Publisher","Publisher", "http://vivoweb.org/ontology/core#ResearchOrganization","Research Organization", - "http://vivoweb.org/ontology/core#Team","Team", "http://vivoweb.org/ontology/core#School","School", + "http://vivoweb.org/ontology/core#Team","Team", "http://vivoweb.org/ontology/core#ServiceProvidingLaboratory","Service Providing Lab", "http://vivoweb.org/ontology/core#StudentOrganization","Student Organization", "http://purl.obolibrary.org/obo/ERO_0000565","Technology Transfer Office", diff --git a/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddServiceProviderRoleToPersonGenerator.java b/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddServiceProviderRoleToPersonGenerator.java index b7d61b77..3e3d80a2 100644 --- a/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddServiceProviderRoleToPersonGenerator.java +++ b/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddServiceProviderRoleToPersonGenerator.java @@ -3,7 +3,7 @@ package edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators; import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; -import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.fields.ChildVClassesOptions; +import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.fields.ConstantFieldOptions; import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.fields.FieldOptions; public class AddServiceProviderRoleToPersonGenerator extends AddRoleToPersonTwoStageGenerator { @@ -21,11 +21,44 @@ public class AddServiceProviderRoleToPersonGenerator extends AddRoleToPersonTwoS /** Service Provider role involves hard-coded options for the * "right side" of the role or activity. */ @Override - FieldOptions getRoleActivityFieldOptions(VitroRequest vreq) throws Exception { - return new - ChildVClassesOptions(OPTION_CLASS_URI) - .setDefaultOptionLabel("Select type"); - } +FieldOptions getRoleActivityFieldOptions(VitroRequest vreq) throws Exception { + return new ConstantFieldOptions( + "","Select type", + "http://vivoweb.org/ontology/core#AcademicDepartment","Academic Department", + "http://vivoweb.org/ontology/core#Association","Association", + "http://vivoweb.org/ontology/core#Center","Center", + "http://vivoweb.org/ontology/core#ClinicalOrganization","Clinical Organization", + "http://vivoweb.org/ontology/core#College","College", + "http://vivoweb.org/ontology/core#Committee","Committee", + "http://vivoweb.org/ontology/core#Company","Company", + "http://vivoweb.org/ontology/core#Consortium","Consortium", + "http://vivoweb.org/ontology/core#CoreLaboratory","Core Laboratory", + "http://vivoweb.org/ontology/core#Department","Department", + "http://vivoweb.org/ontology/core#Division","Division", + "http://purl.org/NET/c4dm/event.owl#Event","Event", + "http://vivoweb.org/ontology/core#ExtensionUnit","Extension Unit", + "http://vivoweb.org/ontology/core#Foundation","Foundation", + "http://vivoweb.org/ontology/core#FundingOrganization","Funding Organization", + "http://vivoweb.org/ontology/core#GovernmentAgency","Government Agency", + "http://xmlns.com/foaf/0.1/Group","Group", + "http://vivoweb.org/ontology/core#Hospital","Hospital", + "http://vivoweb.org/ontology/core#Institute","Institute", + "http://vivoweb.org/ontology/core#Laboratory","Laboratory", + "http://vivoweb.org/ontology/core#Library","Library", + "http://purl.obolibrary.org/obo/OBI_0000835","Manufacturer", + "http://vivoweb.org/ontology/core#Museum","Museum", + "http://xmlns.com/foaf/0.1/Organization","Organization", + "http://vivoweb.org/ontology/core#PrivateCompany","Private Company", + "http://vivoweb.org/ontology/core#Program","Program", + "http://vivoweb.org/ontology/core#Publisher","Publisher", + "http://vivoweb.org/ontology/core#ResearchOrganization","Research Organization", + "http://vivoweb.org/ontology/core#School","School", + "http://vivoweb.org/ontology/core#Team","Team", + "http://vivoweb.org/ontology/core#ServiceProvidingLaboratory","Service Providing Lab", + "http://vivoweb.org/ontology/core#StudentOrganization","Student Organization", + "http://purl.obolibrary.org/obo/ERO_0000565","Technology Transfer Office", + "http://vivoweb.org/ontology/core#University","University"); +} @Override boolean isShowRoleLabelField(){return true;}