Commit 312779d7 authored by Ubbo Veentjer's avatar Ubbo Veentjer
Browse files

initial import of sade publishing lab feature

git-svn-id: https://textgridlab.org/svn/textgrid/trunk/lab/sadepublish@11482 7c539038-3410-0410-b1ec-0f2a7bf1c452
parents
<?xml version="1.0" encoding="UTF-8"?>
<feature
id="info.textgrid.lab.feature.sadepublish"
label="sade publish feature"
version="0.0.1.qualifier">
<description url="http://www.example.com/description">
Feature for TextGrid Sade Publish.
</description>
<copyright url="http://www.example.com/copyright">
[Enter Copyright Description here.]
</copyright>
<license url="http://www.example.com/license">
[Enter License Description here.]
</license>
<plugin
id="info.textgrid.lab.sadepublish"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<depends
id="info.textgrid.lab.feature.auth"
version="0.0.0"/>
</feature>
<?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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>info.textgrid.lab</groupId>
<artifactId>sadepublish</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>info.textgrid.lab.feature.sadepublish</artifactId>
<name>TextGridLab Sade Publish Feature</name>
<version>0.0.1-SNAPSHOT</version>
<packaging>eclipse-feature</packaging>
</project>
<?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>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>info.textgrid.lab.sadepublish</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>
#Sun Sep 18 15:02:25 CEST 2011
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
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
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Sadepublish
Bundle-SymbolicName: info.textgrid.lab.sadepublish; singleton:=true
Bundle-Version: 1.0.0.qualifier
Bundle-Activator: info.textgrid.lab.sadepublish.Activator
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
info.textgrid.lab.authn;bundle-version="0.0.2"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
source.. = src/
output.. = bin/
bin.includes = plugin.xml,\
META-INF/,\
.,\
icons/,\
contexts.xml
<contexts>
<context id="viewer" title="Sample View">
<description>This is the context help for the sample view with a table viewer. It was generated by a PDE template.</description>
<topic href="/PLUGINS_ROOT/org.eclipse.platform.doc.isv/guide/ua_help_context.htm" label="Context-sensitive help">
<enablement>
<with variable="platform">
<test property="org.eclipse.core.runtime.isBundleInstalled" args="org.eclipse.platform.doc.isv"/>
</with>
</enablement>
</topic>
</context>
</contexts>
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
<extension
point="org.eclipse.ui.views">
<category
name="Sade Publish"
id="info.textgrid.lab.sadepublish">
</category>
<view
name="Sade Publish View"
icon="icons/sample.gif"
category="info.textgrid.lab.sadepublish"
class="info.textgrid.lab.sadepublish.views.SadePublishView"
id="info.textgrid.lab.sadepublish.views.SadePublishView">
</view>
</extension>
<extension
point="org.eclipse.ui.perspectives">
<perspective
class="info.textgrid.lab.sadepublish.perspectives.SadePublishPerspective"
id="info.textgrid.lab.sadepublish.perspectives.SadePublishPerspective"
name="Sade Publish Perspective">
</perspective>
</extension>
<extension
point="org.eclipse.ui.commands">
<command
description="Open Sade Publish Perspective"
id="info.textgrid.lab.sadepublish.showSadePublish"
name="Sade Publish">
</command>
</extension>
<extension
point="org.eclipse.ui.handlers">
<handler
class="info.textgrid.lab.sadepublish.handlers.ShowSadePublishPerspectiveHandler"
commandId="info.textgrid.lab.sadepublish.showSadePublish">
</handler>
</extension>
<extension
point="org.eclipse.ui.menus">
<menuContribution
locationURI="menu:tools?after=tools.anchor1.3">
<command
commandId="info.textgrid.lab.sadepublish.showSadePublish"
icon="icons/sample.gif">
</command>
</menuContribution>
<menuContribution
locationURI="toolbar:perspectivesbar">
<command
commandId="info.textgrid.lab.sadepublish.showSadePublish"
icon="icons/sample.gif"
label="Sade Publish"
tooltip="Publish TextGrid Objects to Sade">
</command>
</menuContribution>
</extension>
<!--extension
point="org.eclipse.ui.perspectiveExtensions">
<perspectiveExtension
targetID="org.eclipse.jdt.ui.JavaPerspective">
<view
ratio="0.5"
relative="org.eclipse.ui.views.TaskList"
relationship="right"
id="info.textgrid.lab.sadepublish.views.SadePublishView">
</view>
</perspectiveExtension>
</extension-->
<extension
point="org.eclipse.help.contexts">
<contexts
file="contexts.xml">
</contexts>
</extension>
</plugin>
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>sadepublish</artifactId>
<groupId>info.textgrid.lab</groupId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<groupId>info.textgrid.lab</groupId>
<artifactId>info.textgrid.lab.sadepublish</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
package info.textgrid.lab.sadepublish;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.osgi.util.NLS;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.eclipse.ui.statushandlers.StatusManager;
import org.osgi.framework.BundleContext;
/**
* The activator class controls the plug-in life cycle
*/
public class Activator extends AbstractUIPlugin {
// The plug-in ID
public static final String PLUGIN_ID = "info.textgrid.lab.sadepublish"; //$NON-NLS-1$
// The shared instance
private static Activator plugin;
/**
* The constructor
*/
public Activator() {
}
/*
* (non-Javadoc)
* @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
*/
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
}
/*
* (non-Javadoc)
* @see org.eclipse.ui.plugin.AbstractUIPlugin#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;
}
/**
* Returns an image descriptor for the image file at the given
* plug-in relative path
*
* @param path the path
* @return the image descriptor
*/
public static ImageDescriptor getImageDescriptor(String path) {
return imageDescriptorFromPlugin(PLUGIN_ID, path);
}
public static void handleError(Throwable e, String message, Object... args) {
StatusManager.getManager().handle(
new Status(IStatus.ERROR, PLUGIN_ID, NLS.bind(message, args)));
}
}
package info.textgrid.lab.sadepublish.handlers;
import info.textgrid.lab.sadepublish.Activator;
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.commands.IHandler;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.WorkbenchException;
public class ShowSadePublishPerspectiveHandler extends AbstractHandler implements IHandler{
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
try {
// first reset the perspective...
IWorkbench wb = PlatformUI.getWorkbench();
wb.getActiveWorkbenchWindow().getActivePage().setPerspective(
wb.getPerspectiveRegistry().findPerspectiveWithId(
"info.textgrid.lab.sadepublish.perspectives.SadePublishPerspective"));
wb.getActiveWorkbenchWindow().getActivePage().resetPerspective();
// show it when necessary
PlatformUI.getWorkbench().showPerspective(
"info.textgrid.lab.sadepublish.perspectives.SadePublishPerspective",
PlatformUI.getWorkbench().getActiveWorkbenchWindow());
wb.getIntroManager().closeIntro(wb.getIntroManager().getIntro());
} catch (WorkbenchException e) {
IStatus status = new Status(IStatus.ERROR, Activator.PLUGIN_ID,
"Could not open Sade Publisher Perspective!", e);
Activator.getDefault().getLog().log(status);
}
return null;
}
}
package info.textgrid.lab.sadepublish.perspectives;
import org.eclipse.ui.IFolderLayout;
import org.eclipse.ui.IPageLayout;
import org.eclipse.ui.IPerspectiveFactory;
public class SadePublishPerspective implements IPerspectiveFactory{
@Override
public void createInitialLayout(IPageLayout layout) {
// TODO Auto-generated method stub
String editorArea = layout.getEditorArea();
IFolderLayout topLeft =
layout.createFolder("topLeft", IPageLayout.LEFT, (float)0.3, editorArea);//$NON-NLS-1$
topLeft.addView("info.textgrid.lab.navigator.view");
IFolderLayout topRight=
layout.createFolder("topRight", IPageLayout.RIGHT, (float)0.4, editorArea);//$NON-NLS-1$
topRight.addView("info.textgrid.lab.sadepublish.views.SadePublishView");
layout.setEditorAreaVisible(false);
}
}
package info.textgrid.lab.sadepublish.views;
import info.textgrid.lab.authn.RBACSession;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.part.*;
import org.eclipse.jface.util.LocalSelectionTransfer;
import org.eclipse.jface.viewers.*;
import org.eclipse.swt.browser.Browser;
import org.eclipse.swt.browser.ProgressEvent;
import org.eclipse.swt.browser.ProgressListener;
import org.eclipse.swt.dnd.DND;
import org.eclipse.swt.dnd.DropTarget;
import org.eclipse.swt.dnd.DropTargetAdapter;
import org.eclipse.swt.dnd.DropTargetEvent;
import org.eclipse.swt.dnd.TextTransfer;
import org.eclipse.swt.dnd.Transfer;
import org.eclipse.swt.events.DragDetectEvent;
import org.eclipse.swt.events.DragDetectListener;
import org.eclipse.swt.graphics.Image;
import org.eclipse.jface.action.*;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.ui.*;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.SWT;
import org.eclipse.swt.SWTError;
/**
* This sample class demonstrates how to plug-in a new
* workbench view. The view shows data obtained from the
* model. The sample creates a dummy model on the fly,
* but a real implementation would connect to the model
* available either in this or another plug-in (e.g. the workspace).
* The view is connected to the model using a content provider.
* <p>
* The view uses a label provider to define how model
* objects should be presented in the view. Each
* view can present the same model objects using
* different labels and icons, if needed. Alternatively,
* a single label provider can be shared between views
* in order to ensure that objects of the same type are
* presented in the same way everywhere.
* <p>
*/
public class SadePublishView extends ViewPart {
private Browser spBrowser;
public void createPartControl(Composite parent) {
try {
//spBrowser = new Browser(parent, SWT.MOZILLA);
spBrowser = new Browser(parent, SWT.NONE);
} catch (SWTError e) {
System.out.println("Could not instantiate Browserview " + e.getMessage());
return;
}
spBrowser.setUrl("http://localhost:8080/tgwp/dnd.html");
spBrowser.addProgressListener(new ProgressListener() {
public void changed(ProgressEvent arg0) {}
public void completed(ProgressEvent arg0) {
String sid = RBACSession.getInstance().getSID(false);
System.out.println("set sid to: " + sid);
spBrowser.execute("setSid('"+sid+"')");
}
});
}
/**
* Passing the focus request to the viewer's control.
*/
public void setFocus() {
//viewer.getControl().setFocus();
}
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>info.textgrid.lab</groupId>
<artifactId>sadepublish</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<modules>
<module>info.textgrid.lab.sadepublish</module>
<module>info.textgrid.lab.feature.sadepublish</module>
<module>repository</module>
</modules>
<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-maven-plugin</artifactId>
<version>0.13.0</version>
<extensions>true</extensions>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<version>0.13.0</version>
<configuration>
<resolver>p2</resolver>
<ignoreTychoRepositories>true</ignoreTychoRepositories>
<environments>
<environment>
<os>win32</os>
<ws>win32</ws>
<arch>x86</arch>
</environment>
<environment>
<os>linux</os>
<ws>gtk</ws>
<arch>x86</arch>
</environment>
<environment>
<os>linux</os>
<ws>gtk</ws>
<arch>x86_64</arch>
</environment>
</environments>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>indigo</id>
<layout>p2</layout>
<url>http://download.eclipse.org/releases/indigo</url>
</repository>
<repository>
<id>textgridrep-p2</id>
<layout>p2</layout>
<url>http://textgridlab.org/p2repo</url>
</repository>
<repository>
<id>lab</id>
<layout>p2</layout>
<url>http://dev.digital-humanities.de/ci/view/TextGridLab/job/TextGridLab-Indigo-P2/ws/build/buildDirectory/buildRepo</url>
</repository>
</repositories>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<site>
<category-def name="sade.category" label="Sade"/>
<feature
url="features/info.textgrid.lab.feature.sadepublish_0.0.0.jar"
id="info.textgrid.lab.feature.sadepublish"
version="0.0.0">
<category name="sade.category"/>
</feature>
<!--feature
url="features/info.textgrid.lab.feature.auth_0.0.0.jar"
id="info.textgrid.lab.feature.auth"
version="0.0.0" /-->
</site>
<?xml version="1.0" encoding="UTF-8"?>
<project>
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>info.textgrid.lab</groupId>
<artifactId>sadepublish</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>p2repository</artifactId>
<packaging>eclipse-repository</packaging>
<build>
<plugins>
<!-- this one does the magic of resolving and publishing dependencies found in p2 artifacts
e.g. javax.xml and org.eclipse.osgi if getting javax.xml.stream from helios-p2 repo -->
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-p2-repository-plugin</artifactId>
<version>0.13.0</version>
<configuration>
<includeAllDependencies>true</includeAllDependencies>
<mirrorArtifacts>true</mirrorArtifacts>
</configuration>
</plugin>
</plugins>
</build>
</project>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment