Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

Address

...

Prerequisites

...

  1. mvn

...

  1. repository:

...

  1. settings.xml

...

  1. Oracle

...

  1. JDBC

...

  1. Driver

...

  1. Code Block

...

  1. 
    mvn install:install-file -DgroupId=com.oracle -DartifactId=ojdbc14 -Dversion=10.1.0.2.0 -Dpackaging=jar -Dfile=C:/JavaLib/Oracle10.2.0.4JDBC/ojdbc14.jar
    

...

  1. Configure Plugin Directory in rice-config.xml

...

  1. Code Block

...

  1. title

...

  1. /usr/local/rice/rice-config.xml

...

  1. 
    <param name="plugin.dir">/usr/local/rice/plugins</param>
    

...

Build Project

  1. File -> New -> Project -> Maven Project
  2. Create simple project (skip archetype selection)
    Image Added
  3. Configure Project
    Image Added
  4. Click Finish

Configure Plugin

  1. Configure Maven Plugins, Repositories and Dependencies
    Code Block
    titlepom.xml
    
    <project xmlns="http://maven.apache.org/POM/4.0.0" 
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
             xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
      <modelVersion>4.0.0</modelVersion>
      <groupId>edu.ucdavis.iet.mw.kuali.rice</groupId>
      

...

  1. <artifactId>UCDUserService-

...

  1. institutional-plugin</artifactId>
      

...

  1. <name>UCDUserService-

...

  1. institutional-plugin</name>
      

...

  1. <version>1.

...

  1. 0</version>
      <description>A Rice plugin that integrates the User 

...

  1. Service with UCD 

...

  1. LDAP.</description>
      <build>
      	<plugins>
      		<plugin>
      			<artifactId>maven-compiler-plugin</artifactId>
      			<configuration>
    				<source>1.5</source>
    				<target>1.5</target>
    			</configuration>
      		</plugin>
      		<plugin>
      			<artifactId>maven-assembly-plugin</artifactId>
      			<version>2.1</version>
      			<configuration>
    				<descriptors>
    					<descriptor>src/main/assembly/plugin.xml</descriptor>
    				</descriptors>
    			</configuration>
      		</plugin>
      	</plugins>
      </build>
      <repositories>
      	<repository>
      		<id>connector</id>
      		<name>Connector</name>
      		<url>http://julien.dubois.free.fr/maven2/</url>
      	</repository>
      	<repository>
      		<id>kuali</id>
      		<name>Kuali Repository</name>
      		<url>https://test.kuali.org/maven</url>
      	</repository>
      </repositories>
      <dependencies>
      	<dependency>
      		<groupId>org.kuali.rice</groupId>
      		<artifactId>rice-kew</artifactId>
      		<version>0.9.2</version>
      	</dependency>
      </dependencies>
    </project>
    

...


  1. Configure Assembly
    • Under /src/main,

...

    • create

...

    • a

...

    • folder

...

    • named

...

    • assembly
    • In /assembly

...

    • ,

...

    • create

...

    • a

...

    • file

...

    • named

...

    • plugin.xml

...

    • Edit plugin.xml

...

    • :

...

    • Code Block

...

    • 
      <assembly>
        <id>plugin</id>
        <formats>
          <format>zip</format>
        </formats>
        <includeBaseDirectory>false</includeBaseDirectory>
        <fileSets>
          <fileSet>
            <directory>conf/plugin/META-INF</directory>
            <outputDirectory>META-INF</outputDirectory>
          </fileSet>
          <fileSet>
          	<directory>target/classes</directory>
          	<outputDirectory>classes</outputDirectory>
          </fileSet>
          <fileSet>
          	<directory>conf/plugin/lib</directory>
          	<outputDirectory>lib</outputDirectory>
          </fileSet>
        </fileSets>
      </assembly>
      

...


  1. Configure Override Resource Loader
    • Under the project root, create a directory named conf
    • Under /conf, create a directory named plugin
    • Under /conf/plugin, create a directory named META-INF
    • In /conf/plugin/META-INF

...

    • ,

...

    • create

...

    • a

...

    • file

...

    • named

...

    • workflow.xml

...

    • Edit workflow.xml

...

    • :

...

    • Code Block

...

    • 
      <plugin>
        <resourceLoader class="edu.ucdavis.iet.mw.kuali.rice.

...

    • UCDUserServiceOverrideResourceLoader"/>
      </plugin>
      

...

    • Info

      This coincides with <directory>conf/plugin/META-INF</directory>

...

    • in

...

    • plugin.xml

...

