[jboss-svn-commits] JBL Code SVN: r21727 - in labs/jbosslabs/labs-3.0-build/integration: cs-macros and 16 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Fri Aug 22 10:20:29 EDT 2008
Author: szimano
Date: 2008-08-22 10:20:29 -0400 (Fri, 22 Aug 2008)
New Revision: 21727
Added:
labs/jbosslabs/labs-3.0-build/integration/cs-macros/
labs/jbosslabs/labs-3.0-build/integration/cs-macros/build.xml
labs/jbosslabs/labs-3.0-build/integration/cs-macros/pom.xml
labs/jbosslabs/labs-3.0-build/integration/cs-macros/resources/
labs/jbosslabs/labs-3.0-build/integration/cs-macros/src/
labs/jbosslabs/labs-3.0-build/integration/cs-macros/src/main/
labs/jbosslabs/labs-3.0-build/integration/cs-macros/src/main/java/
labs/jbosslabs/labs-3.0-build/integration/cs-macros/src/main/java/org/
labs/jbosslabs/labs-3.0-build/integration/cs-macros/src/main/java/org/jboss/
labs/jbosslabs/labs-3.0-build/integration/cs-macros/src/main/java/org/jboss/labs/
labs/jbosslabs/labs-3.0-build/integration/cs-macros/src/main/java/org/jboss/labs/clearspace/
labs/jbosslabs/labs-3.0-build/integration/cs-macros/src/main/java/org/jboss/labs/clearspace/macro/
labs/jbosslabs/labs-3.0-build/integration/cs-macros/src/main/java/org/jboss/labs/clearspace/macro/AuthorsNameMacro.java
labs/jbosslabs/labs-3.0-build/integration/cs-macros/src/main/resources/
labs/jbosslabs/labs-3.0-build/integration/cs-macros/src/main/resources/plugin.xml
labs/jbosslabs/labs-3.0-build/integration/cs-macros/src/test/
labs/jbosslabs/labs-3.0-build/integration/cs-macros/src/test/java/
labs/jbosslabs/labs-3.0-build/integration/cs-macros/src/test/java/org/
labs/jbosslabs/labs-3.0-build/integration/cs-macros/src/test/java/org/jboss/
labs/jbosslabs/labs-3.0-build/integration/cs-macros/src/test/java/org/jboss/labs/
labs/jbosslabs/labs-3.0-build/integration/cs-macros/src/test/java/org/jboss/labs/AppTest.java
Modified:
labs/jbosslabs/labs-3.0-build/integration/cs-nukes-login/pom.xml
labs/jbosslabs/labs-3.0-build/integration/cs-nukes-login/src/main/java/org/jboss/labs/clearspace/LabsUser.java
labs/jbosslabs/labs-3.0-build/integration/pom.xml
Log:
clearspace 2.5
Property changes on: labs/jbosslabs/labs-3.0-build/integration/cs-macros
___________________________________________________________________
Name: svn:ignore
+ target
.classpath
.project
.settings
.iml
Added: labs/jbosslabs/labs-3.0-build/integration/cs-macros/build.xml
===================================================================
--- labs/jbosslabs/labs-3.0-build/integration/cs-macros/build.xml (rev 0)
+++ labs/jbosslabs/labs-3.0-build/integration/cs-macros/build.xml 2008-08-22 14:20:29 UTC (rev 21727)
@@ -0,0 +1,67 @@
+<?xml version="1.0"?>
+
+<!--
+ Targets to create plugin projects, build and build plugins.
+-->
+<project name="SimpleExamples" default="build.plugins" basedir=".">
+
+ <!-- ======================================================================================= -->
+ <!-- Properties ============================================================================ -->
+ <!-- ======================================================================================= -->
+
+ <!-- Change this value to your plugin's name. -->
+ <property name="plugin.name" value="simpleexamples"/>
+ <property name="plugin.jar.name" value="${plugin.name}.jar"/>
+
+ <!-- Assumes that this file is in the plugins/plugins/<my_plugin> directory.
+ Change as needed. -->
+ <property name="jiveHome" value="/Users/tomek/forge/jive"/>
+ <property name="plugins.dir" value="${jiveHome}/plugins" />
+
+ <!-- Assumes that this file is in the plugins/plugins/<my_plugin> directory.
+ Change as needed. -->
+ <property name="server.home.dir" value="/Users/tomek/jboss/cs"/>
+ <property name="clearspace.lib.dir" value="${server.home.dir}/webapps/ROOT.war/WEB-INF/lib"/>
+
+ <!-- ======================================================================================= -->
+ <!-- Targets =============================================================================== -->
+ <!-- ======================================================================================= -->
+
+ <target name="create.plugin.dirs" description="Creates the subdirectories of a plugin project.">
+ <mkdir dir="${basedir}/resources" />
+ <mkdir dir="${basedir}/src" />
+ </target>
+
+ <target name="build.plugins" depends="clean.plugins" description="Builds all plugins in source directory">
+ <mkdir dir="classes"/>
+ <javac srcdir="${basedir}/src"
+ destdir="${basedir}/classes"
+ debug="on"
+ source="1.5"
+ >
+ <!-- Classpath to build the example plugin. Change as needed. -->
+ <classpath>
+ <fileset dir="${clearspace.lib.dir}">
+ <include name="**/*.jar"/>
+ </fileset>
+ <fileset dir="${server.home.dir}/lib">
+ <include name="servlet-api.jar"></include>
+ </fileset>
+ </classpath>
+ </javac>
+ <jar destfile="${plugin.jar.name}"
+ basedir="${basedir}"
+ includes="classes/** resources/** plugin.xml schema.xml xwork-plugin.xml *.png"
+ />
+ </target>
+
+ <target name="deploy.plugins" description="Copies the plugin JAR to the jiveHome/plugins directory.">
+ <copy file="${basedir}/${plugin.jar.name}" tofile="${plugins.dir}/${plugin.jar.name}"/>
+ </target>
+
+ <target name="clean.plugins" description="Deletes generated plugin output, including classes directory in plugin source">
+ <delete dir="classes" />
+ <delete file="${plugin.jar.name}" />
+ </target>
+
+</project>
Added: labs/jbosslabs/labs-3.0-build/integration/cs-macros/pom.xml
===================================================================
--- labs/jbosslabs/labs-3.0-build/integration/cs-macros/pom.xml (rev 0)
+++ labs/jbosslabs/labs-3.0-build/integration/cs-macros/pom.xml 2008-08-22 14:20:29 UTC (rev 21727)
@@ -0,0 +1,90 @@
+<?xml version="1.0"?>
+<project>
+ <parent>
+ <artifactId>integration</artifactId>
+ <groupId>org.jboss.labs</groupId>
+ <version>1.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.jboss.labs</groupId>
+ <artifactId>cs-macros</artifactId>
+ <name>cs-macros</name>
+ <version>1.0-SNAPSHOT</version>
+ <url>http://maven.apache.org</url>
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.jivesoftware</groupId>
+ <artifactId>clearspace</artifactId>
+ <version>2.5.0.rc</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.acegisecurity</groupId>
+ <artifactId>acegi-security</artifactId>
+ <version>1.0.6</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.tangosol</groupId>
+ <artifactId>tangosol</artifactId>
+ <version>1.0</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.sun</groupId>
+ <artifactId>sun-jaxws-api</artifactId>
+ <version>1.0</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.sun</groupId>
+ <artifactId>jaxb-api</artifactId>
+ <version>1.0</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.geronimo</groupId>
+ <artifactId>geronimo-ws-metadata</artifactId>
+ <version>1.0</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus</groupId>
+ <artifactId>jra</artifactId>
+ <version>1.0</version>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.jboss.labs</groupId>
+ <artifactId>maven-labs-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>install</id>
+ <phase>install</phase>
+ <goals>
+ <goal>cs-setup</goal>
+ </goals>
+ <configuration>
+ <!-- LabsClearspaceSetupMojo configuration -->
+ <csSetupable>true</csSetupable>
+ <csDeploy>false</csDeploy>
+ <destinationFolder>JIVE_HOME/plugins</destinationFolder>
+ <resourcesFolder>target</resourcesFolder>
+ <labsDeploy>false</labsDeploy>
+ <includes>.+SNAPSHOT.jar</includes>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
Added: labs/jbosslabs/labs-3.0-build/integration/cs-macros/src/main/java/org/jboss/labs/clearspace/macro/AuthorsNameMacro.java
===================================================================
--- labs/jbosslabs/labs-3.0-build/integration/cs-macros/src/main/java/org/jboss/labs/clearspace/macro/AuthorsNameMacro.java (rev 0)
+++ labs/jbosslabs/labs-3.0-build/integration/cs-macros/src/main/java/org/jboss/labs/clearspace/macro/AuthorsNameMacro.java 2008-08-22 14:20:29 UTC (rev 21727)
@@ -0,0 +1,40 @@
+package org.jboss.labs.clearspace.macro;
+
+
+import java.util.Map;
+
+import com.jivesoftware.base.plugin.Macro;
+import com.jivesoftware.base.plugin.MacroContext;
+
+/**
+ * A simple macro that displays the name of the logged in user. This macro illustrates how to, well,
+ * write a simple macro. Essentially, your Macro implementation -- and the render method in
+ * particular -- provides your macro code with the context it needs to process what the user has
+ * done with your macro and to return the HTML markup Clearspace needs to display the published
+ * document containing your macro.
+ */
+public class AuthorsNameMacro implements Macro {
+
+ /**
+ * Called by Clearspace to get the HTML markup that should be displayed for the macro.
+ *
+ * @param body The content between the macro's tags, if any.
+ * @param parameters Parameters set by the user and passed as part of the macro.
+ * @param macroContext Information about the context in which the macro is executing.
+ */
+ public String render(String body, Map<String, String> parameters, MacroContext macroContext) {
+ return encodeInHtmlTag("b", macroContext.getContentObject().getUser().getUsername());
+ }
+
+ /**
+ * Wraps the content in the HTML tag.
+ *
+ * @param tag The HTML tag in which to wrap the content.
+ * @param content The content to wrap in HTML tags.
+ * @return The generated HTML.
+ */
+ private String encodeInHtmlTag(String tag, String content) {
+ String result = String.format("<%1$s class='author-name'>%2$s</%1$s>", tag, content);
+ return result;
+ }
+}
\ No newline at end of file
Added: labs/jbosslabs/labs-3.0-build/integration/cs-macros/src/main/resources/plugin.xml
===================================================================
--- labs/jbosslabs/labs-3.0-build/integration/cs-macros/src/main/resources/plugin.xml (rev 0)
+++ labs/jbosslabs/labs-3.0-build/integration/cs-macros/src/main/resources/plugin.xml 2008-08-22 14:20:29 UTC (rev 21727)
@@ -0,0 +1,19 @@
+<plugin xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:noNamespaceSchemaLocation="http://www.jivesoftware.com/schemas/clearspace/2_0/plugin.xsd">
+ <name>author</name>
+ <description>A simple macro that displays the name of the enclosing content's author.</description>
+ <author>Me</author>
+ <version>1.0.0</version>
+ <minServerVersion>2.0.0</minServerVersion>
+
+ <!--
+ A macro element indicates a macro included in this plugin. The class
+ attribute points to the Java implementation included in the classes directory.
+ The name attribute is the name that will be used in the macro tag in content.
+ The hasBody attribute tells Clearspace whether to look for content (the "body")
+ between two macro tags rather than just a single tag. This macro has one tag.
+ -->
+ <macro name="author" hasBody="false"
+ class="org.jboss.labs.clearspace.macro.AuthorsNameMacro" />
+
+</plugin>
\ No newline at end of file
Added: labs/jbosslabs/labs-3.0-build/integration/cs-macros/src/test/java/org/jboss/labs/AppTest.java
===================================================================
--- labs/jbosslabs/labs-3.0-build/integration/cs-macros/src/test/java/org/jboss/labs/AppTest.java (rev 0)
+++ labs/jbosslabs/labs-3.0-build/integration/cs-macros/src/test/java/org/jboss/labs/AppTest.java 2008-08-22 14:20:29 UTC (rev 21727)
@@ -0,0 +1,38 @@
+package org.jboss.labs;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+/**
+ * Unit test for simple App.
+ */
+public class AppTest
+ extends TestCase
+{
+ /**
+ * Create the test case
+ *
+ * @param testName name of the test case
+ */
+ public AppTest( String testName )
+ {
+ super( testName );
+ }
+
+ /**
+ * @return the suite of tests being tested
+ */
+ public static Test suite()
+ {
+ return new TestSuite( AppTest.class );
+ }
+
+ /**
+ * Rigourous Test :-)
+ */
+ public void testApp()
+ {
+ assertTrue( true );
+ }
+}
Modified: labs/jbosslabs/labs-3.0-build/integration/cs-nukes-login/pom.xml
===================================================================
--- labs/jbosslabs/labs-3.0-build/integration/cs-nukes-login/pom.xml 2008-08-22 14:19:46 UTC (rev 21726)
+++ labs/jbosslabs/labs-3.0-build/integration/cs-nukes-login/pom.xml 2008-08-22 14:20:29 UTC (rev 21727)
@@ -22,7 +22,7 @@
<dependency>
<groupId>com.jivesoftware</groupId>
<artifactId>clearspace</artifactId>
- <version>2.0.3</version>
+ <version>2.5.0.rc</version>
<scope>provided</scope>
</dependency>
<dependency>
Modified: labs/jbosslabs/labs-3.0-build/integration/cs-nukes-login/src/main/java/org/jboss/labs/clearspace/LabsUser.java
===================================================================
--- labs/jbosslabs/labs-3.0-build/integration/cs-nukes-login/src/main/java/org/jboss/labs/clearspace/LabsUser.java 2008-08-22 14:19:46 UTC (rev 21726)
+++ labs/jbosslabs/labs-3.0-build/integration/cs-nukes-login/src/main/java/org/jboss/labs/clearspace/LabsUser.java 2008-08-22 14:20:29 UTC (rev 21727)
@@ -29,6 +29,8 @@
private String name;
private String passHash;
private String username;
+ private String firstName;
+ private String lastName;
public LabsUser() {
@@ -43,6 +45,8 @@
username = rs.getString("pn_uname");
name = rs.getString("pn_name");
passHash = rs.getString("pn_pass");
+ firstName = rs.getString("pn_fname");
+ lastName = rs.getString("pn_lname");
}
public LabsUser(String username) {
@@ -184,4 +188,20 @@
public void setID(long id) {
this.uID = id;
}
+
+ public String getFirstName() {
+ return firstName;
+ }
+
+ public String getLastName() {
+ return lastName;
+ }
+
+ public Status getStatus() {
+ return Status.registered;
+ }
+
+ public boolean isAnonymous() {
+ return false;
+ }
}
Modified: labs/jbosslabs/labs-3.0-build/integration/pom.xml
===================================================================
--- labs/jbosslabs/labs-3.0-build/integration/pom.xml 2008-08-22 14:19:46 UTC (rev 21726)
+++ labs/jbosslabs/labs-3.0-build/integration/pom.xml 2008-08-22 14:20:29 UTC (rev 21727)
@@ -15,8 +15,9 @@
<modules>
<module>seam-guice</module>
<module>cs-nukes-login</module>
+ <module>cs-macros</module>
</modules>
<properties>
<labsrepo-rel>../..</labsrepo-rel>
</properties>
-</project>
+</project>
\ No newline at end of file
More information about the jboss-svn-commits
mailing list