Commit 7b10dc70 authored by Mathias Goebel's avatar Mathias Goebel 🎠
Browse files

some changes made! yeah!

parent c624cf5d
target/
*/target/
......@@ -5,16 +5,16 @@
* Copyright (C) 2011 TextGrid Consortium (http://www.textgrid.de)
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation, either version 3 of the
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Lesser Public License for more details.
*
* You should have received a copy of the GNU General Lesser Public
*
* You should have received a copy of the GNU General Lesser Public
* License along with this program. If not, see
* <http://www.gnu.org/licenses/lgpl-3.0.html>.
* #L%
......@@ -33,21 +33,21 @@ public class PluginPreferencePage extends FieldEditorPreferencePage implements I
public static String sadeUrl_id = "sade_instance_url";
public static String sadeUser_id = "sade_instance_user";
public static String sadePW_id = "sade_instance_pw";
@Override
protected void createFieldEditors() {
addField(new StringFieldEditor(sadeUrl_id, "URL for SADE instance", getFieldEditorParent()));
addField(new StringFieldEditor(sadeUser_id, "Authorized user", getFieldEditorParent()));
addField(new StringFieldEditor(sadePW_id, "Password", getFieldEditorParent()));
addField(new StringFieldEditor(sadeUrl_id, "URL to SADE publish.html", getFieldEditorParent()));
addField(new StringFieldEditor(sadeUser_id, "SADE user", getFieldEditorParent()));
addField(new StringFieldEditor(sadePW_id, "Password", getFieldEditorParent()));
}
@Override
public void init(IWorkbench workbench) {
setPreferenceStore(Activator.getDefault().getPreferenceStore());
}
}
......@@ -5,16 +5,16 @@
* Copyright (C) 2011 TextGrid Consortium (http://www.textgrid.de)
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation, either version 3 of the
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Lesser Public License for more details.
*
* You should have received a copy of the GNU General Lesser Public
*
* You should have received a copy of the GNU General Lesser Public
* License along with this program. If not, see
* <http://www.gnu.org/licenses/lgpl-3.0.html>.
* #L%
......@@ -32,7 +32,7 @@ public class PluginPreferencePageInitializer extends AbstractPreferenceInitializ
public void initializeDefaultPreferences() {
IPreferenceStore store = Activator.getDefault().getPreferenceStore();
store.setDefault(PluginPreferencePage.sadeUrl_id, "http://localhost:8080/tgwp/dnd.html");
store.setDefault(PluginPreferencePage.sadeUrl_id, "http://localhost:8080/exist/apps/sade/publish.html");
}
......
......@@ -16,16 +16,16 @@ public class IsPublishableObject extends PropertyTester {
if (receiver != null && receiver instanceof TGObjectReference) {
return isOK(AdapterUtils.getAdapter(receiver, TextGridObject.class));
}
return true;
}
private boolean isOK(TextGridObject tgo) {
String contentTypeId = "";
// reloadMetadata(tgo);
try {
contentTypeId = tgo.getContentTypeID();
if (contentTypeId.contains("tg.aggregation")
if ( contentTypeId.contains("tg.aggregation")
|| contentTypeId.contains("xml")
|| contentTypeId.contains("image/")
|| contentTypeId.contains("text/linkeditorlinkedfile")
......
......@@ -5,16 +5,16 @@
* Copyright (C) 2011 TextGrid Consortium (http://www.textgrid.de)
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation, either version 3 of the
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Lesser Public License for more details.
*
* You should have received a copy of the GNU General Lesser Public
*
* You should have received a copy of the GNU General Lesser Public
* License along with this program. If not, see
* <http://www.gnu.org/licenses/lgpl-3.0.html>.
* #L%
......@@ -39,10 +39,10 @@ import org.eclipse.ui.part.ViewPart;
public class SadePublishView extends ViewPart {
private Browser spBrowser;
private boolean browserReady = false;
private boolean browserReady = false;
public void createPartControl(Composite parent) {
try {
//spBrowser = new Browser(parent, SWT.MOZILLA);
spBrowser = new Browser(parent, SWT.NONE);
......@@ -52,15 +52,15 @@ public class SadePublishView extends ViewPart {
}
String url = Platform.getPreferencesService().getString(Activator.PLUGIN_ID, PluginPreferencePage.sadeUrl_id, "", null);
if(url.equals("")) {
spBrowser.setText("No publish destination, please set one with Window->Preferences->Sade Publisher");
return;
}
spBrowser.setUrl(url);
spBrowser.addProgressListener(new ProgressListener() {
public void changed(ProgressEvent arg0) {}
public void changed(ProgressEvent arg0) {}
public void completed(ProgressEvent arg0) {
String sid = RBACSession.getInstance().getSID(false);
......@@ -72,19 +72,21 @@ public class SadePublishView extends ViewPart {
spBrowser.execute("setAuth('"+user+"','"+pw+"')");
browserReady = true;
}
}
});
}
public void addTextGridObject(String uri, String title, String contentType) {
System.out.println("before browserready: u: " + uri + " - t: " + title + " - ct: " + contentType);
// Drag from Navigator generates a title like "TITLE (URI)".
// While i think the Navigator is wrong, this is the place where i can
// ensure that both methods are conform.
if(browserReady) {
System.out.println("u: " + uri + " - t: " + title + " - ct: " + contentType);
spBrowser.execute("addTGObject('"+uri+"', '"+title+"', '"+contentType+"')");
spBrowser.execute("addTGObject('"+uri+"', '"+title + " ("+uri+")"+"', '"+contentType+"')");
}
}
......
......@@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>info.textgrid.lab</groupId>
<artifactId>sadepublish</artifactId>
<version>0.0.2-SNAPSHOT</version>
<version>0.0.3-SNAPSHOT</version>
<packaging>pom</packaging>
<parent>
......@@ -25,6 +25,11 @@
<name>Ubbo Veentjer</name>
<email>veentjer@sub.uni-goettingen.de</email>
</developer>
<developer>
<id>mgoebel</id>
<name>Mathias Göbel</name>
<email>goebel@sub.uni-goettingen.de</email>
</developer>
</developers>
<repositories>
......@@ -141,5 +146,5 @@
</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