CQ-4081: Initial import
diff --git a/bundles/org.eclipse.e4.core.deeplink.typehandler.extensionpt/.classpath b/bundles/org.eclipse.e4.core.deeplink.typehandler.extensionpt/.classpath
new file mode 100644
index 0000000..8a8f166
--- /dev/null
+++ b/bundles/org.eclipse.e4.core.deeplink.typehandler.extensionpt/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/bundles/org.eclipse.e4.core.deeplink.typehandler.extensionpt/.project b/bundles/org.eclipse.e4.core.deeplink.typehandler.extensionpt/.project
new file mode 100644
index 0000000..d99630f
--- /dev/null
+++ b/bundles/org.eclipse.e4.core.deeplink.typehandler.extensionpt/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.e4.core.deeplink.typehandler.extensionpt</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/bundles/org.eclipse.e4.core.deeplink.typehandler.extensionpt/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.e4.core.deeplink.typehandler.extensionpt/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..05aa9bb
--- /dev/null
+++ b/bundles/org.eclipse.e4.core.deeplink.typehandler.extensionpt/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,7 @@
+#Thu Feb 18 16:29:13 GMT 2010
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
diff --git a/bundles/org.eclipse.e4.core.deeplink.typehandler.extensionpt/META-INF/MANIFEST.MF b/bundles/org.eclipse.e4.core.deeplink.typehandler.extensionpt/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..f407912
--- /dev/null
+++ b/bundles/org.eclipse.e4.core.deeplink.typehandler.extensionpt/META-INF/MANIFEST.MF
@@ -0,0 +1,13 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Perspective Plug-in
+Bundle-SymbolicName: org.eclipse.e4.core.deeplink.typehandler.extensionpt;singleton:=true
+Bundle-Version: 4.6.0.qualifier
+Bundle-Activator: org.eclipse.e4.core.deeplink.typehandler.extensionpt.Activator
+Require-Bundle: org.eclipse.core.runtime,
+ org.eclipse.ui,
+ org.eclipse.core.resources,
+ org.eclipse.e4.core.functionalprog,
+ org.eclipse.e4.core.deeplink.handler
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Bundle-ActivationPolicy: lazy
diff --git a/bundles/org.eclipse.e4.core.deeplink.typehandler.extensionpt/about.html b/bundles/org.eclipse.e4.core.deeplink.typehandler.extensionpt/about.html
new file mode 100644
index 0000000..f77f378
--- /dev/null
+++ b/bundles/org.eclipse.e4.core.deeplink.typehandler.extensionpt/about.html
@@ -0,0 +1,22 @@
+<h1>About This Content</h1>
+
+23 June, 2010
+
+<h2>License</h2>
+
+<p>The Eclipse Foundation makes available all content in this plug-in
+("Content"). Unless otherwise indicated below, the Content is provided
+to you under the terms and conditions of the Eclipse Public License
+Version 1.0 ("EPL"). A copy of the EPL is available at
+http://www.eclipse.org/legal/epl-v10.html. For purposes of the EPL,
+"Program" will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse
+Foundation, the Content is being redistributed by another party
+("Redistributor") and different terms and conditions may apply to your
+use of any object code in the Content. Check the Redistributor’s
+license that was provided with the Content. If no such license exists,
+contact the Redistributor. Unless otherwise indicated below, the terms
+and conditions of the EPL still apply to any source code in the
+Content and such source code may be obtained at
+http://www.eclipse.org.</p>
diff --git a/bundles/org.eclipse.e4.core.deeplink.typehandler.extensionpt/build.properties b/bundles/org.eclipse.e4.core.deeplink.typehandler.extensionpt/build.properties
new file mode 100644
index 0000000..6f20375
--- /dev/null
+++ b/bundles/org.eclipse.e4.core.deeplink.typehandler.extensionpt/build.properties
@@ -0,0 +1,5 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml
diff --git a/bundles/org.eclipse.e4.core.deeplink.typehandler.extensionpt/plugin.xml b/bundles/org.eclipse.e4.core.deeplink.typehandler.extensionpt/plugin.xml
new file mode 100644
index 0000000..b658ccd
--- /dev/null
+++ b/bundles/org.eclipse.e4.core.deeplink.typehandler.extensionpt/plugin.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+ <extension-point id="deepLinkExtensionPointInstanceHandler" name="Entry Point for a Deep Linked Application" schema="schema/deepLinkExtensionPointInstanceHandler.exsd"/>
+ <extension
+ point="org.eclipse.e4.core.deeplink.handler.deepLinkTypeHandler">
+ <typeHandler
+ class="org.eclipse.e4.core.deeplink.typehandler.extensionpt.DeepLinkExtensionPointTypeHandler"
+ name="extensionpt">
+ </typeHandler>
+ </extension>
+</plugin>
diff --git a/bundles/org.eclipse.e4.core.deeplink.typehandler.extensionpt/schema/deepLinkExtensionPointInstanceHandler.exsd b/bundles/org.eclipse.e4.core.deeplink.typehandler.extensionpt/schema/deepLinkExtensionPointInstanceHandler.exsd
new file mode 100644
index 0000000..5cb5b79
--- /dev/null
+++ b/bundles/org.eclipse.e4.core.deeplink.typehandler.extensionpt/schema/deepLinkExtensionPointInstanceHandler.exsd
@@ -0,0 +1,88 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.e4.enterprise.deeplink.typehandler.extensionpt" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appinfo>
+ <meta.schema plugin="org.eclipse.e4.enterprise.deeplink.typehandler.extensionpt" id="deepLinkHandler" name="URL handler for a Deep Linked Application"/>
+ </appinfo>
+ <documentation>
+ Allow an application to register one or more deep link handlers. These will be called when referenced in a DeepLink URL, and the handler passed any parameters supplied on the URL query.
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appinfo>
+ <meta.element />
+ </appinfo>
+ </annotation>
+ <complexType>
+ <sequence>
+ <element ref="deepLinkExtensionPointInstanceHandler"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute translatable="true"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="deepLinkExtensionPointInstanceHandler">
+ <complexType>
+ <attribute name="id" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="class" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="java" basedOn="org.eclipse.e4.core.deeplink.api.AbstractDeepLinkInstanceHandler:"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="since"/>
+ </appinfo>
+ <documentation>
+ 1.0.0
+ </documentation>
+ </annotation>
+
+</schema>
diff --git a/bundles/org.eclipse.e4.core.deeplink.typehandler.extensionpt/src/org/eclipse/e4/core/deeplink/typehandler/extensionpt/Activator.java b/bundles/org.eclipse.e4.core.deeplink.typehandler.extensionpt/src/org/eclipse/e4/core/deeplink/typehandler/extensionpt/Activator.java
new file mode 100644
index 0000000..1e55ac2
--- /dev/null
+++ b/bundles/org.eclipse.e4.core.deeplink.typehandler.extensionpt/src/org/eclipse/e4/core/deeplink/typehandler/extensionpt/Activator.java
@@ -0,0 +1,61 @@
+/******************************************************************************
+ * Copyright (c) David Orme and others
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * David Orme - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.e4.core.deeplink.typehandler.extensionpt;
+
+import org.eclipse.core.runtime.Plugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends Plugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.eclipse.e4.enterprise.deeplink.typehandler.extensionpt";
+ public static final String DEEP_LINK_EXT_PT_ID = "deepLinkExtensionPointInstanceHandler";
+
+ // The shared instance
+ private static Activator plugin;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+}
diff --git a/bundles/org.eclipse.e4.core.deeplink.typehandler.extensionpt/src/org/eclipse/e4/core/deeplink/typehandler/extensionpt/DeepLinkExtensionPointTypeHandler.java b/bundles/org.eclipse.e4.core.deeplink.typehandler.extensionpt/src/org/eclipse/e4/core/deeplink/typehandler/extensionpt/DeepLinkExtensionPointTypeHandler.java
new file mode 100644
index 0000000..3b5690d
--- /dev/null
+++ b/bundles/org.eclipse.e4.core.deeplink.typehandler.extensionpt/src/org/eclipse/e4/core/deeplink/typehandler/extensionpt/DeepLinkExtensionPointTypeHandler.java
@@ -0,0 +1,44 @@
+/******************************************************************************
+ * Copyright (c) David Orme and others
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * David Orme - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.e4.core.deeplink.typehandler.extensionpt;
+
+import java.io.IOException;
+
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.e4.core.deeplink.api.AbstractDeepLinkTypeHandler;
+import org.eclipse.e4.core.deeplink.api.ParameterProcessResults;
+import org.eclipse.swt.widgets.Display;
+
+
+/**
+ * Implements a type handler for deeplinks of the following form:
+ * <p>
+ * deeplink://application/extensionpt/id/action?param1=value1¶m2=value2
+ * <p>
+ * where "id" is an ID attribute defined in the extension point. See the
+ * plugin.xml and the extension point schema for details.
+ */
+public class DeepLinkExtensionPointTypeHandler extends AbstractDeepLinkTypeHandler {
+ private static final String EXTENSION_POINT_INSTANCE_ID_ATTRIBUTE = "id";
+
+ @Override
+ public void processDeepLink() throws IOException{
+ final ParameterProcessResults[] results = new ParameterProcessResults[] { new ParameterProcessResults() };
+ Display.getDefault().syncExec(new Runnable() {
+ public void run() {
+ IConfigurationElement[] congfigElementsFromRegistry = getCongfigElementsFromRegistry(Activator.PLUGIN_ID, Activator.DEEP_LINK_EXT_PT_ID);
+ findInstanceHandlerAndExecuteCallback(results, congfigElementsFromRegistry, getParameterMap(), EXTENSION_POINT_INSTANCE_ID_ATTRIBUTE);
+ }
+ });
+
+ outputResponse(results[0]);
+ }
+}
\ No newline at end of file