From c9ca42a3aa4ac890695ec10e7746b9895fc2cf64 Mon Sep 17 00:00:00 2001 From: dougsleite Date: Sat, 30 Aug 2008 22:44:34 +0000 Subject: binding-gdata sample - under construction git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@690599 13f79535-47bb-0310-9956-ffa450edef68 --- sandbox/dougsleite/binding-gdata/.classpath | 7 ++ sandbox/dougsleite/binding-gdata/.project | 23 ++++ sandbox/dougsleite/binding-gdata/build.xml | 79 +++++++++++++ sandbox/dougsleite/binding-gdata/pom.xml | 131 +++++++++++++++++++++ .../binding-gdata/src/main/java/launch/Launch.java | 34 ++++++ .../src/main/java/services/Controler.java | 33 ++++++ .../src/main/java/services/ControlerImpl.java | 91 ++++++++++++++ .../src/main/resources/calendar.composite | 50 ++++++++ .../src/main/resources/uiservices/calendar.html | 72 +++++++++++ .../target/classes/calendar.composite | 50 ++++++++ .../target/classes/launch/Launch.class | Bin 0 -> 1057 bytes .../target/classes/services/Controler.class | Bin 0 -> 423 bytes .../target/classes/services/ControlerImpl.class | Bin 0 -> 2552 bytes .../target/classes/uiservices/calendar.html | 72 +++++++++++ .../binding-gdata/target/sample-store.jar | Bin 0 -> 7182 bytes 15 files changed, 642 insertions(+) create mode 100644 sandbox/dougsleite/binding-gdata/.classpath create mode 100644 sandbox/dougsleite/binding-gdata/.project create mode 100644 sandbox/dougsleite/binding-gdata/build.xml create mode 100644 sandbox/dougsleite/binding-gdata/pom.xml create mode 100644 sandbox/dougsleite/binding-gdata/src/main/java/launch/Launch.java create mode 100644 sandbox/dougsleite/binding-gdata/src/main/java/services/Controler.java create mode 100644 sandbox/dougsleite/binding-gdata/src/main/java/services/ControlerImpl.java create mode 100644 sandbox/dougsleite/binding-gdata/src/main/resources/calendar.composite create mode 100644 sandbox/dougsleite/binding-gdata/src/main/resources/uiservices/calendar.html create mode 100644 sandbox/dougsleite/binding-gdata/target/classes/calendar.composite create mode 100644 sandbox/dougsleite/binding-gdata/target/classes/launch/Launch.class create mode 100644 sandbox/dougsleite/binding-gdata/target/classes/services/Controler.class create mode 100644 sandbox/dougsleite/binding-gdata/target/classes/services/ControlerImpl.class create mode 100644 sandbox/dougsleite/binding-gdata/target/classes/uiservices/calendar.html create mode 100644 sandbox/dougsleite/binding-gdata/target/sample-store.jar (limited to 'sandbox/dougsleite/binding-gdata') diff --git a/sandbox/dougsleite/binding-gdata/.classpath b/sandbox/dougsleite/binding-gdata/.classpath new file mode 100644 index 0000000000..b79cc8d2b1 --- /dev/null +++ b/sandbox/dougsleite/binding-gdata/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/sandbox/dougsleite/binding-gdata/.project b/sandbox/dougsleite/binding-gdata/.project new file mode 100644 index 0000000000..401e1fa087 --- /dev/null +++ b/sandbox/dougsleite/binding-gdata/.project @@ -0,0 +1,23 @@ + + + binding-gdata + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.devzuz.q.maven.jdt.core.mavenIncrementalBuilder + + + + + + org.eclipse.jdt.core.javanature + org.devzuz.q.maven.jdt.core.mavenNature + + diff --git a/sandbox/dougsleite/binding-gdata/build.xml b/sandbox/dougsleite/binding-gdata/build.xml new file mode 100644 index 0000000000..652afc3570 --- /dev/null +++ b/sandbox/dougsleite/binding-gdata/build.xml @@ -0,0 +1,79 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sandbox/dougsleite/binding-gdata/pom.xml b/sandbox/dougsleite/binding-gdata/pom.xml new file mode 100644 index 0000000000..39cc89437e --- /dev/null +++ b/sandbox/dougsleite/binding-gdata/pom.xml @@ -0,0 +1,131 @@ + + + 4.0.0 + + org.apache.tuscany.sca + tuscany-sca + 1.4-SNAPSHOT + ../pom.xml + + sample-store + Apache Tuscany SCA Getting Started Binding GData + + + + apache.incubator + http://people.apache.org/repo/m2-incubating-repository + + + + + + org.apache.tuscany.sca + tuscany-host-embedded + 1.4-SNAPSHOT + + + + org.apache.tuscany.sca + tuscany-data-api + 1.4-SNAPSHOT + + + + org.apache.tuscany.sca + tuscany-implementation-java-runtime + 1.4-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-implementation-widget-runtime + 1.4-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-binding-atom-abdera + 1.4-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-binding-jsonrpc-runtime + 1.4-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-binding-http-runtime + 1.4-SNAPSHOT + runtime + + + + org.apache.tuscany.sca + tuscany-host-tomcat + 1.4-SNAPSHOT + runtime + + + + junit + junit + 4.2 + test + + + + com.google.gdata + gdata-client + 1.0 + + + + com.google.gdata + gdata-core + 1.0 + + + + gdata-calendar + gdata-calendar + 1.0 + compile + + + + org.apache.tuscany.sca + tuscany-binding-gdata-runtime + 1.4-SNAPSHOT + compile + + + + + + ${artifactId} + + + diff --git a/sandbox/dougsleite/binding-gdata/src/main/java/launch/Launch.java b/sandbox/dougsleite/binding-gdata/src/main/java/launch/Launch.java new file mode 100644 index 0000000000..b99a6bf59c --- /dev/null +++ b/sandbox/dougsleite/binding-gdata/src/main/java/launch/Launch.java @@ -0,0 +1,34 @@ +/* + * 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 launch; + +import org.apache.tuscany.sca.host.embedded.SCADomain; + +public class Launch { + public static void main(String[] args) throws Exception { + System.out.println("Starting ..."); + SCADomain scaDomain = SCADomain.newInstance("calendar.composite"); + System.out.println("calendar.composite ready!!!"); + System.in.read(); + System.out.println("Stopping ..."); + scaDomain.close(); + System.out.println(); + } +} diff --git a/sandbox/dougsleite/binding-gdata/src/main/java/services/Controler.java b/sandbox/dougsleite/binding-gdata/src/main/java/services/Controler.java new file mode 100644 index 0000000000..7adac14bc3 --- /dev/null +++ b/sandbox/dougsleite/binding-gdata/src/main/java/services/Controler.java @@ -0,0 +1,33 @@ +/* + * Copyright 2008 douglas. + * + * Licensed 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. + * under the License. + */ +package services; + +import com.google.gdata.data.BaseEntry; +import java.util.List; +import org.osoa.sca.annotations.Remotable; + +/** + * + * @author douglas + */ +@Remotable +public interface Controler { + + public void createEvent(String name, String location, String startTime, String endTime, String description); + + public List getEntries(); +} diff --git a/sandbox/dougsleite/binding-gdata/src/main/java/services/ControlerImpl.java b/sandbox/dougsleite/binding-gdata/src/main/java/services/ControlerImpl.java new file mode 100644 index 0000000000..9024897edb --- /dev/null +++ b/sandbox/dougsleite/binding-gdata/src/main/java/services/ControlerImpl.java @@ -0,0 +1,91 @@ +/* + * 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 services; + +import com.google.gdata.data.BaseEntry; +import com.google.gdata.data.DateTime; +import com.google.gdata.data.Entry; +import com.google.gdata.data.PlainTextConstruct; +import com.google.gdata.data.calendar.CalendarEventEntry; +import com.google.gdata.data.extensions.When; +import com.google.gdata.data.extensions.Where; +import java.util.ArrayList; +import java.util.List; +import org.apache.tuscany.sca.binding.gdata.collection.Collection; +import org.osoa.sca.annotations.Reference; + +public class ControlerImpl implements Controler { + + @Reference(name = "resources", required = true) + public Collection resources; + + public ControlerImpl() { + } + + public void createEvent(String name, String location, String startTime, String endTime, String description) { + + CalendarEventEntry entry = new CalendarEventEntry(); + + //Set title + if (name != null) { + entry.setTitle(new PlainTextConstruct(name)); + } + + //Set location + if (location != null) { + Where where = new Where(); + where.setValueString(location); + + entry.addLocation(where); + } + + //Set startTime and endTime + //"2008-06-05T15:00:00-08:00" + if (startTime != null && endTime != null) { + DateTime start = DateTime.parseDateTime(startTime); + DateTime end = DateTime.parseDateTime(endTime); + When eventTimes = new When(); + eventTimes.setStartTime(start); + eventTimes.setEndTime(end); + + entry.addTime(eventTimes); + } + + //Set content + if (description != null) { + entry.setContent(new PlainTextConstruct(description)); + } + +// Person author = new Person("GSoC Student 2008", null, "gsocstudent2008@gmail.com"); +// entry.getAuthors().add(author); + + //resources.post(entry); + } + + public List getEntries() { + //return (List) resources.getFeed().getEntries(); + BaseEntry entry = new Entry(); + entry.setTitle(new PlainTextConstruct("Entry")); + entry.setContent(new PlainTextConstruct("Conteudo")); + + List list = new ArrayList(); + list.add(entry); + return list; + } +} diff --git a/sandbox/dougsleite/binding-gdata/src/main/resources/calendar.composite b/sandbox/dougsleite/binding-gdata/src/main/resources/calendar.composite new file mode 100644 index 0000000000..30610ede5f --- /dev/null +++ b/sandbox/dougsleite/binding-gdata/src/main/resources/calendar.composite @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sandbox/dougsleite/binding-gdata/src/main/resources/uiservices/calendar.html b/sandbox/dougsleite/binding-gdata/src/main/resources/uiservices/calendar.html new file mode 100644 index 0000000000..0d92ae5902 --- /dev/null +++ b/sandbox/dougsleite/binding-gdata/src/main/resources/uiservices/calendar.html @@ -0,0 +1,72 @@ + + + + Calendar + + + + + + + + +

