21
open source administration software for education 2012 User Conference April 22-24, 2012 – Atlanta, Georgia “Together Toward Tomorrow” Chris Denne, Colorado University Lin-Long Shyu, Indiana University, System Analyst/Developer Neeraj Khanolkar, Iowa State University, April 26 2012, 1-3PM

Open source administration software for education 2012 User Conference April 22-24, 2012 – Atlanta, Georgia “Together Toward Tomorrow” Chris Denne, Colorado

Embed Size (px)

Citation preview

Page 1: Open source administration software for education 2012 User Conference April 22-24, 2012 – Atlanta, Georgia “Together Toward Tomorrow” Chris Denne, Colorado

open source administration software for education

2012 User Conference April 22-24, 2012 – Atlanta, Georgia

“Together Toward Tomorrow”

Chris Denne, Colorado UniversityLin-Long Shyu, Indiana University, System Analyst/Developer

Neeraj Khanolkar, Iowa State University,

April 26 2012, 1-3PM

Page 2: Open source administration software for education 2012 User Conference April 22-24, 2012 – Atlanta, Georgia “Together Toward Tomorrow” Chris Denne, Colorado

2012 KCC User Conference - “Together Toward Tomorrow”

Customization Approaches

User / Administrator Customizations Available via the application UI Maintainable/Persisted via Institutional data

DeveloperCode based Integration Approach : Maven War Overlay

Page 3: Open source administration software for education 2012 User Conference April 22-24, 2012 – Atlanta, Georgia “Together Toward Tomorrow” Chris Denne, Colorado

2012 KCC User Conference - “Together Toward Tomorrow”

User Customizations

User / Administrator CustomizationsMaintenance artifactsParameter Maintenance Workflow route path nodes & rulesKIM

Page 4: Open source administration software for education 2012 User Conference April 22-24, 2012 – Atlanta, Georgia “Together Toward Tomorrow” Chris Denne, Colorado

2012 KCC User Conference - “Together Toward Tomorrow”

Customization

Provide configuration for institutional customization Extend Override : Override class (same package, and same class name), method.

Use Maven overlay Maven

• What is it?: build, dependency, project management tool• Good : Dependency Management, many plugins, works with Eclipse• Improvement required : Poor documentation, rigid, high learning curve, not all

plugins well tested. Maven/war plugin/Overlay

• shares common resources across multiple web applications.• Merges between an original war and other code/files that you develop.

KC uses maven

Confluence page Link : https://wiki.kuali.org/display/KRADOC/KC+Customization

Page 5: Open source administration software for education 2012 User Conference April 22-24, 2012 – Atlanta, Georgia “Together Toward Tomorrow” Chris Denne, Colorado

2012 KCC User Conference - “Together Toward Tomorrow”

Use Case : Services, struts actions, and forms

Spring : Bean customization, mostly services. CustomSpringBeans.xml :

• overrides kc spring beans• adds new beans. • This file name is added to kc-bootstrap-springbeans.xml.

Struts-config : action and form classes. struts-custom-config.xml :

• overrides kc's struts configuration • adds new struts configuration. • This file is defined in web.xml. <param-value>/WEB-INF/struts-config.xml, /WEB-INF/struts-

custom-config.xml</param-value>

Page 6: Open source administration software for education 2012 User Conference April 22-24, 2012 – Atlanta, Georgia “Together Toward Tomorrow” Chris Denne, Colorado

2012 KCC User Conference - “Together Toward Tomorrow”

Use case : DD, rule, authorization

DD : modify bo properties. Rule class Authorization class Defined in CustomSpringBeans.xml. <bean id="customModuleConfiguration-parentBean"

class="org.kuali.rice.kns.bo.ModuleConfiguration" abstract="true"> <property name="dataDictionaryPackages"> <list> <value>org/kuali/kra/custom/datadictionary</value> </list> </property> </bean>

Page 7: Open source administration software for education 2012 User Conference April 22-24, 2012 – Atlanta, Georgia “Together Toward Tomorrow” Chris Denne, Colorado

2012 KCC User Conference - “Together Toward Tomorrow”

Use case : Web Contents & Bo

Web content - JSPs, tags, images The maven "overlay" can overlay the

customized web content over kc_project. BO : Extends BO is complicated Override Bo Use rice extended attributes KC Custom Data

Page 8: Open source administration software for education 2012 User Conference April 22-24, 2012 – Atlanta, Georgia “Together Toward Tomorrow” Chris Denne, Colorado

2012 KCC User Conference - “Together Toward Tomorrow”

Configuration

Kc-bootstrap-springbeans.xml <import resource="org/kuali/kra/custom/CustomSpringBeans.xml"/>