Override User Service Resource

  1. Create UCDUserServiceOverrideResourceLoader Class
    Image Added
  2. Add Constructor and Attributes
    Code Block
    titleUCDUserServiceOverrideResourceLoader.java
    
    package edu.ucdavis.iet.mw.kuali.rice;
    
    import org.kuali.rice.resourceloader.BaseResourceLoader;
    import javax.xml.namespace.QName;
    import org.apache.xbean.spring.context.ClassPathXmlApplicationContext;
    
    public class 

...

  1. UCDUserServiceOverrideResourceLoader extends BaseResourceLoader {
    
    

...

  1. 	public 

...

  1. UCDUserServiceOverrideResourceLoader(){
    		super(new QName("IdentityManagementOverrideResourceLoader"));
    	}
    	
    	private static final String SPRING_FILE = "classpath:SpringBeans.xml";
    	
    	private ClassPathXmlApplicationContext context;
    	
    }
    
  2. Override start(), stop() and getService(QName) Methods
    Code Block
    titleUCDUserServiceOverrideResourceLoader.java
    
    package edu.ucdavis.iet.mw.kuali.rice;
    
    import org.kuali.rice.resourceloader.BaseResourceLoader;
    import javax.xml.namespace.QName;
    import org.apache.xbean.spring.context.ClassPathXmlApplicationContext;
    import 

...

  1. edu.

...

  1. iu.

...

  1. uis.

...

  1. eden.

...

  1. KEWServiceLocator;
    
    public class 

...

  1. UCDUserServiceOverrideResourceLoader extends BaseResourceLoader {
    
    	public 

...

  1. UCDUserServiceOverrideResourceLoader(){
    		super(new QName("IdentityManagementOverrideResourceLoader"));
    	}
    	
    	private static final String SPRING_FILE = "classpath:SpringBeans.xml";
    	
    	private ClassPathXmlApplicationContext context;
    	
    	public Object getService(QName serviceName) {
    		String springServiceName = serviceName.getLocalPart();
    		if (KEWServiceLocator.USER_SERVICE.equals(springServiceName)) {
    			return context.getBean(springServiceName);
    		}
    		return super.getService(serviceName);
    	}
    
    	public void start() throws Exception {
    		context = new ClassPathXmlApplicationContext(SPRING_FILE);
    		super.start();
    	}
    
    	public void stop() throws Exception {
    		if (context != null) {
    			context.stop();
    			context = null;
    		}
    		super.stop();
    	}	
    }
    

Implement User Service

  1. Create UCDUserService Class:
    Image Added
  2. Implement ??? Methods
    Code Block
    titleUCDUserService.java
    
    package edu.ucdavis.iet.mw.kuali.rice;
    
    import java.io.InputStream;
    import java.util.List;
    
    import edu.iu.uis.eden.clientapp.vo.UserIdVO;
    import edu.iu.uis.eden.exception.EdenUserNotFoundException;
    import edu.iu.uis.eden.user.UserCapabilities;
    import edu.iu.uis.eden.user.UserId;
    import edu.iu.uis.eden.user.UserService;
    import edu.iu.uis.eden.user.WorkflowUser;
    
    public class UCDUserService implements UserService {
    
    	public WorkflowUser copy(WorkflowUser arg0, boolean arg1) {
    		// TODO Auto-generated method stub
    		return null;
    	}
    
    	public WorkflowUser getBlankUser() {
    		// TODO Auto-generated method stub
    		return null;
    	}
    
    	public UserCapabilities getCapabilities() {
    		// TODO Auto-generated method stub
    		return null;
    	}
    
    	public WorkflowUser getWorkflowUser(UserId arg0)
    			throws EdenUserNotFoundException {
    		// TODO Auto-generated method stub
    		return null;
    	}
    
    	public WorkflowUser getWorkflowUser(UserIdVO arg0)
    			throws EdenUserNotFoundException {
    		// TODO Auto-generated method stub
    		return null;
    	}
    
    	public void save(WorkflowUser arg0) {
    		// TODO Auto-generated method stub
    
    	}
    
    	public List search(WorkflowUser arg0, boolean arg1) {
    		// TODO Auto-generated method stub
    		return null;
    	}
    
    	public void loadXml(InputStream 

...

  1. arg0, WorkflowUser arg1) {
    		// TODO Auto-generated method stub
    
    	}
    
    }
    
  2. Declare UCDUserService in Spring Context
    • Under /src/main/resources create a file named SpringBeans.xml
    • Edit SpringBeans.xml:
      Code Block
      titleSpringBeans.xml
      
      <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
      <beans>
      	<bean id="enUserService" class="edu.ucdavis.iet.mw.kuali.rice.UCDUserService"/>
      </beans>
      

Reference

https://test.kuali.org/confluence/display/KULRICE/Workflow+Plugin+Guide

...


https://test.kuali.org/confluence/display/KULRICE/JA-SIG+Spring+2008+-+Building+the+Plug-in

...