karaf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject [6/6] git commit: [KARAF-2805] Remove the help bundle which is now integrated in core
Date Thu, 06 Mar 2014 00:40:09 GMT
[KARAF-2805] Remove the help bundle which is now integrated in core

Project: http://git-wip-us.apache.org/repos/asf/karaf/repo
Commit: http://git-wip-us.apache.org/repos/asf/karaf/commit/42787103
Tree: http://git-wip-us.apache.org/repos/asf/karaf/tree/42787103
Diff: http://git-wip-us.apache.org/repos/asf/karaf/diff/42787103

Branch: refs/heads/master
Commit: 427871032a8e946ba985c719b4b7f82f69da4d4b
Parents: ed9f078
Author: Guillaume Nodet <gnodet@gmail.com>
Authored: Thu Mar 6 01:39:40 2014 +0100
Committer: Guillaume Nodet <gnodet@gmail.com>
Committed: Thu Mar 6 01:39:40 2014 +0100

----------------------------------------------------------------------
 pom.xml                                         |   5 -
 shell/help/NOTICE                               |  71 ---------
 shell/help/pom.xml                              | 122 ---------------
 .../help/impl/CommandListHelpProvider.java      | 152 -------------------
 .../karaf/shell/help/impl/HelpAction.java       |  47 ------
 .../karaf/shell/help/impl/HelpSystem.java       |  85 -----------
 .../shell/help/impl/SimpleHelpProvider.java     |  48 ------
 .../help/impl/SingleCommandHelpProvider.java    |  71 ---------
 .../OSGI-INF/blueprint/shell-commands.xml       |  78 ----------
 .../src/main/resources/OSGI-INF/bundle.info     |  18 ---
 .../services/org/apache/karaf/shell/commands    |  17 ---
 shell/pom.xml                                   |   1 -
 12 files changed, 715 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/karaf/blob/42787103/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 5a37852..938537e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -651,11 +651,6 @@
             </dependency>
             <dependency>
                 <groupId>org.apache.karaf.shell</groupId>
-                <artifactId>org.apache.karaf.shell.help</artifactId>
-                <version>${project.version}</version>
-            </dependency>
-            <dependency>
-                <groupId>org.apache.karaf.shell</groupId>
                 <artifactId>org.apache.karaf.shell.table</artifactId>
                 <version>${project.version}</version>
             </dependency>