Web.xml <param-value>/WEB-INF/struts-config.xml, /WEB-INF/struts-custom-

config.xml</param-value>

CustomSpringBeans.xml <property name="dataDictionaryPackages"> <list> <value>org/kuali/kra/datadictionary</value> <value>org/kuali/kra/datadictionary/docs</value> </list> </property> <property name="databaseRepositoryFilePaths"> <list> <value>org/kuali/kra/custom/repository-custom.xml</value> </list> </property>

Message : <param name="kc.struts.message.resources">ApplicationResources,

CustomApplicationResources</param>

Page 9: Open source administration software for education 2012 User Conference April 22-24, 2012 – Atlanta, Georgia “Together Toward Tomorrow” Chris Denne, Colorado

2012 KCC User Conference - “Together Toward Tomorrow”

Check out KC_PROJECT and install war & jar to local maven repository

install kc_project to local maven repository Check out : https://svn.kuali.org/repos/kc -> branches->

kc_project_bootcamp In command line, go to checked out project directory and execute

following mvn commands : mvn generate-sources mvn -Dmaven.test.skip=true install mvn jar:jar mvn install:install-file -Dpackaging=jar -DgroupId=org.kuali.kra -DartifactId=kc_project

-Dversion=4.0 -DpomFile=pom.xml -Dfile=target/kc_project-4.0.jar mvn jar:test-jar mvn install:install-file -Dpackaging=jar -DgroupId=org.kuali.kra -

DartifactId=kc_project_test -Dversion=4.0 -DgeneratePom=true -Dfile=target/kc_project-4.0-tests.jar

Page 10: Open source administration software for education 2012 User Conference April 22-24, 2012 – Atlanta, Georgia “Together Toward Tomorrow” Chris Denne, Colorado

2012 KCC User Conference - “Together Toward Tomorrow”

Steps to create KC_custom project

check out from svn Or Create kc_custom from scratch Check out : https://svn.kuali.org/repos/kc -> custom Apply patch custom40-base.patch Customization configurations files not included in R2

do customization in kc_customcreate war file for kc_custom with the overlay

of kc_project mvn -f pom_war.xml -U clean compile war:war

Page 11: Open source administration software for education 2012 User Conference April 22-24, 2012 – Atlanta, Georgia “Together Toward Tomorrow” Chris Denne, Colorado

2012 KCC User Conference - “Together Toward Tomorrow”

Lesson 1 : Override/extend Service

Extends MeetingServiceImpl from Foundation Override “addOtherAction”

• Call super. addOtherAction(newOtherAction, committeeSchedule)

• Add System.out.println to verify it Need to override the meetingService in

CustomSpringBeans.xml

Page 12: Open source administration software for education 2012 User Conference April 22-24, 2012 – Atlanta, Georgia “Together Toward Tomorrow” Chris Denne, Colorado

2012 KCC User Conference - “Together Toward Tomorrow”

Lesson 1 : Steps to verify

Central Admin -> Post-Submission Compliance -> schedules

In ‘Committee Schedule Lookup’ page• Schedule Date From : 04/01/2012• Schedule Date To : 04/30/2012• Click ‘search’ button• Click ‘edit’ link of the retrieved item.

In Meeting page• Add ‘other action’

Check console to see if the “message” you added is displayed.

Page 13: Open source administration software for education 2012 User Conference April 22-24, 2012 – Atlanta, Georgia “Together Toward Tomorrow” Chris Denne, Colorado

2012 KCC User Conference - “Together Toward Tomorrow”

Lesson 1 : Solution

Extends MeetingServiceImpl• public class MeetingServiceImpl extends

org.kuali.kra.meeting.MeetingServiceImpl CustomSpringBeans.xml

• <bean id="meetingService" class="org.kuali.kra.custom.MeetingServiceImpl">

• <property name="businessObjectService" ref="businessObjectService" />

• <property name="sequenceAccessorService" ref="sequenceAccessorService" />

• <property name="dateTimeService" ref="dateTimeService" />• </bean>

Page 14: Open source administration software for education 2012 User Conference April 22-24, 2012 – Atlanta, Georgia “Together Toward Tomorrow” Chris Denne, Colorado

2012 KCC User Conference - “Together Toward Tomorrow”

Lesson 2 : Override Struts Action

Extends MeetingManagementAction• Override “start”, and add System.out.println to verify it.• Need to override struts “action” in strut-custom-

config.xmlOverride “MeetingActionsAction” class

• copy/paste this class from foundation to kc_custom in the same packge.

• Add System.out.ptintln in ‘generateAgenda’ method

Page 15: Open source administration software for education 2012 User Conference April 22-24, 2012 – Atlanta, Georgia “Together Toward Tomorrow” Chris Denne, Colorado

