Return-Path: X-Original-To: apmail-cocoon-cvs-archive@www.apache.org Delivered-To: apmail-cocoon-cvs-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3E2DD7F07 for ; Tue, 1 Nov 2011 11:03:22 +0000 (UTC) Received: (qmail 30776 invoked by uid 500); 1 Nov 2011 11:03:22 -0000 Delivered-To: apmail-cocoon-cvs-archive@cocoon.apache.org Received: (qmail 30721 invoked by uid 500); 1 Nov 2011 11:03:22 -0000 Mailing-List: contact cvs-help@cocoon.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@cocoon.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list cvs@cocoon.apache.org Received: (qmail 30714 invoked by uid 99); 1 Nov 2011 11:03:22 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Nov 2011 11:03:22 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Nov 2011 11:03:19 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id C152B238890B for ; Tue, 1 Nov 2011 11:02:57 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1195924 - in /cocoon/cocoon3/trunk/cocoon-cli/src/main/java/org/apache/cocoon/cli: PipelineDescriptorModule.java PipelinesRegistry.java Date: Tue, 01 Nov 2011 11:02:57 -0000 To: cvs@cocoon.apache.org From: simonetripodi@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20111101110257.C152B238890B@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: simonetripodi Date: Tue Nov 1 11:02:55 2011 New Revision: 1195924 URL: http://svn.apache.org/viewvc?rev=1195924&view=rev Log: first checkin of PipelinesRegistry class plugged the rule to create the registry Added: cocoon/cocoon3/trunk/cocoon-cli/src/main/java/org/apache/cocoon/cli/PipelinesRegistry.java (with props) Modified: cocoon/cocoon3/trunk/cocoon-cli/src/main/java/org/apache/cocoon/cli/PipelineDescriptorModule.java Modified: cocoon/cocoon3/trunk/cocoon-cli/src/main/java/org/apache/cocoon/cli/PipelineDescriptorModule.java URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-cli/src/main/java/org/apache/cocoon/cli/PipelineDescriptorModule.java?rev=1195924&r1=1195923&r2=1195924&view=diff ============================================================================== --- cocoon/cocoon3/trunk/cocoon-cli/src/main/java/org/apache/cocoon/cli/PipelineDescriptorModule.java (original) +++ cocoon/cocoon3/trunk/cocoon-cli/src/main/java/org/apache/cocoon/cli/PipelineDescriptorModule.java Tue Nov 1 11:02:55 2011 @@ -32,9 +32,11 @@ final class PipelineDescriptorModule @Override protected void configure() { - // TODO prepare the DataStructure - forPattern( "pipelines" ); - + forPattern( "pipelines" ) + .createObject().ofType( PipelinesRegistry.class ) + .then() + .setProperties() + .addAlias( "default", "defaultId" ); forPattern( "pipelines/pipeline" ).addRuleCreatedBy( new PipelineCreateRuleProvider() ); forPattern( "pipelines/pipeline/generator" ).addRuleCreatedBy( new CreateXMLGeneratorRuleProvider() ); } Added: cocoon/cocoon3/trunk/cocoon-cli/src/main/java/org/apache/cocoon/cli/PipelinesRegistry.java URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-cli/src/main/java/org/apache/cocoon/cli/PipelinesRegistry.java?rev=1195924&view=auto ============================================================================== --- cocoon/cocoon3/trunk/cocoon-cli/src/main/java/org/apache/cocoon/cli/PipelinesRegistry.java (added) +++ cocoon/cocoon3/trunk/cocoon-cli/src/main/java/org/apache/cocoon/cli/PipelinesRegistry.java Tue Nov 1 11:02:55 2011 @@ -0,0 +1,66 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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.cocoon.cli; + +import java.util.HashMap; +import java.util.Map; + +import org.apache.cocoon.pipeline.Pipeline; +import org.apache.cocoon.sax.SAXPipelineComponent; + +final class PipelinesRegistry +{ + + private final Map> registry = new HashMap>(); + + private String name; + + private String defaultId; + + public String getName() + { + return name; + } + + public void setName( String name ) + { + this.name = name; + } + + public String getDefaultId() + { + return defaultId; + } + + public void setDefaultId( String defaultId ) + { + this.defaultId = defaultId; + } + + public Pipeline getDefaultPipeline() + { + return registry.get( defaultId ); + } + + public Pipeline getPipeline( String id ) + { + return registry.get( id ); + } + +} Propchange: cocoon/cocoon3/trunk/cocoon-cli/src/main/java/org/apache/cocoon/cli/PipelinesRegistry.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: cocoon/cocoon3/trunk/cocoon-cli/src/main/java/org/apache/cocoon/cli/PipelinesRegistry.java ------------------------------------------------------------------------------ svn:keywords = Date Author Id Revision HeadURL Propchange: cocoon/cocoon3/trunk/cocoon-cli/src/main/java/org/apache/cocoon/cli/PipelinesRegistry.java ------------------------------------------------------------------------------ svn:mime-type = text/plain