http://git-wip-us.apache.org/repos/asf/karaf/blob/42787103/shell/help/NOTICE
----------------------------------------------------------------------
diff --git a/shell/help/NOTICE b/shell/help/NOTICE
deleted file mode 100644
index b70f1f9..0000000
--- a/shell/help/NOTICE
+++ /dev/null
@@ -1,71 +0,0 @@
-Apache Karaf
-Copyright 2010-2014 The Apache Software Foundation
-
-
-I. Included Software
-
-This product includes software developed at
-The Apache Software Foundation (http://www.apache.org/).
-Licensed under the Apache License 2.0.
-
-This product uses software developed at
-The OSGi Alliance (http://www.osgi.org/).
-Copyright (c) OSGi Alliance (2000, 2010).
-Licensed under the Apache License 2.0.
-
-This product includes software developed at
-OW2 (http://www.ow2.org/).
-Licensed under the BSD License.
-
-This product includes software developed at
-OPS4J (http://www.ops4j.org/).
-Licensed under the Apache License 2.0.
-
-This product includes software developed at
-Eclipse Foundation (http://www.eclipse.org/).
-Licensed under the EPL.
-
-This product includes software written by
-Antony Lesuisse.
-Licensed under Public Domain.
-
-
-II. Used Software
-
-This product uses software developed at
-FUSE Source (http://www.fusesource.org/).
-Licensed under the Apache License 2.0.
-
-This product uses software developed at
-AOP Alliance (http://aopalliance.sourceforge.net/).
-Licensed under the Public Domain.
-
-This product uses software developed at
-Tanuki Software (http://www.tanukisoftware.com/).
-Licensed under the Apache License 2.0.
-
-This product uses software developed at
-Jasypt (http://jasypt.sourceforge.net/).
-Licensed under the Apache License 2.0.
-
-This product uses software developed at
-JLine (http://jline.sourceforge.net).
-Licensed under the BSD License.
-
-This product uses software developed at
-SLF4J (http://www.slf4j.org/).
-Licensed under the MIT License.
-
-This product uses software developed at
-SpringSource (http://www.springsource.org/).
-Licensed under the Apache License 2.0.
-
-This product includes software from http://www.json.org.
-Copyright (c) 2002 JSON.org
-
-
-III. License Summary
-- Apache License 2.0
-- BSD License
-- EPL License
-- MIT License

http://git-wip-us.apache.org/repos/asf/karaf/blob/42787103/shell/help/pom.xml
----------------------------------------------------------------------
diff --git a/shell/help/pom.xml b/shell/help/pom.xml
deleted file mode 100644
index 4273703..0000000
--- a/shell/help/pom.xml
+++ /dev/null
@@ -1,122 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<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/xsd/maven-4.0.0.xsd">
-
-    <!--
-
-        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.
-    -->
-
-    <modelVersion>4.0.0</modelVersion>
-
-    <parent>
-        <groupId>org.apache.karaf.shell</groupId>
-        <artifactId>shell</artifactId>
-        <version>3.1.0-SNAPSHOT</version>
-        <relativePath>../pom.xml</relativePath>
-    </parent>
-
-    <artifactId>org.apache.karaf.shell.help</artifactId>
-    <packaging>bundle</packaging>
-    <name>Apache Karaf :: Shell :: Help System</name>
-    <description>This bundles provides the karaf help system</description>
-
-    <properties>
-        <appendedResourcesDirectory>${basedir}/../../etc/appended-resources</appendedResourcesDirectory>
-    </properties>
-
-    <dependencies>
-        <dependency>
-            <groupId>org.apache.karaf.shell</groupId>
-            <artifactId>org.apache.karaf.shell.console</artifactId>
-            <scope>provided</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.karaf.shell</groupId>
-            <artifactId>org.apache.karaf.shell.table</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.karaf.shell</groupId>
-            <artifactId>org.apache.karaf.shell.console</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.felix</groupId>
-            <artifactId>org.apache.felix.gogo.runtime</artifactId>
-            <scope>provided</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.karaf</groupId>
-            <artifactId>org.apache.karaf.util</artifactId>
-            <scope>provided</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.osgi</groupId>
-            <artifactId>org.osgi.compendium</artifactId>
-            <scope>provided</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.osgi</groupId>
-            <artifactId>org.osgi.core</artifactId>
-            <scope>provided</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.slf4j</groupId>
-            <artifactId>slf4j-api</artifactId>
-            <scope>provided</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.slf4j</groupId>
-            <artifactId>slf4j-simple</artifactId>
-            <scope>test</scope>
-        </dependency>
-    </dependencies>
-
-    <build>
-        <resources>
-            <resource>
-                <directory>${project.basedir}/src/main/resources</directory>
-                <includes>
-                    <include>**/*</include>
-                </includes>
-            </resource>
-            <resource>
-                <directory>${project.basedir}/src/main/resources</directory>
-                <filtering>true</filtering>
-                <includes>
-                    <include>**/*.info</include>
-                </includes>
-            </resource>
-        </resources>
-        <plugins>
-            <plugin>
-                <groupId>org.apache.felix</groupId>
-                <artifactId>maven-bundle-plugin</artifactId>
-                <configuration>
-                    <instructions>
-                        <Export-Package>
-                        	!org.apache.karaf.shell.help.impl*
-                        </Export-Package>
-                        <Private-Package>
-                            org.apache.karaf.util.process;-split-package:=merge-first,
-                            org.apache.karaf.util.properties;-split-package:=merge-first,
-                            org.apache.karaf.shell.help.impl*
-                        </Private-Package>
-                    </instructions>
-                </configuration>
-            </plugin>
-        </plugins>
-    </build>
-
-</project>

http://git-wip-us.apache.org/repos/asf/karaf/blob/42787103/shell/help/src/main/java/org/apache/karaf/shell/help/impl/CommandListHelpProvider.java
----------------------------------------------------------------------
diff --git a/shell/help/src/main/java/org/apache/karaf/shell/help/impl/CommandListHelpProvider.java
b/shell/help/src/main/java/org/apache/karaf/shell/help/impl/CommandListHelpProvider.java
deleted file mode 100644
index 98102c4..0000000
--- a/shell/help/src/main/java/org/apache/karaf/shell/help/impl/CommandListHelpProvider.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/**
- *
- * 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.karaf.shell.help.impl;
-
-import java.io.ByteArrayOutputStream;
-import java.io.PrintStream;
-import java.lang.reflect.Field;
-import java.util.Map;
-import java.util.Set;
-import java.util.SortedMap;
-import java.util.TreeMap;
-
-import jline.Terminal;
-
-import org.apache.felix.gogo.commands.Action;
-import org.apache.felix.service.command.CommandSession;
-import org.apache.felix.service.command.Function;
-import org.apache.karaf.shell.commands.Command;
-import org.apache.karaf.shell.commands.CommandWithAction;
-import org.apache.karaf.shell.commands.basic.AbstractCommand;
-import org.apache.karaf.shell.commands.meta.ActionMetaDataFactory;
-import org.apache.karaf.shell.console.HelpProvider;
-import org.apache.karaf.shell.console.NameScoping;
-import org.apache.karaf.shell.console.SessionProperties;
-import org.apache.karaf.shell.table.Col;
-import org.apache.karaf.shell.table.ShellTable;
-import org.fusesource.jansi.Ansi;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceReference;
-
-public class CommandListHelpProvider implements HelpProvider {
-
-    public static final String COMMANDS = ".commands";
-
-    public String getHelp(CommandSession session, String path) {
-        if (path.indexOf('|') > 0) {
-            if (path.startsWith("command-list|")) {
-                path = path.substring("command-list|".length());
-            } else {
-                return null;
-            }
-        }
-        SortedMap<String, String> commands = getCommandDescriptions(session, path);
-        ByteArrayOutputStream baos = new ByteArrayOutputStream();
-        printMethodList(session, new PrintStream(baos), commands);
-        return baos.toString();
-    }
-
-    private SortedMap<String, String> getCommandDescriptions(CommandSession session,
String command) {
-        Set<String> names = (Set<String>) session.get(COMMANDS);
-
-        String subshell = (String) session.get("SUBSHELL");
-        String completionMode = (String) session.get(SessionProperties.COMPLETION_MODE);
-
-        SortedMap<String,String> commands = new TreeMap<String,String>();
-        for (String name : names) {
-
-            if (command != null && !name.startsWith(command)) {
-                continue;
-            }
-
-            if (completionMode != null && completionMode.equalsIgnoreCase("subshell"))
{
-                // filter the help only for "global" commands
-                if (subshell == null || subshell.trim().isEmpty()) {
-                    if (!name.startsWith("*")) {
-                        continue;
-                    }
-                }
-            }
-
-            if (completionMode != null && (completionMode.equalsIgnoreCase("subshell")
|| completionMode.equalsIgnoreCase("first"))) {
-                // filter the help only for commands local to the subshell
-                if (!name.startsWith(subshell)) {
-                    continue;
-                }
-            }
-
-            String description = null;
-            Function function = (Function) session.get(name);
-            function = unProxy(function);
-            if (function instanceof CommandWithAction) {
-                try {
-                    Class<? extends Action> actionClass = ((CommandWithAction) function).getActionClass();
-                    Command ann = new ActionMetaDataFactory().getCommand(actionClass);
-                    description = ann.description();
-                } catch (Throwable e) {
-                }
-                if (name.startsWith("*:")) {
-                    name = name.substring(2);
-                }
-                if (subshell != null && !subshell.trim().isEmpty() && name.startsWith(subshell))
{
-                    name = name.substring(subshell.length() + 1);
-                }
-                commands.put(name, description);
-            }
-        }
-        return commands;
-    }
-
-    protected void printMethodList(CommandSession session, PrintStream out, SortedMap<String,
String> commands) {
-        Terminal term = (Terminal) session.get(".jline.terminal");
-        int termWidth = term != null ? term.getWidth() : 80;
-        out.println(Ansi.ansi().a(Ansi.Attribute.INTENSITY_BOLD).a("COMMANDS").a(Ansi.Attribute.RESET));
-        ShellTable table = new ShellTable().noHeaders().separator(" ").size(termWidth);
-        table.column(new Col("Command").maxSize(35));
-        table.column(new Col("Description"));
-        for (Map.Entry<String,String> entry : commands.entrySet()) {
-            String key = NameScoping.getCommandNameWithoutGlobalPrefix(session, entry.getKey());
-            table.addRow().addContent(key, entry.getValue());
-        }
-        table.print(out, true);
-    }
-    
-    protected Function unProxy(Function function) {
-        try {
-            if (function.getClass().getName().contains("CommandProxy")) {
-                Field contextField = function.getClass().getDeclaredField("context");
-                Field referenceField = function.getClass().getDeclaredField("reference");
-                contextField.setAccessible(true);
-                referenceField.setAccessible(true);
-                BundleContext context = (BundleContext) contextField.get(function);
-                ServiceReference reference = (ServiceReference) referenceField.get(function);
-                Object target = context.getService(reference);
-                try {
-                    if (target instanceof Function) {
-                        function = (Function) target;
-                    }
-                } finally {
-                    context.ungetService(reference);
-                }
-            }
-        } catch (Throwable t) {
-        }
-        return function;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/karaf/blob/42787103/shell/help/src/main/java/org/apache/karaf/shell/help/impl/HelpAction.java
----------------------------------------------------------------------
diff --git a/shell/help/src/main/java/org/apache/karaf/shell/help/impl/HelpAction.java b/shell/help/src/main/java/org/apache/karaf/shell/help/impl/HelpAction.java
deleted file mode 100644
index 16c17d2..0000000
--- a/shell/help/src/main/java/org/apache/karaf/shell/help/impl/HelpAction.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/**
- *
- * 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.karaf.shell.help.impl;
-
-import org.apache.karaf.shell.commands.Argument;
-import org.apache.karaf.shell.commands.Command;
-import org.apache.karaf.shell.console.AbstractAction;
-
-/**
- * Displays help on the available commands
- */
-@Command(scope = "*", name = "help", description = "Displays this help or help about a command")
-public class HelpAction extends AbstractAction {
-
-    @Argument(name = "command", required = false, description = "The command to get help
for")
-    private String command;
-    
-    private HelpSystem provider;
-
-    public void setProvider(HelpSystem provider) {
-        this.provider = provider;
-    }
-
-    public Object doExecute() throws Exception {
-        String help = provider.getHelp(session, command);
-        if (help != null) {
-            System.out.println(help);
-        }
-        return null;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/karaf/blob/42787103/shell/help/src/main/java/org/apache/karaf/shell/help/impl/HelpSystem.java
----------------------------------------------------------------------
diff --git a/shell/help/src/main/java/org/apache/karaf/shell/help/impl/HelpSystem.java b/shell/help/src/main/java/org/apache/karaf/shell/help/impl/HelpSystem.java
deleted file mode 100644
index d88a747..0000000
--- a/shell/help/src/main/java/org/apache/karaf/shell/help/impl/HelpSystem.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/**
- *
- * 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.karaf.shell.help.impl;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.felix.service.command.CommandSession;
-import org.apache.karaf.shell.console.HelpProvider;
-import org.apache.karaf.util.properties.InterpolationHelper;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.InvalidSyntaxException;
-import org.osgi.framework.ServiceReference;
-
-public class HelpSystem implements HelpProvider {
-
-    private BundleContext context;
-
-    public HelpSystem(BundleContext context) {
-        this.context = context;
-    }
-
-    @SuppressWarnings("unchecked")
-    public synchronized List<HelpProvider> getProviders() {
-        ServiceReference<HelpProvider> [] refs = null;
-        try {
-            refs = context.getServiceReferences(HelpProvider.class, null).toArray(new ServiceReference[]{});
-        } catch (InvalidSyntaxException e) {
-            throw new RuntimeException(e);
-        }
-        Arrays.sort(refs);
-        List<HelpProvider> providers = new ArrayList<HelpProvider>();
-        for (int i = refs.length - 1; i >= 0; i--) {
-            providers.add(context.getService(refs[i]));
-        }
-        return providers;
-    }
-    
-    public String getHelp(final CommandSession session, String path) {
-        if (path == null) {
-            path = "%root%";
-        }
-        Map<String,String> props = new HashMap<String,String>();
-        props.put("data", "${" + path + "}");
-        final List<HelpProvider> providers = getProviders();
-        InterpolationHelper.performSubstitution(props, new InterpolationHelper.SubstitutionCallback()
{
-            public String getValue(final String key) {
-                for (HelpProvider hp : providers) {
-                    String result = hp.getHelp(session, key);
-                    if (result != null) {
-                        return removeNewLine(result);
-                    }
-                }
-                return null;
-            }
-        });
-        return props.get("data");
-    }
-    
-    private String removeNewLine(String help) {
-        if (help != null && help.endsWith("\n")) {
-            help = help.substring(0, help.length()  -1);
-        }
-        return help;
-    }
-    
-}

http://git-wip-us.apache.org/repos/asf/karaf/blob/42787103/shell/help/src/main/java/org/apache/karaf/shell/help/impl/SimpleHelpProvider.java
----------------------------------------------------------------------
diff --git a/shell/help/src/main/java/org/apache/karaf/shell/help/impl/SimpleHelpProvider.java
b/shell/help/src/main/java/org/apache/karaf/shell/help/impl/SimpleHelpProvider.java
deleted file mode 100644
index c37f4e1..0000000
--- a/shell/help/src/main/java/org/apache/karaf/shell/help/impl/SimpleHelpProvider.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/**
- *
- * 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.karaf.shell.help.impl;
-
-import java.util.Map;
-
-import org.apache.felix.service.command.CommandSession;
-import org.apache.karaf.shell.console.HelpProvider;
-
-public class SimpleHelpProvider implements HelpProvider {
-    
-    private Map<String, String> help;
-
-    public Map<String, String> getHelp() {
-        return help;
-    }
-
-    public void setHelp(Map<String, String> help) {
-        this.help = help;
-    }
-
-    public String getHelp(CommandSession session, String path) {
-        if (path.indexOf('|') > 0) {
-            if (path.startsWith("simple|")) {
-                path = path.substring("simple|".length());
-            } else {
-                return null;
-            }
-        }
-        String str = help.get(path);
-        return str;
-    }
-}

http://git-wip-us.apache.org/repos/asf/karaf/blob/42787103/shell/help/src/main/java/org/apache/karaf/shell/help/impl/SingleCommandHelpProvider.java
----------------------------------------------------------------------
diff --git a/shell/help/src/main/java/org/apache/karaf/shell/help/impl/SingleCommandHelpProvider.java
b/shell/help/src/main/java/org/apache/karaf/shell/help/impl/SingleCommandHelpProvider.java
deleted file mode 100644
index ad3afc4..0000000
--- a/shell/help/src/main/java/org/apache/karaf/shell/help/impl/SingleCommandHelpProvider.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/**
- *
- * 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.karaf.shell.help.impl;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.PrintStream;
-import java.util.Set;
-
-import org.apache.felix.service.command.CommandSession;
-import org.apache.felix.service.threadio.ThreadIO;
-import org.apache.karaf.shell.console.HelpProvider;
-
-public class SingleCommandHelpProvider implements HelpProvider {
-
-    public static final String COMMANDS = ".commands";
-
-    private ThreadIO io;
-    
-    public SingleCommandHelpProvider(ThreadIO io) {
-        this.io = io;
-    }
-
-    public String getHelp(CommandSession session, String path) {
-
-        String subshell = (String) session.get("SUBSHELL");
-
-        if (subshell != null && !subshell.trim().isEmpty()) {
-            if (!path.startsWith(subshell)) {
-                path = subshell + ":" + path;
-            }
-        }
-
-        if (path.indexOf('|') > 0) {
-            if (path.startsWith("command|")) {
-                path = path.substring("command|".length());
-            } else {
-                return null;
-            }
-        }
-        Set<String> names = (Set<String>) session.get(COMMANDS);
-        if (path != null && names.contains(path)) {
-            ByteArrayOutputStream baos = new ByteArrayOutputStream();
-            io.setStreams(new ByteArrayInputStream(new byte[0]), new PrintStream(baos, true),
new PrintStream(baos, true));
-            try {
-                session.execute(path + " --help");
-            } catch (Throwable t) {
-                t.printStackTrace();
-            } finally {
-                io.close();
-            }
-            return baos.toString();
-        }
-        return null;
-    }
-}

http://git-wip-us.apache.org/repos/asf/karaf/blob/42787103/shell/help/src/main/resources/OSGI-INF/blueprint/shell-commands.xml
----------------------------------------------------------------------
diff --git a/shell/help/src/main/resources/OSGI-INF/blueprint/shell-commands.xml b/shell/help/src/main/resources/OSGI-INF/blueprint/shell-commands.xml
deleted file mode 100644
index 4a67c37..0000000
--- a/shell/help/src/main/resources/OSGI-INF/blueprint/shell-commands.xml
+++ /dev/null
@@ -1,78 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
-    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.
-
--->
-<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0" default-activation="lazy">
-
-   	<bean id="commandCompleter" class="org.apache.karaf.shell.console.completer.CommandsCompleter"/>
-
-    <service>
-        <interfaces>
-            <value>org.apache.felix.service.command.Function</value>
-            <value>org.apache.karaf.shell.console.CompletableFunction</value>
-        </interfaces>
-        <service-properties>
-            <entry key="osgi.command.scope" value="*"/>
-            <entry key="osgi.command.function" value="help"/>
-        </service-properties>
-        <bean class="org.apache.karaf.shell.console.commands.BlueprintCommand">
-            <property name="blueprintContainer" ref="blueprintContainer"/>
-            <property name="blueprintConverter" ref="blueprintConverter"/>
-            <property name="actionId" value="help"/>
-            <property name="completers">
-                <list>
-                    <bean class="org.apache.karaf.shell.console.completer.CommandNamesCompleter"/>
-                </list>
-            </property>
-        </bean>
-    </service>
-
-    <bean id="help" class="org.apache.karaf.shell.help.impl.HelpAction" activation="lazy"
scope="prototype">
-        <property name="provider" ref="helpSystem"/>
-    </bean>
-    
-    <bean id="helpSystem" class="org.apache.karaf.shell.help.impl.HelpSystem">
-        <argument ref="blueprintBundleContext"/>
-    </bean>
-
-    <!--use to get the help on the list of commands -->
-    <service interface="org.apache.karaf.shell.console.HelpProvider" ranking="-20">
-        <bean class="org.apache.karaf.shell.help.impl.CommandListHelpProvider" />
-    </service>
-
-    <!-- use for "help command" syntax -->
-    <reference id="threadIO" interface="org.apache.felix.service.threadio.ThreadIO"/>
-    <service auto-export="interfaces" ranking="-10">
-        <bean class="org.apache.karaf.shell.help.impl.SingleCommandHelpProvider">
-            <argument ref="threadIO" />
-        </bean>
-    </service>
-
-    <!-- use for "help" to get help on each command in the commands list -->
-    <service auto-export="interfaces" ranking="-5">
-        <bean class="org.apache.karaf.shell.help.impl.SimpleHelpProvider">
-            <property name="help">
-                <map>
-                    <entry key="%root%"><value><![CDATA[${command-list|}]]></value></entry>
-                    <entry key="all"><value><![CDATA[${command-list|}]]></value></entry>
-                </map>
-            </property>
-        </bean>
-    </service>
- 
-</blueprint>

http://git-wip-us.apache.org/repos/asf/karaf/blob/42787103/shell/help/src/main/resources/OSGI-INF/bundle.info
----------------------------------------------------------------------
diff --git a/shell/help/src/main/resources/OSGI-INF/bundle.info b/shell/help/src/main/resources/OSGI-INF/bundle.info
deleted file mode 100644
index 09520d1..0000000
--- a/shell/help/src/main/resources/OSGI-INF/bundle.info
+++ /dev/null
@@ -1,18 +0,0 @@
-h1. Synopsis
-
-${project.name}
-
-${project.description}
-
-Maven URL:
-[mvn:${project.groupId}/${project.artifactId}/${project.version}]
-
-h1. Description
-
-This bundle provides the Karaf help system and command
-
-shell:help
-
-h1. See also
-
-Commands - and Using the console - sections of the Karaf User Guide.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/karaf/blob/42787103/shell/help/src/main/resources/services/org/apache/karaf/shell/commands
----------------------------------------------------------------------
diff --git a/shell/help/src/main/resources/services/org/apache/karaf/shell/commands b/shell/help/src/main/resources/services/org/apache/karaf/shell/commands
deleted file mode 100644
index ee78f61..0000000
--- a/shell/help/src/main/resources/services/org/apache/karaf/shell/commands
+++ /dev/null
@@ -1,17 +0,0 @@
-##---------------------------------------------------------------------------
-##  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.
-##---------------------------------------------------------------------------
-org.apache.karaf.shell.console.impl.help.HelpAction

http://git-wip-us.apache.org/repos/asf/karaf/blob/42787103/shell/pom.xml
----------------------------------------------------------------------
diff --git a/shell/pom.xml b/shell/pom.xml
index 482021b..8d31157 100644
--- a/shell/pom.xml
+++ b/shell/pom.xml
@@ -38,7 +38,6 @@
         <module>core</module>
         <module>console</module>
         <module>ssh</module>
-        <module>help</module>
         <module>table</module>
     </modules>
 


Mime
View raw message