Calendar

+
+
+
+
+ +
+
+ + diff --git a/sandbox/dougsleite/binding-gdata/target/classes/calendar.composite b/sandbox/dougsleite/binding-gdata/target/classes/calendar.composite new file mode 100644 index 0000000000..30610ede5f --- /dev/null +++ b/sandbox/dougsleite/binding-gdata/target/classes/calendar.composite @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sandbox/dougsleite/binding-gdata/target/classes/launch/Launch.class b/sandbox/dougsleite/binding-gdata/target/classes/launch/Launch.class new file mode 100644 index 0000000000..3262e67c73 Binary files /dev/null and b/sandbox/dougsleite/binding-gdata/target/classes/launch/Launch.class differ diff --git a/sandbox/dougsleite/binding-gdata/target/classes/services/Controler.class b/sandbox/dougsleite/binding-gdata/target/classes/services/Controler.class new file mode 100644 index 0000000000..328e9f0853 Binary files /dev/null and b/sandbox/dougsleite/binding-gdata/target/classes/services/Controler.class differ diff --git a/sandbox/dougsleite/binding-gdata/target/classes/services/ControlerImpl.class b/sandbox/dougsleite/binding-gdata/target/classes/services/ControlerImpl.class new file mode 100644 index 0000000000..25d2739e9c Binary files /dev/null and b/sandbox/dougsleite/binding-gdata/target/classes/services/ControlerImpl.class differ diff --git a/sandbox/dougsleite/binding-gdata/target/classes/uiservices/calendar.html b/sandbox/dougsleite/binding-gdata/target/classes/uiservices/calendar.html new file mode 100644 index 0000000000..0d92ae5902 --- /dev/null +++ b/sandbox/dougsleite/binding-gdata/target/classes/uiservices/calendar.html @@ -0,0 +1,72 @@ + + + + Calendar + + + + + + + + +

Calendar

+
+
+
+
+ +
+
+ + diff --git a/sandbox/dougsleite/binding-gdata/target/sample-store.jar b/sandbox/dougsleite/binding-gdata/target/sample-store.jar new file mode 100644 index 0000000000..2468fdf0bb Binary files /dev/null and b/sandbox/dougsleite/binding-gdata/target/sample-store.jar differ -- cgit v1.2.3