Author: piergiorgiolucidi
Date: 2009-03-03 13:54:10 -0500 (Tue, 03 Mar 2009)
New Revision: 248
Added:
contrib/wikiPortlet/trunk/wiki-management/
contrib/wikiPortlet/trunk/wiki-management/.classpath
contrib/wikiPortlet/trunk/wiki-management/.project
contrib/wikiPortlet/trunk/wiki-management/.settings/
contrib/wikiPortlet/trunk/wiki-management/.settings/org.maven.ide.eclipse.prefs
contrib/wikiPortlet/trunk/wiki-management/maven.xml
contrib/wikiPortlet/trunk/wiki-management/pom.xml
contrib/wikiPortlet/trunk/wiki-management/project.properties
contrib/wikiPortlet/trunk/wiki-management/project.xml
contrib/wikiPortlet/trunk/wiki-management/src/
contrib/wikiPortlet/trunk/wiki-management/src/java/
contrib/wikiPortlet/trunk/wiki-management/src/java/bmsi/
contrib/wikiPortlet/trunk/wiki-management/src/java/org/
contrib/wikiPortlet/trunk/wiki-management/src/java/org/apache/
contrib/wikiPortlet/trunk/wiki-management/src/java/org/apache/commons/
contrib/wikiPortlet/trunk/wiki-management/src/java/org/jboss/
contrib/wikiPortlet/trunk/wiki-management/src/java/org/jboss/wiki/
contrib/wikiPortlet/trunk/wiki-management/src/java/org/jboss/wiki/EMailNotifierSLSB.java
contrib/wikiPortlet/trunk/wiki-management/src/java/org/jboss/wiki/MailNotificationBean.java
contrib/wikiPortlet/trunk/wiki-management/src/java/org/jboss/wiki/management/
contrib/wikiPortlet/trunk/wiki-management/src/java/org/jboss/wiki/management/WikiService.java
contrib/wikiPortlet/trunk/wiki-management/src/java/org/jboss/wiki/taglib/
contrib/wikiPortlet/trunk/wiki-management/src/java/org/jboss/wiki/test/
contrib/wikiPortlet/trunk/wiki-management/src/test/
contrib/wikiPortlet/trunk/wiki-management/src/web/
contrib/wikiPortlet/trunk/wiki-management/src/web/WEB-INF/
Log:
- Portal 2.7.x support: wiki-management
Added: contrib/wikiPortlet/trunk/wiki-management/.classpath
===================================================================
--- contrib/wikiPortlet/trunk/wiki-management/.classpath (rev 0)
+++ contrib/wikiPortlet/trunk/wiki-management/.classpath 2009-03-03 18:54:10 UTC (rev
248)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src/java"/>
+ <classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con"
path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+ <classpathentry combineaccessrules="false" kind="src"
path="/wiki-common"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Added: contrib/wikiPortlet/trunk/wiki-management/.project
===================================================================
--- contrib/wikiPortlet/trunk/wiki-management/.project (rev 0)
+++ contrib/wikiPortlet/trunk/wiki-management/.project 2009-03-03 18:54:10 UTC (rev 248)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>wiki-management</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.maven.ide.eclipse.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.maven.ide.eclipse.maven2Nature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Added: contrib/wikiPortlet/trunk/wiki-management/.settings/org.maven.ide.eclipse.prefs
===================================================================
--- contrib/wikiPortlet/trunk/wiki-management/.settings/org.maven.ide.eclipse.prefs
(rev 0)
+++
contrib/wikiPortlet/trunk/wiki-management/.settings/org.maven.ide.eclipse.prefs 2009-03-03
18:54:10 UTC (rev 248)
@@ -0,0 +1,8 @@
+#Fri Jan 23 21:38:44 CET 2009
+activeProfiles=
+eclipse.preferences.version=1
+fullBuildGoals=process-test-resources
+includeModules=false
+resolveWorkspaceProjects=true
+resourceFilterGoals=process-resources resources\:testResources
+version=1
Added: contrib/wikiPortlet/trunk/wiki-management/maven.xml
===================================================================
--- contrib/wikiPortlet/trunk/wiki-management/maven.xml (rev 0)
+++ contrib/wikiPortlet/trunk/wiki-management/maven.xml 2009-03-03 18:54:10 UTC (rev 248)
@@ -0,0 +1,24 @@
+<!--
+ JBoss, the OpenSource J2EE webOS
+ Distributable under LGPL license.
+ See terms of license at
gnu.org.
+ -->
+<project xmlns:j="jelly:core" xmlns:ant="jelly:ant"
xmlns:u="jelly:util" >
+ <goal name="build">
+ <attainGoal name="ejb" />
+ </goal>
+
+ <goal name="deploy">
+
+ <!--<ant:copy
+ tofile="${local.deploy.dir}/${wiki.ear.name}/wiki.ejb3"
+ file="target/wiki-management-1.0.jar" />-->
+
+ </goal>
+
+ <goal name="all">
+ <attainGoal name="build" />
+ <attainGoal name="deploy" />
+ </goal>
+
+</project>
Added: contrib/wikiPortlet/trunk/wiki-management/pom.xml
===================================================================
--- contrib/wikiPortlet/trunk/wiki-management/pom.xml (rev 0)
+++ contrib/wikiPortlet/trunk/wiki-management/pom.xml 2009-03-03 18:54:10 UTC (rev 248)
@@ -0,0 +1,132 @@
+<!--
+ JBoss, the OpenSource J2EE webOS Distributable under LGPL license. See
+ terms of license at
gnu.org.
+ Maven manual install: portal-core-lib.jar
+ portal-portlet-lib javax-servlet.jar javax-servlet-jsp.jar
+ activation.jar jboss-ejb3x.jar jboss-ejb3.jar portal-identity-lib.jar
+ jboss-portlet-api-lib.jar
+
+ author: Piergiorgio Lucidi
+-->
+<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>
+ <parent>
+ <groupId>jboss</groupId>
+ <artifactId>wiki</artifactId>
+ <version>1.0</version>
+ </parent>
+ <artifactId>wiki-management</artifactId>
+ <name>JBoss Wiki Management</name>
+ <version>1.0</version>
+ <packaging>jar</packaging>
+ <developers>
+ <developer>
+ <name>Tomasz Szymanski</name>
+ <url>http://mamut.net.pl</url>
+ <roles>
+ <role>Retired Project Lead</role>
+ </roles>
+ </developer>
+ <developer>
+ <name>Piergiorgio Lucidi</name>
+ <email>p.lucidi(a)sourcesense.com</email>
+ <
url>http://www.open4dev.com/</url>
+ <roles>
+ <role>Project Lead</role>
+ </roles>
+ <organization>Sourcesense</organization>
+ <
organizationUrl>http://www.sourcesense.com/</organizationUrl>
+ </developer>
+ </developers>
+ <build>
+ <sourceDirectory>src/java</sourceDirectory>
+ <resources>
+ <resource>
+ <directory>src/etc/</directory>
+ <includes>
+ <include>**/*.properties</include>
+ <include>**/*.xml</include>
+ <include>**/*.types</include>
+ </includes>
+ </resource>
+ </resources>
+ <plugins>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-jar-plugin</artifactId>
+ <version>2.2</version>
+ <configuration>
+ <finalName>wiki-management</finalName>
+ <outputDirectory>../target/</outputDirectory>
+ <archive>
+ <manifest>
+ <addClasspath>true</addClasspath>
+ <addExtensions>true</addExtensions>
+ </manifest>
+ <manifestEntries>
+ <mode>development</mode>
+ <url>${pom.url}</url>
+ </manifestEntries>
+ </archive>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <dependencies>
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>wiki-common</artifactId>
+ <version>1.0</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-j2ee</artifactId>
+ <version>1.0</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-mail</artifactId>
+ <version>1.0</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-annotations-ejb3</artifactId>
+ <version>1.0</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.openejb</groupId>
+ <artifactId>javaee-api</artifactId>
+ <version>5.0-1</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.portlet</groupId>
+ <artifactId>portlet-api</artifactId>
+ <version>1.0</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-ejb3</artifactId>
+ <version>1.0</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-ejb3x</artifactId>
+ <version>1.0</version>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+</project>
Added: contrib/wikiPortlet/trunk/wiki-management/project.properties
===================================================================
--- contrib/wikiPortlet/trunk/wiki-management/project.properties
(rev 0)
+++ contrib/wikiPortlet/trunk/wiki-management/project.properties 2009-03-03 18:54:10 UTC
(rev 248)
@@ -0,0 +1,3 @@
+maven.repo.remote=http://repository.atlassian.com,http://www.ibiblio.org/maven,http://dist.codehaus.org/
+maven.junit.fork=yes
+maven.war.src=${basedir}/src/web
Added: contrib/wikiPortlet/trunk/wiki-management/project.xml
===================================================================
--- contrib/wikiPortlet/trunk/wiki-management/project.xml (rev 0)
+++ contrib/wikiPortlet/trunk/wiki-management/project.xml 2009-03-03 18:54:10 UTC (rev
248)
@@ -0,0 +1,144 @@
+<?xml version='1.0' encoding='ISO-8859-1'?>
+<!--
+ JBoss, the OpenSource J2EE webOS
+ Distributable under LGPL license.
+ See terms of license at
gnu.org.
+ -->
+<project>
+ <pomVersion>3</pomVersion>
+ <extend>../common.xml</extend>
+ <id>wiki-management</id>
+ <name>Wiki Management(EJB3)</name>
+ <currentVersion>1.0</currentVersion>
+ <build>
+ <sourceDirectory>src/java</sourceDirectory>
+ <resources>
+ <resource>
+ <directory>src/etc/</directory>
+ <include>**/*.properties</include>
+ </resource>
+ <resource>
+ <directory>src/etc/</directory>
+ <include>**/*.xml</include>
+ </resource>
+ <resource>
+ <directory>src/etc/</directory>
+ <include>**/*.types</include>
+ </resource>
+ </resources>
+ </build>
+ <organization>
+ <name>Tomasz Szymanski</name>
+ <url>http://mamut.net.pl</url>
+ </organization>
+
+ <dependencies>
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-j2ee</artifactId>
+ <version>1.0</version>
+ <jar>jboss-j2ee.jar</jar>
+ </dependency>
+
+ <dependency>
+ <groupId>wiki-common</groupId>
+ <artifactId>wiki-common</artifactId>
+ <version>1.0</version>
+ <properties>
+� � � � � � � � <ejb.manifest.classpath>true</ejb.manifest.classpath>
+� � � � � � </properties>
+ <jar>wiki-common.jar</jar>
+ </dependency>
+
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-mail</artifactId>
+ <version>1.0</version>
+ <jar>mail.jar</jar>
+ </dependency>
+
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>activation</artifactId>
+ <version>1.0</version>
+ <jar>activation.jar</jar>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-fileupload</groupId>
+ <artifactId>commons-fileupload.jar</artifactId>
+ <version>1.0</version>
+ <jar>commons-fileupload-1.0.jar</jar>
+ </dependency>
+
+ <dependency>
+ <groupId>dom4j</groupId>
+ <artifactId>dom4j</artifactId>
+ <version>1.6</version>
+ </dependency>
+
+ <dependency>
+ <groupId>jdom</groupId>
+ <artifactId>jdom</artifactId>
+ <version>1.0</version>
+ </dependency>
+
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-ejb3x</artifactId>
+ <version>1.0</version>
+ <jar>jboss-ejb3x.jar</jar>
+ </dependency>
+
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-ejb3</artifactId>
+ <version>1.0</version>
+ <jar>jboss-ejb3.jar</jar>
+ </dependency>
+
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-annotations-ejb3</artifactId>
+ <version>1.0</version>
+ <jar>jboss-annotations-ejb3.jar</jar>
+ </dependency>
+
+
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-jmx</artifactId>
+ <version>1.0</version>
+ <jar>jboss-jmx.jar</jar>
+ </dependency>
+
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-common</artifactId>
+ <version>1.0</version>
+ <jar>jboss-common.jar</jar>
+ </dependency>
+
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>portal-common-lib</artifactId>
+ <version>1.0</version>
+ <jar>portal-common-lib.jar</jar>
+ </dependency>
+
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>portal-core-lib</artifactId>
+ <version>1.0</version>
+ <jar>portal-core-lib.jar</jar>
+ </dependency>
+
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>portal-portlet-lib</artifactId>
+ <version>1.0</version>
+ <jar>portal-portlet-lib.jar</jar>
+ </dependency>
+
+ </dependencies>
+</project>
Added:
contrib/wikiPortlet/trunk/wiki-management/src/java/org/jboss/wiki/EMailNotifierSLSB.java
===================================================================
---
contrib/wikiPortlet/trunk/wiki-management/src/java/org/jboss/wiki/EMailNotifierSLSB.java
(rev 0)
+++
contrib/wikiPortlet/trunk/wiki-management/src/java/org/jboss/wiki/EMailNotifierSLSB.java 2009-03-03
18:54:10 UTC (rev 248)
@@ -0,0 +1,78 @@
+package org.jboss.wiki;
+
+import java.util.Date;
+
+import javax.ejb.Stateless;
+import javax.mail.Address;
+import javax.mail.MessagingException;
+import javax.mail.Session;
+import javax.mail.Transport;
+import javax.mail.Message.RecipientType;
+import javax.mail.internet.AddressException;
+import javax.mail.internet.InternetAddress;
+import javax.mail.internet.MimeMessage;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import javax.rmi.PortableRemoteObject;
+
+import org.jboss.logging.Logger;
+import org.jboss.wiki.management.EMailNotifier;
+import org.jboss.wiki.management.NotificationMsg;
+
+@Stateless
+public class EMailNotifierSLSB implements EMailNotifier {
+
+ private static final Logger log = Logger.getLogger(EMailNotifier.class);
+
+ public synchronized void sendNotification(NotificationMsg notifications) {
+
+ try {
+ Session session = (Session) PortableRemoteObject.narrow(
+ new InitialContext().lookup("java:Mail"), Session.class);
+
+ log.debug("Got email notification msg");
+
+ for (String email : notifications.getEmails()) {
+ log.debug("MDB for: " + email);
+
+ StringBuffer buffer = null;
+ Address[] to = null;
+ MimeMessage m = new MimeMessage(session);
+
+ if (email != null) {
+ m
+ .setFrom(new InternetAddress(notifications
+ .getFromEmail()));
+ to = new InternetAddress[] { new InternetAddress(email) };
+ m.setRecipients(RecipientType.TO, to);
+ m.setSubject("[JBossWiki] Page change notification: "
+ + notifications.getPageName());
+
+ m.setSentDate(new Date());
+ buffer = new StringBuffer();
+
+ buffer
+ .append(
+ "This message is generated automatically. Please do not reply. To remove
yourself from the watch list please go to ")
+ .append(notifications.getPageLink()).append(
+ "<br />\n");
+ buffer.append(notifications.getPageContent());
+
+ m.setContent(buffer.toString(),
+ "text/html; charset=\"UTF-8\"");
+ Transport.send(m);
+ log.debug("Notification send to: "+email);
+ }
+ }
+ } catch (ClassCastException e) {
+ log.error(e);
+ } catch (NamingException e) {
+ log.error(e);
+ } catch (AddressException e) {
+ log.error(e);
+ } catch (MessagingException e) {
+ log.error(e);
+ }
+ }
+
+}
Added:
contrib/wikiPortlet/trunk/wiki-management/src/java/org/jboss/wiki/MailNotificationBean.java
===================================================================
---
contrib/wikiPortlet/trunk/wiki-management/src/java/org/jboss/wiki/MailNotificationBean.java
(rev 0)
+++
contrib/wikiPortlet/trunk/wiki-management/src/java/org/jboss/wiki/MailNotificationBean.java 2009-03-03
18:54:10 UTC (rev 248)
@@ -0,0 +1,105 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+/*package org.jboss.wiki;
+
+import java.util.Date;
+
+import javax.jms.Message;
+import javax.jms.MessageListener;
+import javax.jms.ObjectMessage;
+import javax.mail.Address;
+import javax.mail.Session;
+import javax.mail.Transport;
+import javax.mail.Message.RecipientType;
+import javax.mail.internet.InternetAddress;
+import javax.mail.internet.MimeMessage;
+import javax.naming.InitialContext;
+import javax.rmi.PortableRemoteObject;
+import javax.ejb.MessageDriven;
+
+import org.jboss.logging.Logger;
+import org.jboss.wiki.management.NotificationMsg;
+
+public @MessageDriven(activateConfig = {
+ @javax.ejb.ActivationConfigProperty(propertyName = "destinationType",
propertyValue = "javax.jms.Queue"),
+ @javax.ejb.ActivationConfigProperty(propertyName = "destination",
propertyValue = "queue/wikiNotifications") })
+class MailNotificationBean implements MessageListener {
+
+ private Logger log = Logger.getLogger(this.getClass());
+
+ public void onMessage(Message msg) {
+
+ log.debug("Mail");
+
+ try {
+
+ ObjectMessage omsg = (ObjectMessage) msg;
+ Session session = null;
+
+ try {
+ session = (Session) PortableRemoteObject
+ .narrow(new InitialContext().lookup("java:Mail"),
+ Session.class);
+ try {
+ if (omsg.getObject() instanceof NotificationMsg) {
+ NotificationMsg notifications = (NotificationMsg) omsg
+ .getObject();
+
+ log.debug("Got email notification msg");
+
+ for (String email : notifications.getEmails()) {
+ log.debug("MDB for: " + email);
+
+ StringBuffer buffer = null;
+ Address[] to = null;
+ MimeMessage m = new MimeMessage(session);
+
+ if (email != null) {
+ m.setFrom(new InternetAddress(notifications.getFromEmail()));
+ to = new InternetAddress[] { new InternetAddress(
+ email) };
+ m.setRecipients(RecipientType.TO, to);
+ m.setSubject("[JBossWiki] Page change notification: " +
notifications.getPageName());
+
+ m.setSentDate(new Date());
+ buffer = new StringBuffer();
+
+ buffer.append("This message is generated automaticcaly. Please do not reply.
To remove yourself from the watch list please go to
").append(notifications.getPageLink()).append("<br />\n");
+ buffer.append(notifications.getPageContent());
+
+ m.setContent(buffer.toString(), "text/html;
charset=\"UTF-8\"");
+ Transport.send(m);
+ }
+ }
+ }
+ } catch (javax.mail.MessagingException e) {
+ log.error(e);
+ }
+ } catch (javax.naming.NamingException e) {
+ log.error(e);
+ }
+ } catch (Exception e) {
+ log.error(e);
+ }
+
+ }
+}*/
Added:
contrib/wikiPortlet/trunk/wiki-management/src/java/org/jboss/wiki/management/WikiService.java
===================================================================
---
contrib/wikiPortlet/trunk/wiki-management/src/java/org/jboss/wiki/management/WikiService.java
(rev 0)
+++
contrib/wikiPortlet/trunk/wiki-management/src/java/org/jboss/wiki/management/WikiService.java 2009-03-03
18:54:10 UTC (rev 248)
@@ -0,0 +1,68 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.wiki.management;
+
+import javax.ejb.Local;
+import javax.ejb.Remote;
+
+import org.jboss.annotation.ejb.Management;
+import org.jboss.annotation.ejb.Service;
+import org.jboss.logging.Logger;
+import org.jboss.wiki.WikiCommon;
+import org.jboss.wiki.WikiEngine;
+import org.jboss.wiki.management.WikiServiceManagement;
+
+@Service(objectName = WikiCommon.WIKI_SERVICE_NAME)
+(a)Local(WikiServiceLocal.class)
+(a)Remote(WikiServiceRemote.class)
+(a)Management(WikiServiceManagement.class)
+public class WikiService implements WikiServiceLocal, WikiServiceRemote,
+ WikiServiceManagement {
+
+ private WikiEngine wikiEngine;
+
+ private Logger log = Logger.getLogger(WikiService.class);
+
+ public synchronized WikiEngine getWikiEngine() {
+ if (wikiEngine == null) {
+ wikiEngine = new WikiEngine();
+ }
+ return wikiEngine;
+ }
+
+ public void create() throws Exception {
+ log.info("WikiService - Creating");
+ }
+
+ public void start() throws Exception {
+ log.info("WikiService - Starting");
+ }
+
+ public void stop() {
+ log.info("WikiService - Stoping");
+ }
+
+ public void destroy() {
+ log.info("WikiService - Destroying");
+ }
+
+}