diff options
author | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2009-04-18 07:36:53 +0000 |
---|---|---|
committer | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2009-04-18 07:36:53 +0000 |
commit | 6c7ad7c110656f47273dc23228b41e46023492f3 (patch) | |
tree | 348f4838b71e73278bd01153e93db88e22e9c189 /branches/sca-java-1.5/samples/photo-gallery | |
parent | 5395b820e60118c68eab9c442af3c53e0e2d7f50 (diff) |
Create 1.5 branch
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@766260 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'branches/sca-java-1.5/samples/photo-gallery')
32 files changed, 913 insertions, 0 deletions
diff --git a/branches/sca-java-1.5/samples/photo-gallery/README b/branches/sca-java-1.5/samples/photo-gallery/README new file mode 100644 index 0000000000..d32f1d3bd1 --- /dev/null +++ b/branches/sca-java-1.5/samples/photo-gallery/README @@ -0,0 +1,20 @@ +Photo-Gallery Sample +====================================== + +This is a sample picture gallery application using Tuscany SCA. + +Building And Running The Sample Using Ant +----------------------------------------- +With the binary distribution the sample can be built using Ant as follows: + +cd photo-gallery +ant compile + +and then, to run: + +ant run + +Once the store application is running use your browser to visit the following +URL: + +http://localhost:8080/gallery/ diff --git a/branches/sca-java-1.5/samples/photo-gallery/build.xml b/branches/sca-java-1.5/samples/photo-gallery/build.xml new file mode 100644 index 0000000000..765f853f38 --- /dev/null +++ b/branches/sca-java-1.5/samples/photo-gallery/build.xml @@ -0,0 +1,79 @@ +<!-- + * 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. +--> +<project name="photo-gallary" default="compile"> + <property name="test.class" value="launch.LaunchGallery" /> + <property name="test.jar" value="sample-photo-gallary.jar" /> + + <target name="init"> + <mkdir dir="target/classes"/> + </target> + + <target name="compile" depends="init"> + <javac srcdir="src/main/java" + destdir="target/classes" + debug="on" + source="1.5" + target="1.5"> + <classpath> + <pathelement location="../../lib/tuscany-sca-manifest.jar"/> + <fileset refid="3rdparty.jars"/> + </classpath> + </javac> + <copy todir="target/classes"> + <fileset dir="src/main/resources"/> + </copy> + <jar destfile="target/${test.jar}" basedir="target/classes"> + <manifest> + <attribute name="Main-Class" value="${test.class}" /> + </manifest> + </jar> + </target> + + <target name="run-classes"> + <java classname="${test.class}" + fork="true"> + <classpath> + <pathelement path="target/classes"/> + <pathelement location="../../lib/tuscany-sca-manifest.jar"/> + <fileset refid="3rdparty.jars"/> + </classpath> + </java> + </target> + + <target name="run"> + <java classname="${test.class}" + fork="true"> + <classpath> + <pathelement path="target/classes"/> + <pathelement location="../../lib/tuscany-sca-manifest.jar"/> + <fileset refid="3rdparty.jars"/> + </classpath> + </java> + </target> + + <target name="clean"> + <delete quiet="true" includeemptydirs="true"> + <fileset dir="target"/> + </delete> + </target> + + <fileset id="3rdparty.jars" dir="../../lib"> + <include name="saxon-8.7.jar"/> + </fileset> +</project> diff --git a/branches/sca-java-1.5/samples/photo-gallery/photo-gallery.png b/branches/sca-java-1.5/samples/photo-gallery/photo-gallery.png Binary files differnew file mode 100644 index 0000000000..0e0ae8b9ec --- /dev/null +++ b/branches/sca-java-1.5/samples/photo-gallery/photo-gallery.png diff --git a/branches/sca-java-1.5/samples/photo-gallery/photo-gallery.svg b/branches/sca-java-1.5/samples/photo-gallery/photo-gallery.svg new file mode 100644 index 0000000000..9136fef9ad --- /dev/null +++ b/branches/sca-java-1.5/samples/photo-gallery/photo-gallery.svg @@ -0,0 +1,226 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- + * 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. +--> +<!-- Created with Inkscape (http://www.inkscape.org/) --> +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://web.resource.org/cc/" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="1052.3622" + height="744.09448" + id="svg2" + sodipodi:version="0.32" + inkscape:version="0.45pre1" + sodipodi:docbase="D:\Opensource\Apache\Tuscany\source\java-sca-1.x\samples\photo-gallery" + sodipodi:docname="photo-gallery.svg" + version="1.0" + inkscape:output_extension="org.inkscape.output.svg.inkscape" + inkscape:export-filename="D:\Opensource\Apache\Tuscany\source\java-sca-1.x\samples\photo-gallery\photo-gallery.png" + inkscape:export-xdpi="52.84" + inkscape:export-ydpi="52.84" + sodipodi:modified="true"> + <defs + id="defs4" /> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + gridtolerance="10000" + guidetolerance="10" + objecttolerance="10" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="1.4" + inkscape:cx="538.06165" + inkscape:cy="341.69129" + inkscape:document-units="px" + inkscape:current-layer="g2997" + inkscape:window-width="1466" + inkscape:window-height="831" + inkscape:window-x="117" + inkscape:window-y="80" /> + <metadata + id="metadata7"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1"> + <g + id="g2997"> + <rect + rx="14.335117" + ry="17.743465" + y="197.1973" + x="447.35422" + height="419.39099" + width="464.23727" + id="rect2067" + style="opacity:1;fill:#90baf4;fill-opacity:1;stroke:#060000;stroke-width:2.28840661;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <flowRoot + id="flowRoot2954" + xml:space="preserve" + transform="translate(189.90868,1.0101522)" + style="text-anchor:start;text-align:start;writing-mode:lr;line-height:125%"><flowRegion + id="flowRegion2956"><rect + y="212.66591" + x="281.42856" + height="61.42857" + width="170" + id="rect2958" + style="text-anchor:start;text-align:start;writing-mode:lr;line-height:125%" /></flowRegion><flowPara + id="flowPara2214">photo-gallery</flowPara></flowRoot> <rect + style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:2.30182266;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="rect2175" + width="118.21779" + height="111.27543" + x="492.31448" + y="342.04559" + rx="7.1507306" + ry="9.2311935" /> + <flowRoot + xml:space="preserve" + id="flowRoot2177" + transform="translate(224.57279,135.95616)" + style="text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start"><flowRegion + id="flowRegion2179"><rect + id="rect2181" + width="170" + height="61.42857" + x="281.42856" + y="212.66591" + style="text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start" /></flowRegion><flowPara + id="flowPara2216">gallery</flowPara></flowRoot> <path + style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + d="M 475.01306,373.74169 L 508.3481,373.74169 L 514.40901,386.87367 L 507.33795,398.99551 L 475.01306,398.99551 L 482.58921,386.87367 L 475.01306,373.74169 z " + id="path2187" /> + <rect + style="opacity:1;fill:#0064ff;fill-opacity:1;stroke:#000000;stroke-width:0.9612025;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="rect2223" + width="104.08451" + height="113.17588" + x="138.37151" + y="350.1156" + rx="0" + ry="0.048917599" /> + <path + style="fill:#1a73fe;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;fill-opacity:1" + d="M 138.21429,462.66591 L 115.35714,479.80877 L 267.85714,479.80877 L 241.78571,463.02305 L 138.21429,462.66591 z " + id="path3197" /> + <rect + style="opacity:1;fill:#f1f4f8;fill-opacity:1;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="rect3199" + width="92.5" + height="97.14286" + x="143.57143" + y="358.38019" + ry="3.6203461" + rx="3.9285715" /> + <image + y="366.6889" + x="156.24066" + id="image3323" + height="78.571434" + width="58.57143" + sodipodi:absref="C:\simon\tuscany\evangelism\whitepapers\shoppingcart.png" + xlink:href="C:\simon\tuscany\evangelism\whitepapers\shoppingcart.png" /> + <image + y="364.80875" + x="527.14288" + id="image3342" + height="78.571434" + width="58.57143" + sodipodi:absref="C:\simon\tuscany\evangelism\whitepapers\shoppingcart.png" + xlink:href="C:\simon\tuscany\evangelism\whitepapers\shoppingcart.png" /> + <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.98866588px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + d="M 625.70862,383.37452 C 744.37642,384.82859 746.43425,383.37452 746.43425,383.37452" + id="path3354" + sodipodi:nodetypes="cc" /> + <flowRoot + xml:space="preserve" + id="flowRoot3364" + transform="translate(-199.33705,8.0748553)"><flowRegion + id="flowRegion3366"><rect + id="rect3368" + width="142.14285" + height="21.428572" + x="655" + y="349.80878" /></flowRegion><flowPara + id="flowPara3370">HTTP</flowPara></flowRoot> <flowRoot + xml:space="preserve" + id="flowRoot3372" + transform="translate(9.9486586,3.0748553)"><flowRegion + id="flowRegion3374"><rect + id="rect3376" + width="142.14285" + height="21.428572" + x="655" + y="349.80878" /></flowRegion><flowPara + id="flowPara3378">JSONRPC</flowPara></flowRoot> <path + style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1.17523563px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + d="M 246.15904,386.72177 C 481.89588,387.75606 485.98382,386.72177 485.98382,386.72177" + id="path2220" + sodipodi:nodetypes="cc" /> + </g> + <rect + style="fill:#317fed;fill-opacity:1;stroke:#060000;stroke-width:2;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="rect2988" + width="115.66247" + height="85.862968" + x="728.71185" + y="338.41565" + rx="6.9961648" + ry="7.1230249" /> + <flowRoot + xml:space="preserve" + id="flowRoot2966" + transform="translate(461.12105,132.47712)" + style="text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start"><flowRegion + id="flowRegion2968"><rect + id="rect2970" + width="170" + height="61.42857" + x="281.42856" + y="212.66591" + style="text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start" /></flowRegion><flowPara + id="flowPara2218">Album</flowPara></flowRoot> <path + style="fill:#5b9d05;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + d="M 711.56132,370.26264 L 744.89636,370.26264 L 750.95727,383.39462 L 743.88621,395.51646 L 711.56132,395.51646 L 719.13747,383.39462 L 711.56132,370.26264 z " + id="path3017" /> + <path + style="fill:#ae62bf;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + d="M 588.38519,369.13865 L 621.72023,369.13865 L 627.78114,382.27063 L 620.71008,394.39247 L 588.38519,394.39247 L 595.96134,382.27063 L 588.38519,369.13865 z " + id="path3019" /> + </g> +</svg> diff --git a/branches/sca-java-1.5/samples/photo-gallery/pom.xml b/branches/sca-java-1.5/samples/photo-gallery/pom.xml new file mode 100644 index 0000000000..02ad3544b8 --- /dev/null +++ b/branches/sca-java-1.5/samples/photo-gallery/pom.xml @@ -0,0 +1,127 @@ +<?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. +--> +<project> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-sca</artifactId> + <version>1.5-SNAPSHOT</version> + <relativePath>../pom.xml</relativePath> + </parent> + <artifactId>sample-photo-gallery</artifactId> + <name>Apache Tuscany SCA Sample Getting Started Online Store</name> + + <repositories> + <repository> + <id>apache.incubator</id> + <url>http://people.apache.org/repo/m2-incubating-repository</url> + </repository> + </repositories> + + <dependencies> + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-host-embedded</artifactId> + <version>1.5-SNAPSHOT</version> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-data-api</artifactId> + <version>1.5-SNAPSHOT</version> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-implementation-java-runtime</artifactId> + <version>1.5-SNAPSHOT</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-implementation-widget-runtime-tuscany</artifactId> + <version>1.5-SNAPSHOT</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-binding-atom-abdera</artifactId> + <version>1.5-SNAPSHOT</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-binding-atom-js</artifactId> + <version>1.5-SNAPSHOT</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-binding-jsonrpc-runtime</artifactId> + <version>1.5-SNAPSHOT</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-binding-jsonrpc-js</artifactId> + <version>1.5-SNAPSHOT</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-binding-http-runtime</artifactId> + <version>1.5-SNAPSHOT</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.tuscany.sca</groupId> + <artifactId>tuscany-host-jetty</artifactId> + <version>1.5-SNAPSHOT</version> + <scope>runtime</scope> + </dependency> + + <dependency> + <groupId>org.apache.derby</groupId> + <artifactId>derby</artifactId> + <!-- version>10.2.1.6</version--> + <version>10.3.1.4</version> + </dependency> + + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>4.5</version> + <scope>test</scope> + </dependency> + + </dependencies> + + <build> + <finalName>${artifactId}</finalName> + </build> + +</project> diff --git a/branches/sca-java-1.5/samples/photo-gallery/src/main/java/launch/LaunchGallery.java b/branches/sca-java-1.5/samples/photo-gallery/src/main/java/launch/LaunchGallery.java new file mode 100644 index 0000000000..1007cd49b0 --- /dev/null +++ b/branches/sca-java-1.5/samples/photo-gallery/src/main/java/launch/LaunchGallery.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 LaunchGallery { + public static void main(String[] args) throws Exception { + System.out.println("Starting ..."); + SCADomain scaDomain = SCADomain.newInstance("photo-gallery.composite"); + System.out.println("photo.gallery.composite ready for big business !!!"); + System.in.read(); + System.out.println("Stopping ..."); + scaDomain.close(); + System.out.println(); + } +} diff --git a/branches/sca-java-1.5/samples/photo-gallery/src/main/java/services/Album.java b/branches/sca-java-1.5/samples/photo-gallery/src/main/java/services/Album.java new file mode 100644 index 0000000000..5257d0e703 --- /dev/null +++ b/branches/sca-java-1.5/samples/photo-gallery/src/main/java/services/Album.java @@ -0,0 +1,29 @@ +/* + * 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 org.osoa.sca.annotations.Remotable; + +@Remotable +public interface Album { + + public String[] getPictures(); + +} diff --git a/branches/sca-java-1.5/samples/photo-gallery/src/main/java/services/AlbumImpl.java b/branches/sca-java-1.5/samples/photo-gallery/src/main/java/services/AlbumImpl.java new file mode 100644 index 0000000000..dd2b086e29 --- /dev/null +++ b/branches/sca-java-1.5/samples/photo-gallery/src/main/java/services/AlbumImpl.java @@ -0,0 +1,95 @@ +/* + * 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 java.io.File; +import java.io.FilenameFilter; +import java.net.URL; +import java.util.ArrayList; +import java.util.List; + +import org.osoa.sca.annotations.Init; +import org.osoa.sca.annotations.Property; + +public class AlbumImpl implements Album { + private String gallery; + private String album; + private String location; + private List<String> pictures = new ArrayList<String>(); + + @Property + public void setGallery(String gallery) { + this.gallery = gallery; + this.location = null; + } + @Property + public void setAlbum(String album) { + this.album = album; + this.location = null; + } + + protected String getLocation() { + if (location == null) { + location = gallery + "/" + album + "/"; + } + return location; + + } + + @Init + public void init() { + try { + URL albumURL = this.getClass().getClassLoader().getResource(getLocation()); + if(albumURL != null) { + File album = new File(albumURL.toURI()); + if (album.isDirectory() && album.exists()) { + String[] listPictures = album.list(new ImageFilter(".jpg")); + for(String image : listPictures) { + image = getLocation() + image; + pictures.add(image); + } + } + } + } catch (Exception e) { + // FIXME: ignore for now + e.printStackTrace(); + } + } + + public String[] getPictures() { + String[] pictureArray = new String[pictures.size()]; + pictures.toArray(pictureArray); + return pictureArray; + } + + /** + * Inner fileFilter class + */ + private class ImageFilter implements FilenameFilter { + String afn; + ImageFilter(String afn) { this.afn = afn; } + public boolean accept(File dir, String name) { + // Strip path information: + String f = new File(name).getName(); + return f.indexOf(afn) != -1; + } + } ///:~ + +} diff --git a/branches/sca-java-1.5/samples/photo-gallery/src/main/resources/gallery.html b/branches/sca-java-1.5/samples/photo-gallery/src/main/resources/gallery.html new file mode 100644 index 0000000000..864987df12 --- /dev/null +++ b/branches/sca-java-1.5/samples/photo-gallery/src/main/resources/gallery.html @@ -0,0 +1,135 @@ +<!-- + * 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. +--> +<html> +<head> +<title>Photo Gallery</title> + +<link href="styles.css" rel="stylesheet"> + +<script type="text/javascript" src="gallery.js"></script> +<script language="JavaScript"> + + //@Reference + var album = new tuscany.sca.Reference("album"); + + var albumItems; + var currPos = 0; + + function album_getResponse(items, exception) { + if(exception) { + alert(exception.msg); + return; + } + albumItems = items; + showAlbum(); + } + + function showImage(pos) { + var img = document.createElement("img"); + img.onload = function(evt) { + document.getElementById("albumImage").src = this.src; + document.getElementById("albumImage").width=this.width; + document.getElementById("albumImage").height=this.height; + } + img.src = albumItems[pos]; + return false; + } + + function showAlbum() { + if(albumItems.length > 0) { + showImage(currPos); + } + } + + function goNext() { + if(currPos < albumItems.length) { + currPos++; + showImage(currPos); + } + } + + function goPrevious() { + if(currPos > 0) { + currPos--; + showImage(currPos); + } + } + + function init() { + try { + album.getPictures(album_getResponse); + } catch(exception) { + alert(e); + } + } + + + index_off= new Image(31,31); index_off.src = "index.gif"; + index_on = new Image(31,31); index_on.src = "index_on.gif"; + next_off = new Image(31,31); next_off.src = "next.gif"; + next_on = new Image(31,31); next_on.src = "next_on.gif"; + prev_off = new Image(31,31); prev_off.src = "prev.gif"; + prev_on = new Image(31,31); prev_on.src = "prev_on.gif"; + +</script> + +</head> + +<body onload="init()"> +<br> +<h1><center>Apache Tuscany Photo Gallery</center></h1> +<br> +<br> + <div id="gallery"> + <div id="album"> + <!--img id="albumImage" border="0" src=""--> + </div> + <br> + </div> + + <center> + + <table style="height:54px;" cellspacing="0" cellpadding="0" border="0"> + <tr> + <td valign="middle"> + <!-- Navigation Header --> + <table style="width:100%;" cellspacing="0" cellpadding="0" border="0"> + <tr> + <td style="width:31px;"><a href="javascript:showAlbum()" onmouseover="document.index.src=index_on.src" onmouseout="document.index.src=index_off.src"><img src="index.gif" width="31" height="31" border="0" title="Index page" name="index" alt=""></a></td> + <td style="width:31px;"><a href="javascript:goPrevious()" onmouseover="document.previous.src=prev_on.src" onmouseout="document.previous.src=prev_off.src"><img src="prev.gif" width="31" height="31" border="0" title="Previous image" name="previous" alt=""></a></td> + <td style="width:31px;"><a href="javascript:goNext()" onmouseover="document.next.src=next_on.src" onmouseout="document.next.src=next_off.src"><img src="next.gif" width="31" height="31" border="0" title="Next image" name="next" alt=""></a></td> + <td style="width:31px;"><a href="javascript:void(0)" onmouseover="show_over();" onmouseout="show_out();" onmousedown="show_down();" ondblclick="change_delay();"><img src="show_slide.gif" width="31" height="31" border="0" title="Start/Stop slideshow - DoubleClick to change speed" name="show" alt=""></a></td> + </tr> + </table> + </td> + </tr> + </table> + + <table style="width:720px;" border="0" cellspacing="0" cellpadding="0"> + <tr> + <td align="center"> <!-- Image without original --> + <img id="albumImage" src="space.gif" class="slideImage" width="720" height="540" ondragstart="return false" onselectstart="return false" oncontextmenu="return false" galleryimg="no" usemap="#imagemap" alt=""> + </td> + </tr> + </table> + + </center> + +</body> +</html> diff --git a/branches/sca-java-1.5/samples/photo-gallery/src/main/resources/gallery/boston/dsc00368.jpg b/branches/sca-java-1.5/samples/photo-gallery/src/main/resources/gallery/boston/dsc00368.jpg Binary files differnew file mode 100644 index 0000000000..9437b321e2 --- /dev/null +++ b/branches/sca-java-1.5/samples/photo-gallery/src/main/resources/gallery/boston/dsc00368.jpg diff --git a/branches/sca-java-1.5/samples/photo-gallery/src/main/resources/gallery/boston/dsc00369.jpg b/branches/sca-java-1.5/samples/photo-gallery/src/main/resources/gallery/boston/dsc00369.jpg Binary files differnew file mode 100644 index 0000000000..07f37ec505 --- /dev/null +++ b/branches/sca-java-1.5/samples/photo-gallery/src/main/resources/gallery/boston/dsc00369.jpg diff --git a/branches/sca-java-1.5/samples/photo-gallery/src/main/resources/gallery/boston/dsc00370.jpg b/branches/sca-java-1.5/samples/photo-gallery/src/main/resources/gallery/boston/dsc00370.jpg Binary files differnew file mode 100644 index 0000000000..2193784271 --- /dev/null +++ b/branches/sca-java-1.5/samples/photo-gallery/src/main/resources/gallery/boston/dsc00370.jpg diff --git a/branches/sca-java-1.5/samples/photo-gallery/src/main/resources/gallery/boston/dsc00371.jpg b/branches/sca-java-1.5/samples/photo-gallery/src/main/resources/gallery/boston/dsc00371.jpg Binary files differnew file mode 100644 index 0000000000..1532ee2c1b --- /dev/null +++ b/branches/sca-java-1.5/samples/photo-gallery/src/main/resources/gallery/boston/dsc00371.jpg diff --git a/branches/sca-java-1.5/samples/photo-gallery/src/main/resources/gallery/boston/dsc00373.jpg b/branches/sca-java-1.5/samples/photo-gallery/src/main/resources/gallery/boston/dsc00373.jpg Binary files differnew file mode 100644 index 0000000000..17ffd73aec --- /dev/null +++ b/branches/sca-java-1.5/samples/photo-gallery/src/main/resources/gallery/boston/dsc00373.jpg diff --git a/branches/sca-java-1.5/samples/photo-gallery/src/main/resources/gallery/boston/dsc00375.jpg b/branches/sca-java-1.5/samples/photo-gallery/src/main/resources/gallery/boston/dsc00375.jpg Binary files differnew file mode 100644 index 0000000000..19e9ec37df --- /dev/null +++ b/branches/sca-java-1.5/samples/photo-gallery/src/main/resources/gallery/boston/dsc00375.jpg diff --git a/branches/sca-java-1.5/samples/photo-gallery/src/main/resources/gallery/boston/dsc00376.jpg b/branches/sca-java-1.5/samples/photo-gallery/src/main/resources/gallery/boston/dsc00376.jpg Binary files differnew file mode 100644 index 0000000000..022416dbce --- /dev/null +++ b/branches/sca-java-1.5/samples/photo-gallery/src/main/resources/gallery/boston/dsc00376.jpg diff --git a/branches/sca-java-1.5/samples/photo-gallery/src/main/resources/gallery/boston/dsc00377.jpg b/branches/sca-java-1.5/samples/photo-gallery/src/main/resources/gallery/boston/dsc00377.jpg Binary files differnew file mode 100644 index 0000000000..c78a974714 --- /dev/null +++ b/branches/sca-java-1.5/samples/photo-gallery/src/main/resources/gallery/boston/dsc00377.jpg diff --git a/branches/sca-java-1.5/samples/photo-gallery/src/main/resources/gallery/boston/dsc00378.jpg b/branches/sca-java-1.5/samples/photo-gallery/src/main/resources/gallery/boston/dsc00378.jpg Binary files differnew file mode 100644 index 0000000000..a98070925a --- /dev/null +++ b/branches/sca-java-1.5/samples/photo-gallery/src/main/resources/gallery/boston/dsc00378.jpg diff --git a/branches/sca-java-1.5/samples/photo-gallery/src/main/resources/gallery/boston/dsc00379.jpg b/branches/sca-java-1.5/samples/photo-gallery/src/main/resources/gallery/boston/dsc00379.jpg Binary files differnew file mode 100644 index 0000000000..dc83889116 --- /dev/null +++ b/branches/sca-java-1.5/samples/photo-gallery/src/main/resources/gallery/boston/dsc00379.jpg diff --git a/branches/sca-java-1.5/samples/photo-gallery/src/main/resources/gallery/boston/dsc00380.jpg b/branches/sca-java-1.5/samples/photo-gallery/src/main/resources/gallery/boston/dsc00380.jpg Binary files differnew file mode 100644 index 0000000000..0e33548135 --- /dev/null +++ b/branches/sca-java-1.5/samples/photo-gallery/src/main/resources/gallery/boston/dsc00380.jpg diff --git a/branches/sca-java-1.5/samples/photo-gallery/src/main/resources/index.gif b/branches/sca-java-1.5/samples/photo-gallery/src/main/resources/index.gif Binary files differnew file mode 100755 index 0000000000..7599ac7686 --- /dev/null +++ b/branches/sca-java-1.5/samples/photo-gallery/src/main/resources/index.gif diff --git a/branches/sca-java-1.5/samples/photo-gallery/src/main/resources/index_on.gif b/branches/sca-java-1.5/samples/photo-gallery/src/main/resources/index_on.gif Binary files differnew file mode 100755 index 0000000000..153e9879d6 --- /dev/null +++ b/branches/sca-java-1.5/samples/photo-gallery/src/main/resources/index_on.gif diff --git a/branches/sca-java-1.5/samples/photo-gallery/src/main/resources/next.gif b/branches/sca-java-1.5/samples/photo-gallery/src/main/resources/next.gif Binary files differnew file mode 100755 index 0000000000..002eaf6951 --- /dev/null +++ b/branches/sca-java-1.5/samples/photo-gallery/src/main/resources/next.gif diff --git a/branches/sca-java-1.5/samples/photo-gallery/src/main/resources/next_disabled.gif b/branches/sca-java-1.5/samples/photo-gallery/src/main/resources/next_disabled.gif Binary files differnew file mode 100755 index 0000000000..38b1298453 --- /dev/null +++ b/branches/sca-java-1.5/samples/photo-gallery/src/main/resources/next_disabled.gif diff --git a/branches/sca-java-1.5/samples/photo-gallery/src/main/resources/next_on.gif b/branches/sca-java-1.5/samples/photo-gallery/src/main/resources/next_on.gif Binary files differnew file mode 100755 index 0000000000..4e5bb3e7ef --- /dev/null +++ b/branches/sca-java-1.5/samples/photo-gallery/src/main/resources/next_on.gif diff --git a/branches/sca-java-1.5/samples/photo-gallery/src/main/resources/photo-gallery.composite b/branches/sca-java-1.5/samples/photo-gallery/src/main/resources/photo-gallery.composite new file mode 100644 index 0000000000..0bb3c4b4db --- /dev/null +++ b/branches/sca-java-1.5/samples/photo-gallery/src/main/resources/photo-gallery.composite @@ -0,0 +1,47 @@ +<?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. +--> +<composite xmlns="http://www.osoa.org/xmlns/sca/1.0" + xmlns:t="http://tuscany.apache.org/xmlns/sca/1.0" + targetNamespace="http://photo-gallery" + name="photo-gallery"> + + <component name="Gallery"> + <t:implementation.widget location="gallery.html"/> + <service name="Widget"> + <t:binding.http uri="/gallery"/> + </service> + <reference name="album" target="Album"> + <t:binding.jsonrpc/> + </reference> + </component> + + <component name="Album"> + <implementation.java class="services.AlbumImpl"/> + <property name="gallery">gallery</property> + <property name="album">boston</property> + <service name="Album"> + <t:binding.jsonrpc/> + </service> + </component> + + <component name="GalleryPictures"> + <t:implementation.resource location="gallery"></t:implementation.resource> + </component> +</composite> diff --git a/branches/sca-java-1.5/samples/photo-gallery/src/main/resources/prev.gif b/branches/sca-java-1.5/samples/photo-gallery/src/main/resources/prev.gif Binary files differnew file mode 100755 index 0000000000..4eea10f1dc --- /dev/null +++ b/branches/sca-java-1.5/samples/photo-gallery/src/main/resources/prev.gif diff --git a/branches/sca-java-1.5/samples/photo-gallery/src/main/resources/prev_disabled.gif b/branches/sca-java-1.5/samples/photo-gallery/src/main/resources/prev_disabled.gif Binary files differnew file mode 100755 index 0000000000..7e35f07076 --- /dev/null +++ b/branches/sca-java-1.5/samples/photo-gallery/src/main/resources/prev_disabled.gif diff --git a/branches/sca-java-1.5/samples/photo-gallery/src/main/resources/prev_on.gif b/branches/sca-java-1.5/samples/photo-gallery/src/main/resources/prev_on.gif Binary files differnew file mode 100755 index 0000000000..3ef9a776bb --- /dev/null +++ b/branches/sca-java-1.5/samples/photo-gallery/src/main/resources/prev_on.gif diff --git a/branches/sca-java-1.5/samples/photo-gallery/src/main/resources/show_slide.gif b/branches/sca-java-1.5/samples/photo-gallery/src/main/resources/show_slide.gif Binary files differnew file mode 100644 index 0000000000..a5b6a15c2b --- /dev/null +++ b/branches/sca-java-1.5/samples/photo-gallery/src/main/resources/show_slide.gif diff --git a/branches/sca-java-1.5/samples/photo-gallery/src/main/resources/space.gif b/branches/sca-java-1.5/samples/photo-gallery/src/main/resources/space.gif Binary files differnew file mode 100644 index 0000000000..170fe82b65 --- /dev/null +++ b/branches/sca-java-1.5/samples/photo-gallery/src/main/resources/space.gif diff --git a/branches/sca-java-1.5/samples/photo-gallery/src/main/resources/styles.css b/branches/sca-java-1.5/samples/photo-gallery/src/main/resources/styles.css new file mode 100755 index 0000000000..d23d949858 --- /dev/null +++ b/branches/sca-java-1.5/samples/photo-gallery/src/main/resources/styles.css @@ -0,0 +1,121 @@ +body { + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 12px; + color: #888888; + background-color: #000000; + margin-top: 0px; +} + +html { + scrollbar-face-color:#444444; + scrollbar-highlight-color:#000000; + scrollbar-3dlight-color:#000000; + scrollbar-darkshadow-color:#000000; + scrollbar-shadow-color:#000000; + scrollbar-arrow-color:#888888; + scrollbar-track-color:#000000; +} + +a:link { + text-decoration: none; + color: #AAAAAA; +} + +a:visited { + text-decoration: none; + color: #AAAAAA; +} + +a:hover { + text-decoration: none; + color: #FFFFFF; +} + +.current { + font-weight: bold; + color: #AAAAAA; + background-color: #666666; +} + +.cthumb { + background-color: #666666; + border: 0px; border-width: 0px; +} + +.thumb { + background-color: #333333; + border: 0px; border-width: 0px; +} + +.image { margin: 0px; border-width: 1px; border: 1px solid;} +a:link .image { border-color: #aaaaaa; color: #aaaaaa;} +a:visited .image { border-color: #666666; color: #666666;} +a:hover .image { border-color: #ffffff; color: #ffffff;} + +.slideImage { border-width: 0px; border: 0px solid; border-color: #ffffff;} +a:link .slideImage { border-color: #ffffff;} +a:visited .slideImage { border-color: #ffffff;} + +.title { + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 14px; + font-weight: bold; + color: #000000; +} + +.title a:link { + text-decoration: none; + color: #000000; +} + +.title a:visited { + text-decoration: none; + color: #000000; +} + +.title a:hover { + text-decoration: none; + color: #ffffff; +} + +.infotable { + border: 1px solid #444444; + border-collapse: collapse; +} + +.infotable td { + border: 1px solid #444444; +} + +.infotable table td { + border: 0px; +} + +.dirname { + font-size: 12px; + font-weight: bold; + color: #AAAAAA; +} + +.comment { + color: #CCCCCC; + font-weight: bold; + font-size: 12px; +} + +.smalltxt { + color: #888888; + font-size: 11px; +} + +.xsmalltxt { + color: #888888; + font-size: 9px; +} + +.newlabel { + font-size: 8px; + font-weight: bold; + color: #EEEEEE; + background-color: #558800; +}
\ No newline at end of file |