You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by an...@apache.org on 2006/07/28 18:34:16 UTC

svn commit: r426605 - in /lenya/trunk/src: impl/java/org/apache/lenya/cms/repository/AxisUUIDGenerator.java impl/java/org/apache/lenya/cms/repository/UUIDGenerator.java webapp/lenya/config/cocoon-xconf/misc/uuid-generator.xconf

Author: andreas
Date: Fri Jul 28 09:34:16 2006
New Revision: 426605

URL: http://svn.apache.org/viewvc?rev=426605&view=rev
Log:
Add UUID generator service

Added:
    lenya/trunk/src/impl/java/org/apache/lenya/cms/repository/AxisUUIDGenerator.java
    lenya/trunk/src/impl/java/org/apache/lenya/cms/repository/UUIDGenerator.java
    lenya/trunk/src/webapp/lenya/config/cocoon-xconf/misc/uuid-generator.xconf

Added: lenya/trunk/src/impl/java/org/apache/lenya/cms/repository/AxisUUIDGenerator.java
URL: http://svn.apache.org/viewvc/lenya/trunk/src/impl/java/org/apache/lenya/cms/repository/AxisUUIDGenerator.java?rev=426605&view=auto
==============================================================================
--- lenya/trunk/src/impl/java/org/apache/lenya/cms/repository/AxisUUIDGenerator.java (added)
+++ lenya/trunk/src/impl/java/org/apache/lenya/cms/repository/AxisUUIDGenerator.java Fri Jul 28 09:34:16 2006
@@ -0,0 +1,33 @@
+/*
+ * Copyright  1999-2005 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ */
+package org.apache.lenya.cms.repository;
+
+import org.apache.avalon.framework.logger.AbstractLogEnabled;
+import org.apache.axis.components.uuid.UUIDGen;
+import org.apache.axis.components.uuid.UUIDGenFactory;
+
+/**
+ * UUID generator based on Apache Axis.
+ */
+public class AxisUUIDGenerator extends AbstractLogEnabled implements UUIDGenerator {
+
+    public String nextUUID() {
+        UUIDGen generator = UUIDGenFactory.getUUIDGen();
+        return generator.nextUUID();
+    }
+
+}

Added: lenya/trunk/src/impl/java/org/apache/lenya/cms/repository/UUIDGenerator.java
URL: http://svn.apache.org/viewvc/lenya/trunk/src/impl/java/org/apache/lenya/cms/repository/UUIDGenerator.java?rev=426605&view=auto
==============================================================================
--- lenya/trunk/src/impl/java/org/apache/lenya/cms/repository/UUIDGenerator.java (added)
+++ lenya/trunk/src/impl/java/org/apache/lenya/cms/repository/UUIDGenerator.java Fri Jul 28 09:34:16 2006
@@ -0,0 +1,34 @@
+/*
+ * Copyright  1999-2005 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ */
+package org.apache.lenya.cms.repository;
+
+/**
+ * UUID generator.
+ */
+public interface UUIDGenerator {
+
+    /**
+     * The service role.
+     */
+    String ROLE = UUIDGenerator.class.getName();
+
+    /**
+     * @return A new UUID.
+     */
+    public String nextUUID();
+    
+}

Added: lenya/trunk/src/webapp/lenya/config/cocoon-xconf/misc/uuid-generator.xconf
URL: http://svn.apache.org/viewvc/lenya/trunk/src/webapp/lenya/config/cocoon-xconf/misc/uuid-generator.xconf?rev=426605&view=auto
==============================================================================
--- lenya/trunk/src/webapp/lenya/config/cocoon-xconf/misc/uuid-generator.xconf (added)
+++ lenya/trunk/src/webapp/lenya/config/cocoon-xconf/misc/uuid-generator.xconf Fri Jul 28 09:34:16 2006
@@ -0,0 +1,27 @@
+<?xml version="1.0"?>
+<!--
+  Copyright 1999-2005 The Apache Software Foundation
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+<!-- $Id: usecases-workflow-deactivate.xconf 348547 2005-11-23 20:13:01Z chestnut $ -->
+<!--
+    This file defines the publication specific use-cases
+-->
+
+  <xconf xpath="/cocoon" unless="/cocoon/component[@role = 'org.apache.lenya.cms.repository.UUIDGenerator']">
+    <component role="org.apache.lenya.cms.repository.UUIDGenerator"
+      logger="lenya.cocoon.components"
+      class="org.apache.lenya.cms.repository.AxisUUIDGenerator"/>
+  </xconf>



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@lenya.apache.org
For additional commands, e-mail: commits-help@lenya.apache.org