2012 KCC User Conference - “Together Toward Tomorrow”

Lesson 2 : Steps to verify

Central Admin -> Post-Submission Compliance -> schedules In ‘Committee Schedule Lookup’ page Schedule Date From : 04/01/2012 Schedule Date To : 04/30/2012 Click ‘search’ button Click ‘edit’ link of the retrieved item.

Navigate to Meeting actions page In ‘Agenda’ tab, click ‘submit’ button to generate agenda. Check console to see if the “message” you added is displayed.

Page 16: Open source administration software for education 2012 User Conference April 22-24, 2012 – Atlanta, Georgia “Together Toward Tomorrow” Chris Denne, Colorado

2012 KCC User Conference - “Together Toward Tomorrow”

Lesson 2 : Solution

Struts-custom-config.xml• <action-mappings>• <action path="/meetingManagement"

name="MeetingForm" type="org.kuali.kra.custom.MeetingManagementAction" attribute="KualiForm">

• <forward name="basic" path="/WEB-INF/jsp/meeting/meetingManagement.jsp" />

• <forward name="management" path="/WEB-INF/jsp/meeting/meetingManagement.jsp" />

• <forward name="actions" path="/WEB-INF/jsp/meeting/meetingActions.jsp" />

• <forward name="correspondence" path="/WEB-INF/jsp/meeting/meetingCorrespondenceAction.jsp" />

• </action>• </action-mappings>

Page 17: Open source administration software for education 2012 User Conference April 22-24, 2012 – Atlanta, Georgia “Together Toward Tomorrow” Chris Denne, Colorado

2012 KCC User Conference - “Together Toward Tomorrow”

Lesson 3 : Override DD and message

Extends ProtocolDocumentRule and add a system out message “Custom ProtocolDocumentRule “ in “processCustomSaveDocumentBusinessRules”

Change ProtocolDocument.xml (DD) to reference the new rule class Change Protocol.xml to use ‘Custom Title” for “"Protocol-title“

label. Change message in CustomApplicationResources.properties

• error.investigator.notFound Add “<param

name="kc.struts.message.resources">ApplicationResources, CustomApplicationResources</param>” to local kc-config.xml

Restart jetty

Page 18: Open source administration software for education 2012 User Conference April 22-24, 2012 – Atlanta, Georgia “Together Toward Tomorrow” Chris Denne, Colorado

2012 KCC User Conference - “Together Toward Tomorrow”

Lesson 3 : Steps to verify

In Researcher -> Create Irb Protocol Enter required fields Click ‘save’

Page 19: Open source administration software for education 2012 User Conference April 22-24, 2012 – Atlanta, Georgia “Together Toward Tomorrow” Chris Denne, Colorado

2012 KCC User Conference - “Together Toward Tomorrow”

Lesson 3 : Solution

Change ProtocolDocument.xml (DD) to reference the new rule class• <property name="businessRulesClass"

value=“org.kuali.kra.custom.ProtocolDocumentRule"/>. Change message in CustomApplicationResources.properties

• error.investigator.notFound=A Principal Investigator must be assigned to the Protocol - custom.

Add “<param name="kc.struts.message.resources">ApplicationResources, CustomApplicationResources</param>” to local kc-config.xml

Page 20: Open source administration software for education 2012 User Conference April 22-24, 2012 – Atlanta, Georgia “Together Toward Tomorrow” Chris Denne, Colorado

2012 KCC User Conference - “Together Toward Tomorrow”

Lesson 4 : Unit test

• Create AddDisclosureReporterUnitRuleTest by extending foundation’s class.

• Override ‘testMissingUnitNumber’• Create a new test dummy method.• Add system.out.println to verify it.• Run junit test.

Page 21: Open source administration software for education 2012 User Conference April 22-24, 2012 – Atlanta, Georgia “Together Toward Tomorrow” Chris Denne, Colorado

2012 KCC User Conference - “Together Toward Tomorrow”

Lesson 5: Tomcat

• 1. add mongrel plugin to eclipse

• Location : http://mongrel.sourceforge.net/updates/

• 2. down load apach tomcat

• 3. goto eclipse/preference/mongrel to set up tomcat home

• 4. create a kc-dev.xml and dropped to tomcat_home/conf/catalina/localhost

• below is the kc-dev.xml I used

• <Context path="/kc-dev" reloadable="true" docBase="c:\java\projectr40\kc_custom\target\kc_custom-4.0">

• </Context>

• With this docbase set up, you'll have more flexibility; so you don't have to build war file for deployment.• 5. copy oracle driver/mysql driver to target\kc_custom-4.0\WEB-INF/lib or tomcat_home/lib