Versions Compared

Key

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

...

  1. Create a new RSF Hello World app using the App Builder.
  2. Add the component-api to the build path.
  3. Add the following code to the template tool/src/webapp/templates/HelloWorld.html:
    Code Block
    <div rsf:id="optional-block:">
    You have set myPropertyString to &quot;<span rsf:id="property-value">value</span>&quot;.
    </div>
    
  4. Add the following code to the producer HelloWorldProducer.java:
    within the class itself:
    Code Block
    private ServerConfigurationService serverConfigurationService;
    public void setServerConfigurationService(ServerConfigurationService serverConfigurationService) {
    	this.serverConfigurationService = serverConfigurationService;
    }
    and within the fillComponents method:
    Code Block
    User currentUser = userDirectoryService.getCurrentUser();
    UIOutput.make(tofill, "current-displayname", currentUser.getDisplayName());
    UIOutput.make(tofill, "current-email", currentUser.getEmail());
    
  5. Add the injection to the tool/src/webapp/WEB-INF/requestContext.xml:
    Code Block
    <property name="serverConfigurationService" ref="org.sakaiproject.component.api.ServerConfigurationService"/>
  6. Add the dependency to tool/project.xml (show them how to figure out the artifactId:
    Code Block
    <dependency>
    	<groupId>sakaiproject</groupId>
    	<artifactId>sakai-user-api</artifactId>
    	<version>${sakai.version}</version>
    </dependency>
    
    <dependency>
    	<groupId>sakaiproject</groupId>
    	<artifactId>sakai-component-api</artifactId>
    	<version>${sakai.version}</version>
    </dependency>
    
  7. Compile and test.

...