commit
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
flex-todolist-config-example
|
||||
=======================
|
||||
|
||||
|
||||
|
||||
|
||||
[http://www.adobe.com/devnet/flex/articles/fullstack_pt3.html](http://www.adobe.com/devnet/flex/articles/fullstack_pt3.html)
|
||||
@@ -0,0 +1,34 @@
|
||||
<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/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>net.aimeizi</groupId>
|
||||
<artifactId>flex-todolist-example</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</parent>
|
||||
<artifactId>flex-todolist-config-example</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>make shared resources</id>
|
||||
<goals>
|
||||
<goal>single</goal>
|
||||
</goals>
|
||||
<phase>package</phase>
|
||||
<configuration>
|
||||
<descriptors>
|
||||
<descriptor>src/main/assembly/resources.xml</descriptor>
|
||||
</descriptors>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,13 @@
|
||||
<assembly>
|
||||
<id>resources</id>
|
||||
<formats>
|
||||
<format>zip</format>
|
||||
</formats>
|
||||
<includeBaseDirectory>false</includeBaseDirectory>
|
||||
<fileSets>
|
||||
<fileSet>
|
||||
<directory>src/main/resources</directory>
|
||||
<outputDirectory></outputDirectory>
|
||||
</fileSet>
|
||||
</fileSets>
|
||||
</assembly>
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<service id="remoting-service"
|
||||
class="flex.messaging.services.RemotingService">
|
||||
|
||||
<adapters>
|
||||
<adapter-definition id="java-object"
|
||||
class="flex.messaging.services.remoting.adapters.JavaAdapter"
|
||||
default="true"/>
|
||||
</adapters>
|
||||
|
||||
<default-channels>
|
||||
<channel ref="channel-amf"/>
|
||||
</default-channels>
|
||||
|
||||
<destination id="todoService">
|
||||
<properties>
|
||||
<factory>spring</factory>
|
||||
<source>todoService</source>
|
||||
</properties>
|
||||
</destination>
|
||||
</service>
|
||||
+58
@@ -0,0 +1,58 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<services-config>
|
||||
<services>
|
||||
<service-include file-path="remoting-config.xml"/>
|
||||
</services>
|
||||
|
||||
<!-- Spring factory registration -->
|
||||
<factories>
|
||||
<factory id="spring"
|
||||
class="org.epseelon.samples.todolist.controller.SpringFactory"/>
|
||||
</factories>
|
||||
|
||||
<channels>
|
||||
<channel-definition id="channel-amf"
|
||||
class="mx.messaging.channels.AMFChannel">
|
||||
<endpoint
|
||||
url="http://{server.name}:{server.port}/{context.root}/messagebroker/amf"
|
||||
class="flex.messaging.endpoints.AMFEndpoint"/>
|
||||
<properties>
|
||||
<polling-enabled>false</polling-enabled>
|
||||
</properties>
|
||||
</channel-definition>
|
||||
</channels>
|
||||
|
||||
<logging>
|
||||
<target class="flex.messaging.log.ConsoleTarget"
|
||||
level="Error">
|
||||
<properties>
|
||||
<prefix>[BlazeDS]</prefix>
|
||||
<includeDate>true</includeDate>
|
||||
<includeTime>false</includeTime>
|
||||
<includeLevel>true</includeLevel>
|
||||
<includeCategory>true</includeCategory>
|
||||
</properties>
|
||||
<filters>
|
||||
<pattern>Endpoint.*</pattern>
|
||||
<pattern>Service.*</pattern>
|
||||
<pattern>Message.*</pattern>
|
||||
<pattern>DataService.*</pattern>
|
||||
<pattern>Configuration</pattern>
|
||||
</filters>
|
||||
</target>
|
||||
</logging>
|
||||
|
||||
<system>
|
||||
<redeploy>
|
||||
<enabled>true</enabled>
|
||||
<watch-interval>20</watch-interval>
|
||||
<watch-file>
|
||||
{context.root}/WEB-INF/flex/services-config.xml
|
||||
</watch-file>
|
||||
<watch-file>
|
||||
{context.root}/WEB-INF/flex/remoting-config.xml
|
||||
</watch-file>
|
||||
<touch-file>{context.root}/WEB-INF/web.xml</touch-file>
|
||||
</redeploy>
|
||||
</system>
|
||||
</services-config>
|
||||
@@ -0,0 +1,7 @@
|
||||
flex-todolist-ria-example
|
||||
=======================
|
||||
|
||||
|
||||
|
||||
|
||||
[http://www.adobe.com/devnet/flex/articles/fullstack_pt1.html](http://www.adobe.com/devnet/flex/articles/fullstack_pt1.html)
|
||||
@@ -0,0 +1,126 @@
|
||||
<?xml version="1.0"?>
|
||||
<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>
|
||||
<groupId>net.aimeizi</groupId>
|
||||
<artifactId>flex-todolist-example</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</parent>
|
||||
<artifactId>flex-todolist-ria-example</artifactId>
|
||||
<packaging>swf</packaging>
|
||||
<name>flex-todolist-ria-example Maven Flex</name>
|
||||
<url>http://maven.apache.org</url>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<dependency>
|
||||
<groupId>${project.groupId}</groupId>
|
||||
<artifactId>flex-todolist-config-example</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<classifier>resources</classifier>
|
||||
<type>zip</type>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.adobe.flex.sdk</groupId>
|
||||
<artifactId>playerglobal</artifactId>
|
||||
<version>3.0.0.3.0.0.477</version>
|
||||
<type>swc</type>
|
||||
<scope>external</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.adobe.flex.sdk</groupId>
|
||||
<artifactId>flex</artifactId>
|
||||
<version>3.0.0.3.0.0.477</version>
|
||||
<type>swc</type>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.adobe.flex.sdk</groupId>
|
||||
<artifactId>framework</artifactId>
|
||||
<version>3.0.0.3.0.0.477</version>
|
||||
<type>swc</type>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.adobe.flex.sdk</groupId>
|
||||
<artifactId>framework</artifactId>
|
||||
<version>3.0.0.3.0.0.477</version>
|
||||
<type>resource-bundle</type>
|
||||
<classifier>en_US</classifier>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.adobe.flex.sdk</groupId>
|
||||
<artifactId>rpc</artifactId>
|
||||
<version>3.0.0.3.0.0.477</version>
|
||||
<type>swc</type>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.adobe.flex.sdk</groupId>
|
||||
<artifactId>rpc</artifactId>
|
||||
<version>3.0.0.3.0.0.477</version>
|
||||
<type>resource-bundle</type>
|
||||
<classifier>en_US</classifier>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.adobe.flex.sdk</groupId>
|
||||
<artifactId>utilities</artifactId>
|
||||
<version>3.0.0.3.0.0.477</version>
|
||||
<type>swc</type>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
||||
<sourceDirectory>src/main/flex</sourceDirectory>
|
||||
|
||||
<defaultGoal>install</defaultGoal>
|
||||
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>${basedir}/src/main/resources</directory>
|
||||
</resource>
|
||||
<resource>
|
||||
<directory>${basedir}/target/generated-resources</directory>
|
||||
<filtering>true</filtering>
|
||||
</resource>
|
||||
</resources>
|
||||
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>info.rvin.mojo</groupId>
|
||||
<artifactId>flex-compiler-mojo</artifactId>
|
||||
<version>1.0-beta3</version>
|
||||
<extensions>true</extensions>
|
||||
<configuration>
|
||||
<locales>
|
||||
<param>en_US</param>
|
||||
</locales>
|
||||
<contextRoot>flex-todolist-web-example</contextRoot>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>unpack-config</id>
|
||||
<goals>
|
||||
<goal>unpack-dependencies</goal>
|
||||
</goals>
|
||||
<phase>generate-resources</phase>
|
||||
<configuration>
|
||||
<outputDirectory>${project.build.directory}/generated-resources</outputDirectory>
|
||||
<includeArtifacIds>flex-todolist-config-example</includeArtifacIds>
|
||||
<includeGroupIds>${project.groupId}</includeGroupIds>
|
||||
<excludeTransitive>true</excludeTransitive>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
|
||||
layout="vertical" verticalAlign="middle" horizontalAlign="center"
|
||||
xmlns:screen="org.epseelon.samples.todolist.view.screen.*">
|
||||
|
||||
<screen:TodoForm/>
|
||||
|
||||
</mx:Application>
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
package org.epseelon.samples.todolist.view.entity
|
||||
{
|
||||
[RemoteClass(alias="org.epseelon.samples.todolist.domain.TodoItem")]
|
||||
[Bindable]
|
||||
public class TodoItem
|
||||
{
|
||||
public var id:Number;
|
||||
public var title:String;
|
||||
}
|
||||
}
|
||||
+103
@@ -0,0 +1,103 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<mx:TitleWindow xmlns:mx="http://www.adobe.com/2006/mxml"
|
||||
layout="vertical" width="488" height="384" creationComplete="getList()">
|
||||
|
||||
<mx:Form width="100%" height="100%" defaultButton="{saveButton}">
|
||||
<mx:FormHeading label="Todo List" width="100%"/>
|
||||
<mx:FormItem label="ID:" width="127">
|
||||
<mx:TextInput width="100%" id="idText"
|
||||
text="{TodoItem(todoDatagrid.selectedItem).id}" editable="false" enabled="false"/>
|
||||
</mx:FormItem>
|
||||
<mx:FormItem label="Title:" width="345">
|
||||
<mx:TextInput width="100%" id="titleText"
|
||||
text="{TodoItem(todoDatagrid.selectedItem).title}"/>
|
||||
</mx:FormItem>
|
||||
<mx:DataGrid id="todoDatagrid" width="100%" height="100%" dataProvider="{todoItems}">
|
||||
<mx:columns>
|
||||
<mx:DataGridColumn headerText="ID" dataField="id" width="30"/>
|
||||
<mx:DataGridColumn headerText="Title" dataField="title"/>
|
||||
</mx:columns>
|
||||
</mx:DataGrid>
|
||||
</mx:Form>
|
||||
|
||||
<mx:ControlBar horizontalAlign="center">
|
||||
<mx:Button label="New" click="setDefault()"/>
|
||||
<mx:Button label="Save" id="saveButton" click="save()"
|
||||
textAlign="center"/>
|
||||
<mx:Button label="Delete" click="remove()"/>
|
||||
</mx:ControlBar>
|
||||
|
||||
<mx:RemoteObject id="todoService" showBusyCursor="true"
|
||||
fault="onFault(event)" destination="todoService">
|
||||
<mx:method name="save" result="onResultSave(event)" fault="onFault(event)"/>
|
||||
<mx:method name="remove" result="onResultRemove(event)" fault="onFault(event)"/>
|
||||
<mx:method name="getList" result="onResultGetList(event)" fault="onFault(event)"/>
|
||||
</mx:RemoteObject>
|
||||
|
||||
<mx:Script>
|
||||
<![CDATA[
|
||||
import mx.collections.ArrayCollection;
|
||||
import org.epseelon.samples.todolist.view.entity.TodoItem;
|
||||
import mx.rpc.events.ResultEvent;
|
||||
import mx.rpc.events.FaultEvent;
|
||||
import mx.controls.Alert;
|
||||
|
||||
[Bindable]
|
||||
private var todoItems:ArrayCollection;
|
||||
|
||||
private var todoItem:TodoItem;
|
||||
|
||||
public function save():void
|
||||
{
|
||||
this.todoItem = new TodoItem();
|
||||
this.todoItem.id = new Number(idText.text);
|
||||
this.todoItem.title = titleText.text;
|
||||
todoService.save(todoItem);
|
||||
}
|
||||
|
||||
public function onResultSave(event:ResultEvent):void
|
||||
{
|
||||
status = "Item was successfully saved with ID: " + TodoItem(event.result).id;
|
||||
getList();
|
||||
}
|
||||
|
||||
public function remove():void
|
||||
{
|
||||
if (todoDatagrid.selectedItem != null) {
|
||||
todoItem = todoDatagrid.selectedItem as TodoItem;
|
||||
todoService.remove(todoItem);
|
||||
} else {
|
||||
Alert.show("Select an item to delete");
|
||||
}
|
||||
}
|
||||
|
||||
public function onResultRemove(event:ResultEvent):void
|
||||
{
|
||||
status = "Deletion succeeded!";
|
||||
getList();
|
||||
}
|
||||
|
||||
public function getList():void
|
||||
{
|
||||
todoService.getList();
|
||||
}
|
||||
|
||||
public function onResultGetList(event:ResultEvent):void
|
||||
{
|
||||
todoItems = event.result as ArrayCollection;
|
||||
}
|
||||
|
||||
public function setDefault():void
|
||||
{
|
||||
idText.text = "";
|
||||
titleText.text = "";
|
||||
}
|
||||
|
||||
|
||||
public function onFault(event:FaultEvent):void
|
||||
{
|
||||
Alert.show(event.fault.message);
|
||||
}
|
||||
]]>
|
||||
</mx:Script>
|
||||
</mx:TitleWindow>
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0"?>
|
||||
<!-- Simple example to demonstrate the TextInput control. -->
|
||||
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
|
||||
|
||||
<mx:Panel title="Created by the flex maven archetype (1.0)" height="75%" width="75%"
|
||||
paddingTop="10" paddingLeft="10">
|
||||
<mx:VBox horizontalAlign="center" width="100%">
|
||||
<mx:Label text="Archetype created by - Jacob von Eyben"/>
|
||||
<mx:LinkButton label="http://ancientprogramming.blogspot.com"
|
||||
click="navigateToURL(new URLRequest('http://ancientprogramming.blogspot.com'));"/>
|
||||
</mx:VBox>
|
||||
</mx:Panel>
|
||||
</mx:Application>
|
||||
@@ -0,0 +1,10 @@
|
||||
flex-todolist-web-example
|
||||
=======================
|
||||
|
||||
|
||||
```
|
||||
mvn jetty:run
|
||||
```
|
||||
|
||||
|
||||
[http://www.adobe.com/devnet/flex/articles/fullstack_pt2.html](http://www.adobe.com/devnet/flex/articles/fullstack_pt2.html)
|
||||
@@ -0,0 +1,171 @@
|
||||
<?xml version="1.0"?>
|
||||
<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>
|
||||
<groupId>net.aimeizi</groupId>
|
||||
<artifactId>flex-todolist-example</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</parent>
|
||||
<artifactId>flex-todolist-web-example</artifactId>
|
||||
<packaging>war</packaging>
|
||||
<name>flex-todolist-web-example Maven Webapp</name>
|
||||
<url>http://maven.apache.org</url>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
<version>5.1.31</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>${project.groupId}</groupId>
|
||||
<artifactId>flex-todolist-ria-example</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<type>swf</type>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>3.8.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring</artifactId>
|
||||
<version>2.5.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.aspectj</groupId>
|
||||
<artifactId>aspectjrt</artifactId>
|
||||
<version>1.5.4</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.aspectj</groupId>
|
||||
<artifactId>aspectjweaver</artifactId>
|
||||
<version>1.5.4</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.hibernate</groupId>
|
||||
<artifactId>hibernate</artifactId>
|
||||
<version>3.2.6.ga</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.adobe.blazeds</groupId>
|
||||
<artifactId>blazeds-common</artifactId>
|
||||
<version>3.0.0.544</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.adobe.blazeds</groupId>
|
||||
<artifactId>blazeds-core</artifactId>
|
||||
<version>3.0.0.544</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.adobe.blazeds</groupId>
|
||||
<artifactId>blazeds-remoting</artifactId>
|
||||
<version>3.0.0.544</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>backport-util-concurrent</groupId>
|
||||
<artifactId>backport-util-concurrent</artifactId>
|
||||
<version>3.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>servlet-api</artifactId>
|
||||
<version>2.5</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>${project.groupId}</groupId>
|
||||
<artifactId>flex-todolist-config-example</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<classifier>resources</classifier>
|
||||
<type>zip</type>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<finalName>flex-todolist-web-example</finalName>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/resources</directory>
|
||||
</resource>
|
||||
<resource>
|
||||
<directory>src/main/java</directory>
|
||||
<excludes>
|
||||
<exclude>**/*.java</exclude>
|
||||
</excludes>
|
||||
<includes>
|
||||
<include>**/*.xml</include>
|
||||
</includes>
|
||||
</resource>
|
||||
</resources>
|
||||
|
||||
<plugins>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<configuration>
|
||||
<source>1.5</source>
|
||||
<target>1.5</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>unpack-config</id>
|
||||
<goals>
|
||||
<goal>unpack-dependencies</goal>
|
||||
</goals>
|
||||
<phase>generate-resources</phase>
|
||||
<configuration>
|
||||
<outputDirectory>${project.build.directory}/${project.build.finalName}/WEB-INF/flex
|
||||
</outputDirectory>
|
||||
<includeArtifacIds>flex-todolist-config-example</includeArtifacIds>
|
||||
<includeGroupIds>${project.groupId}</includeGroupIds>
|
||||
<includeClassifiers>resources</includeClassifiers>
|
||||
<excludeTransitive>true</excludeTransitive>
|
||||
<excludeTypes>jar,swf</excludeTypes>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>copy-swf</id>
|
||||
<phase>process-classes</phase>
|
||||
<goals>
|
||||
<goal>copy-dependencies</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<outputDirectory>${project.build.directory}/${project.build.finalName}</outputDirectory>
|
||||
<includeTypes>swf</includeTypes>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>info.rvin.mojo</groupId>
|
||||
<artifactId>flex-compiler-mojo</artifactId>
|
||||
<extensions>true</extensions>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-maven-plugin</artifactId>
|
||||
</plugin>
|
||||
|
||||
</plugins>
|
||||
|
||||
</build>
|
||||
</project>
|
||||
Binary file not shown.
+15
@@ -0,0 +1,15 @@
|
||||
package org.epseelon.samples.todolist.business;
|
||||
|
||||
import org.epseelon.samples.todolist.domain.TodoItem;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface TodoService {
|
||||
void remove(TodoItem todoItem) throws Exception;
|
||||
|
||||
TodoItem save(TodoItem todoItem) throws Exception;
|
||||
|
||||
TodoItem findById(TodoItem todoItem) throws Exception;
|
||||
|
||||
List<TodoItem> getList() throws Exception;
|
||||
}
|
||||
+47
@@ -0,0 +1,47 @@
|
||||
package org.epseelon.samples.todolist.business;
|
||||
|
||||
import org.epseelon.samples.todolist.domain.TodoItem;
|
||||
import org.epseelon.samples.todolist.domain.TodoItemRepository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class TodoServiceImpl implements TodoService {
|
||||
private TodoItemRepository todoItemRepository;
|
||||
|
||||
public void setTodoItemRepository(TodoItemRepository todoItemRepository) {
|
||||
this.todoItemRepository = todoItemRepository;
|
||||
}
|
||||
|
||||
public TodoItem save(TodoItem item) throws Exception {
|
||||
try {
|
||||
this.todoItemRepository.save(item);
|
||||
return item;
|
||||
} catch (Exception e) {
|
||||
throw new Exception("Could not save item because: " + e.getCause());
|
||||
}
|
||||
}
|
||||
|
||||
public void remove(TodoItem item) throws Exception {
|
||||
try {
|
||||
this.todoItemRepository.remove(item);
|
||||
} catch (Exception e) {
|
||||
throw new Exception("Could not delete item because " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public TodoItem findById(TodoItem item) throws Exception {
|
||||
try {
|
||||
return this.todoItemRepository.findById(item);
|
||||
} catch (Exception e) {
|
||||
throw new Exception("Could not find item because " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public List<TodoItem> getList() throws Exception {
|
||||
try {
|
||||
return this.todoItemRepository.getList();
|
||||
} catch (Exception e) {
|
||||
throw new Exception("Could not list items because " + e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
+67
@@ -0,0 +1,67 @@
|
||||
package org.epseelon.samples.todolist.controller;
|
||||
|
||||
import flex.messaging.FactoryInstance;
|
||||
import flex.messaging.FlexFactory;
|
||||
import flex.messaging.config.ConfigMap;
|
||||
import flex.messaging.services.ServiceException;
|
||||
import org.springframework.beans.BeansException;
|
||||
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.web.context.support.WebApplicationContextUtils;
|
||||
|
||||
public class SpringFactory implements FlexFactory {
|
||||
private static final String SOURCE = "source";
|
||||
|
||||
public void initialize(String id, ConfigMap configMap) {
|
||||
}
|
||||
|
||||
public FactoryInstance createFactoryInstance(String id, ConfigMap properties) {
|
||||
SpringFactoryInstance instance = new SpringFactoryInstance(this, id, properties);
|
||||
instance.setSource(properties.getPropertyAsString(SOURCE, instance.getId()));
|
||||
return instance;
|
||||
} // end method createFactoryInstance()
|
||||
|
||||
public Object lookup(FactoryInstance inst) {
|
||||
SpringFactoryInstance factoryInstance = (SpringFactoryInstance) inst;
|
||||
return factoryInstance.lookup();
|
||||
}
|
||||
|
||||
static class SpringFactoryInstance extends FactoryInstance {
|
||||
SpringFactoryInstance(SpringFactory factory, String id, ConfigMap properties) {
|
||||
super(factory, id, properties);
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return "SpringFactory instance for id=" + getId() + " source=" + getSource() + " scope=" +
|
||||
getScope();
|
||||
}
|
||||
|
||||
public Object lookup() {
|
||||
ApplicationContext appContext = WebApplicationContextUtils.getWebApplicationContext(flex.messaging.FlexContext.getServletConfig().getServletContext());
|
||||
|
||||
String beanName = getSource();
|
||||
try {
|
||||
return appContext.getBean(beanName);
|
||||
} catch (NoSuchBeanDefinitionException nexc) {
|
||||
ServiceException e = new ServiceException();
|
||||
String msg = "Spring service named '" + beanName
|
||||
+ "' does not exist.";
|
||||
e.setMessage(msg);
|
||||
e.setRootCause(nexc);
|
||||
e.setDetails(msg);
|
||||
e.setCode("Server.Processing");
|
||||
|
||||
throw e;
|
||||
} catch (BeansException bexc) {
|
||||
ServiceException e = new ServiceException();
|
||||
String msg = "Unable to create Spring service named '"
|
||||
+ beanName + "' ";
|
||||
e.setMessage(msg);
|
||||
e.setRootCause(bexc);
|
||||
e.setDetails(msg);
|
||||
e.setCode("Server.Processing");
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
Binary file not shown.
+22
@@ -0,0 +1,22 @@
|
||||
package org.epseelon.samples.todolist.domain;
|
||||
|
||||
public class TodoItem {
|
||||
private long id;
|
||||
private String title;
|
||||
|
||||
public long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
package org.epseelon.samples.todolist.domain;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface TodoItemRepository {
|
||||
void remove(TodoItem todoItem);
|
||||
|
||||
TodoItem save(TodoItem todoItem);
|
||||
|
||||
TodoItem findById(TodoItem todoItem) throws Exception;
|
||||
|
||||
List<TodoItem> getList();
|
||||
}
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
package org.epseelon.samples.todolist.domain.hibernate;
|
||||
|
||||
import org.epseelon.samples.todolist.domain.TodoItem;
|
||||
import org.epseelon.samples.todolist.domain.TodoItemRepository;
|
||||
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class TodoItemHibernateDao extends HibernateDaoSupport implements TodoItemRepository {
|
||||
public TodoItem save(TodoItem todoItem) {
|
||||
getHibernateTemplate().saveOrUpdate(todoItem);
|
||||
return todoItem;
|
||||
}
|
||||
|
||||
public void remove(TodoItem todoItem) {
|
||||
getHibernateTemplate().delete(todoItem);
|
||||
}
|
||||
|
||||
public TodoItem findById(TodoItem todoItem) throws Exception {
|
||||
long id = todoItem.getId();
|
||||
todoItem = (TodoItem) getHibernateTemplate().get(TodoItem.class, todoItem.getId());
|
||||
|
||||
if (todoItem == null)
|
||||
throw new Exception("Could not find an item with id " + id);
|
||||
return todoItem;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public List<TodoItem> getList() {
|
||||
return (List<TodoItem>) getHibernateTemplate().loadAll(TodoItem.class);
|
||||
}
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE hibernate-mapping PUBLIC
|
||||
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
|
||||
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
|
||||
<hibernate-mapping>
|
||||
<class name="org.epseelon.samples.todolist.domain.TodoItem" table="todoitem">
|
||||
<id name="id" column="ID_TODOITEM" type="long">
|
||||
<generator class="native"/>
|
||||
</id>
|
||||
|
||||
<property name="title" column="TITLE" type="string" not-null="true" length="50"/>
|
||||
</class>
|
||||
</hibernate-mapping>
|
||||
@@ -0,0 +1,5 @@
|
||||
CREATE TABLE `todoitem` (
|
||||
`id_todoitem` int(10) unsigned NOT NULL auto_increment,
|
||||
`title` varchar(256) NOT NULL,
|
||||
PRIMARY KEY (`id_todoitem`)
|
||||
) ENGINE=InnoDB;
|
||||
Binary file not shown.
@@ -0,0 +1,276 @@
|
||||
// Flash Player Version Detection - Rev 1.6
|
||||
// Detect Client Browser type
|
||||
// Copyright(c) 2005-2006 Adobe Macromedia Software, LLC. All rights reserved.
|
||||
var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
|
||||
var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
|
||||
var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
|
||||
|
||||
function ControlVersion()
|
||||
{
|
||||
var version;
|
||||
var axo;
|
||||
var e;
|
||||
|
||||
// NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry
|
||||
|
||||
try {
|
||||
// version will be set for 7.X or greater players
|
||||
axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
|
||||
version = axo.GetVariable("$version");
|
||||
} catch (e) {
|
||||
}
|
||||
|
||||
if (!version)
|
||||
{
|
||||
try {
|
||||
// version will be set for 6.X players only
|
||||
axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
|
||||
|
||||
// installed player is some revision of 6.0
|
||||
// GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
|
||||
// so we have to be careful.
|
||||
|
||||
// default to the first public version
|
||||
version = "WIN 6,0,21,0";
|
||||
|
||||
// throws if AllowScripAccess does not exist (introduced in 6.0r47)
|
||||
axo.AllowScriptAccess = "always";
|
||||
|
||||
// safe to call for 6.0r47 or greater
|
||||
version = axo.GetVariable("$version");
|
||||
|
||||
} catch (e) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!version)
|
||||
{
|
||||
try {
|
||||
// version will be set for 4.X or 5.X player
|
||||
axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
|
||||
version = axo.GetVariable("$version");
|
||||
} catch (e) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!version)
|
||||
{
|
||||
try {
|
||||
// version will be set for 3.X player
|
||||
axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
|
||||
version = "WIN 3,0,18,0";
|
||||
} catch (e) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!version)
|
||||
{
|
||||
try {
|
||||
// version will be set for 2.X player
|
||||
axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
|
||||
version = "WIN 2,0,0,11";
|
||||
} catch (e) {
|
||||
version = -1;
|
||||
}
|
||||
}
|
||||
|
||||
return version;
|
||||
}
|
||||
|
||||
// JavaScript helper required to detect Flash Player PlugIn version information
|
||||
function GetSwfVer(){
|
||||
// NS/Opera version >= 3 check for Flash plugin in plugin array
|
||||
var flashVer = -1;
|
||||
|
||||
if (navigator.plugins != null && navigator.plugins.length > 0) {
|
||||
if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
|
||||
var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
|
||||
var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
|
||||
var descArray = flashDescription.split(" ");
|
||||
var tempArrayMajor = descArray[2].split(".");
|
||||
var versionMajor = tempArrayMajor[0];
|
||||
var versionMinor = tempArrayMajor[1];
|
||||
var versionRevision = descArray[3];
|
||||
if (versionRevision == "") {
|
||||
versionRevision = descArray[4];
|
||||
}
|
||||
if (versionRevision[0] == "d") {
|
||||
versionRevision = versionRevision.substring(1);
|
||||
} else if (versionRevision[0] == "r") {
|
||||
versionRevision = versionRevision.substring(1);
|
||||
if (versionRevision.indexOf("d") > 0) {
|
||||
versionRevision = versionRevision.substring(0, versionRevision.indexOf("d"));
|
||||
}
|
||||
}
|
||||
var flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
|
||||
}
|
||||
}
|
||||
// MSN/WebTV 2.6 supports Flash 4
|
||||
else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
|
||||
// WebTV 2.5 supports Flash 3
|
||||
else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
|
||||
// older WebTV supports Flash 2
|
||||
else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
|
||||
else if ( isIE && isWin && !isOpera ) {
|
||||
flashVer = ControlVersion();
|
||||
}
|
||||
return flashVer;
|
||||
}
|
||||
|
||||
// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
|
||||
function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
|
||||
{
|
||||
versionStr = GetSwfVer();
|
||||
if (versionStr == -1 ) {
|
||||
return false;
|
||||
} else if (versionStr != 0) {
|
||||
if(isIE && isWin && !isOpera) {
|
||||
// Given "WIN 2,0,0,11"
|
||||
tempArray = versionStr.split(" "); // ["WIN", "2,0,0,11"]
|
||||
tempString = tempArray[1]; // "2,0,0,11"
|
||||
versionArray = tempString.split(","); // ['2', '0', '0', '11']
|
||||
} else {
|
||||
versionArray = versionStr.split(".");
|
||||
}
|
||||
var versionMajor = versionArray[0];
|
||||
var versionMinor = versionArray[1];
|
||||
var versionRevision = versionArray[2];
|
||||
|
||||
// is the major.revision >= requested major.revision AND the minor version >= requested minor
|
||||
if (versionMajor > parseFloat(reqMajorVer)) {
|
||||
return true;
|
||||
} else if (versionMajor == parseFloat(reqMajorVer)) {
|
||||
if (versionMinor > parseFloat(reqMinorVer))
|
||||
return true;
|
||||
else if (versionMinor == parseFloat(reqMinorVer)) {
|
||||
if (versionRevision >= parseFloat(reqRevision))
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function AC_AddExtension(src, ext)
|
||||
{
|
||||
if (src.indexOf('?') != -1)
|
||||
return src.replace(/\?/, ext+'?');
|
||||
else
|
||||
return src + ext;
|
||||
}
|
||||
|
||||
function AC_Generateobj(objAttrs, params, embedAttrs)
|
||||
{
|
||||
var str = '';
|
||||
if (isIE && isWin && !isOpera)
|
||||
{
|
||||
str += '<object ';
|
||||
for (var i in objAttrs)
|
||||
str += i + '="' + objAttrs[i] + '" ';
|
||||
str += '>';
|
||||
for (var i in params)
|
||||
str += '<param name="' + i + '" value="' + params[i] + '" /> ';
|
||||
str += '</object>';
|
||||
} else {
|
||||
str += '<embed ';
|
||||
for (var i in embedAttrs)
|
||||
str += i + '="' + embedAttrs[i] + '" ';
|
||||
str += '> </embed>';
|
||||
}
|
||||
|
||||
document.write(str);
|
||||
}
|
||||
|
||||
function AC_FL_RunContent(){
|
||||
var ret =
|
||||
AC_GetArgs
|
||||
( arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
|
||||
, "application/x-shockwave-flash"
|
||||
);
|
||||
AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
|
||||
}
|
||||
|
||||
function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
|
||||
var ret = new Object();
|
||||
ret.embedAttrs = new Object();
|
||||
ret.params = new Object();
|
||||
ret.objAttrs = new Object();
|
||||
for (var i=0; i < args.length; i=i+2){
|
||||
var currArg = args[i].toLowerCase();
|
||||
|
||||
switch (currArg){
|
||||
case "classid":
|
||||
break;
|
||||
case "pluginspage":
|
||||
ret.embedAttrs[args[i]] = args[i+1];
|
||||
break;
|
||||
case "src":
|
||||
case "movie":
|
||||
args[i+1] = AC_AddExtension(args[i+1], ext);
|
||||
ret.embedAttrs["src"] = args[i+1];
|
||||
ret.params[srcParamName] = args[i+1];
|
||||
break;
|
||||
case "onafterupdate":
|
||||
case "onbeforeupdate":
|
||||
case "onblur":
|
||||
case "oncellchange":
|
||||
case "onclick":
|
||||
case "ondblClick":
|
||||
case "ondrag":
|
||||
case "ondragend":
|
||||
case "ondragenter":
|
||||
case "ondragleave":
|
||||
case "ondragover":
|
||||
case "ondrop":
|
||||
case "onfinish":
|
||||
case "onfocus":
|
||||
case "onhelp":
|
||||
case "onmousedown":
|
||||
case "onmouseup":
|
||||
case "onmouseover":
|
||||
case "onmousemove":
|
||||
case "onmouseout":
|
||||
case "onkeypress":
|
||||
case "onkeydown":
|
||||
case "onkeyup":
|
||||
case "onload":
|
||||
case "onlosecapture":
|
||||
case "onpropertychange":
|
||||
case "onreadystatechange":
|
||||
case "onrowsdelete":
|
||||
case "onrowenter":
|
||||
case "onrowexit":
|
||||
case "onrowsinserted":
|
||||
case "onstart":
|
||||
case "onscroll":
|
||||
case "onbeforeeditfocus":
|
||||
case "onactivate":
|
||||
case "onbeforedeactivate":
|
||||
case "ondeactivate":
|
||||
case "type":
|
||||
case "codebase":
|
||||
ret.objAttrs[args[i]] = args[i+1];
|
||||
break;
|
||||
case "id":
|
||||
case "width":
|
||||
case "height":
|
||||
case "align":
|
||||
case "vspace":
|
||||
case "hspace":
|
||||
case "class":
|
||||
case "title":
|
||||
case "accesskey":
|
||||
case "name":
|
||||
case "tabindex":
|
||||
ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
|
||||
break;
|
||||
default:
|
||||
ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
|
||||
}
|
||||
}
|
||||
ret.objAttrs["classid"] = classid;
|
||||
if (mimeType) ret.embedAttrs["type"] = mimeType;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
+92
@@ -0,0 +1,92 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:p="http://www.springframework.org/schema/p"
|
||||
xmlns:context="http://www.springframework.org/schema/context"
|
||||
xmlns:aop="http://www.springframework.org/schema/aop"
|
||||
xmlns:tx="http://www.springframework.org/schema/tx"
|
||||
xmlns:jee="http://www.springframework.org/schema/jee"
|
||||
xsi:schemaLocation="
|
||||
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
|
||||
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd
|
||||
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
|
||||
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
|
||||
http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-2.5.xsd">
|
||||
|
||||
<!-- Properties file -->
|
||||
|
||||
<context:property-placeholder location="/WEB-INF/jdbc.properties"/>
|
||||
|
||||
<!-- Datasource -->
|
||||
<bean id="dataSource"
|
||||
class="org.springframework.jdbc.datasource.DriverManagerDataSource">
|
||||
<property name="driverClassName" value="${jdbc.driverClassName}"/>
|
||||
<property name="url" value="${jdbc.url}"/>
|
||||
<property name="username" value="${jdbc.username}"/>
|
||||
<property name="password" value="${jdbc.password}"/>
|
||||
</bean>
|
||||
|
||||
<!-- Hibernate SessionFactory -->
|
||||
<bean id="sessionFactory"
|
||||
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
|
||||
<property name="dataSource">
|
||||
<ref local="dataSource"/>
|
||||
</property>
|
||||
<property name="mappingDirectoryLocations">
|
||||
<list>
|
||||
<value>
|
||||
classpath:org/epseelon/samples/todolist/domain/hibernate/hbm/
|
||||
</value>
|
||||
</list>
|
||||
</property>
|
||||
<property name="hibernateProperties">
|
||||
<props>
|
||||
<prop key="hibernate.dialect">
|
||||
${hibernate.dialect}
|
||||
</prop>
|
||||
<prop key="hibernate.show_sql">true</prop>
|
||||
</props>
|
||||
</property>
|
||||
<property name="eventListeners">
|
||||
<map>
|
||||
<entry key="merge">
|
||||
<bean class="org.springframework.orm.hibernate3.support.IdTransferringMergeEventListener"/>
|
||||
</entry>
|
||||
</map>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<!-- ========================= BUSINESS OBJECT DEFINITIONS ========================= -->
|
||||
<bean id="todoService" class="org.epseelon.samples.todolist.business.TodoServiceImpl">
|
||||
<property name="todoItemRepository" ref="todoItemRepository"/>
|
||||
</bean>
|
||||
|
||||
<bean id="todoItemRepository" class="org.epseelon.samples.todolist.domain.hibernate.TodoItemHibernateDao">
|
||||
<property name="sessionFactory" ref="sessionFactory"/>
|
||||
</bean>
|
||||
|
||||
<!-- ========================= TRANSACTION MANAGEMENT ========================= -->
|
||||
<bean id="txManager"
|
||||
class="org.springframework.orm.hibernate3.HibernateTransactionManager">
|
||||
<property name="sessionFactory">
|
||||
<ref local="sessionFactory"/>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<tx:advice id="txAdvice" transaction-manager="txManager">
|
||||
<!-- the transactional semantics... -->
|
||||
<tx:attributes>
|
||||
<!-- all methods starting with 'get' are read-only -->
|
||||
<tx:method name="get*" read-only="true"/>
|
||||
<!-- other methods use the default transaction settings (see below) -->
|
||||
<tx:method name="*"/>
|
||||
</tx:attributes>
|
||||
</tx:advice>
|
||||
|
||||
<aop:config>
|
||||
<aop:pointcut id="todoServiceOperation"
|
||||
expression="execution(* org.epseelon.samples.todolist.business.TodoService.*(..))"/>
|
||||
<aop:advisor advice-ref="txAdvice" pointcut-ref="todoServiceOperation"/>
|
||||
</aop:config>
|
||||
|
||||
</beans>
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
jdbc.driverClassName=com.mysql.jdbc.Driver
|
||||
jdbc.url=jdbc:mysql://localhost:3306/todolist
|
||||
jdbc.username=root
|
||||
jdbc.password=
|
||||
hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
### direct log messages to stdout ###
|
||||
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
|
||||
log4j.appender.stdout.Target=System.out
|
||||
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
|
||||
log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
|
||||
|
||||
# set root logger level to debug and its only appender to mtf
|
||||
log4j.rootLogger=INFO,development
|
||||
|
||||
# only for development purposes
|
||||
log4j.appender.development=org.apache.log4j.ConsoleAppender
|
||||
log4j.appender.development.layout=org.apache.log4j.PatternLayout
|
||||
log4j.appender.development.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %5p [%t] (%F:%L) - %m%n
|
||||
|
||||
log4j.logger.noModule=FATAL
|
||||
log4j.logger.org.springframework=WARN
|
||||
|
||||
# Log JDBC bind parameter runtime arguments
|
||||
log4j.logger.org.hibernate.type=DEBUG
|
||||
@@ -0,0 +1,60 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns="http://java.sun.com/xml/ns/javaee"
|
||||
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
|
||||
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
|
||||
id="WebApp_ID" version="2.5">
|
||||
|
||||
<display-name>Todo List</display-name>
|
||||
|
||||
<context-param>
|
||||
<param-name>contextConfigLocation</param-name>
|
||||
<param-value>/WEB-INF/applicationContext.xml</param-value>
|
||||
</context-param>
|
||||
|
||||
<listener>
|
||||
<listener-class>
|
||||
org.springframework.web.context.ContextLoaderListener
|
||||
</listener-class>
|
||||
</listener>
|
||||
<listener>
|
||||
<listener-class>
|
||||
org.springframework.web.context.request.RequestContextListener
|
||||
</listener-class>
|
||||
</listener>
|
||||
|
||||
<context-param>
|
||||
<param-name>flex.class.path</param-name>
|
||||
<param-value>/WEB-INF/flex/hotfixes</param-value>
|
||||
</context-param>
|
||||
|
||||
<!-- MessageBroker Servlet -->
|
||||
<servlet>
|
||||
<servlet-name>MessageBrokerServlet</servlet-name>
|
||||
<servlet-class>
|
||||
flex.messaging.MessageBrokerServlet
|
||||
</servlet-class>
|
||||
<init-param>
|
||||
<param-name>services.configuration.file</param-name>
|
||||
<param-value>/WEB-INF/flex/services-config.xml</param-value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<param-name>flex.write.path</param-name>
|
||||
<param-value>/WEB-INF/flex</param-value>
|
||||
</init-param>
|
||||
<load-on-startup>1</load-on-startup>
|
||||
</servlet>
|
||||
|
||||
<servlet-mapping>
|
||||
<servlet-name>MessageBrokerServlet</servlet-name>
|
||||
<url-pattern>/messagebroker/*</url-pattern>
|
||||
</servlet-mapping>
|
||||
|
||||
|
||||
<welcome-file-list>
|
||||
<welcome-file>index.html</welcome-file>
|
||||
<welcome-file>index.htm</welcome-file>
|
||||
<welcome-file>index.jsp</welcome-file>
|
||||
</welcome-file-list>
|
||||
|
||||
</web-app>
|
||||
@@ -0,0 +1,6 @@
|
||||
/* This CSS stylesheet defines styles used by required elements in a flex application page that supports browser history */
|
||||
|
||||
#ie_historyFrame { width: 0px; height: 0px; display:none }
|
||||
#firefox_anchorDiv { width: 0px; height: 0px; display:none }
|
||||
#safari_formDiv { width: 0px; height: 0px; display:none }
|
||||
#safari_rememberDiv { width: 0px; height: 0px; display:none }
|
||||
@@ -0,0 +1,645 @@
|
||||
BrowserHistoryUtils = {
|
||||
addEvent: function(elm, evType, fn, useCapture) {
|
||||
useCapture = useCapture || false;
|
||||
if (elm.addEventListener) {
|
||||
elm.addEventListener(evType, fn, useCapture);
|
||||
return true;
|
||||
}
|
||||
else if (elm.attachEvent) {
|
||||
var r = elm.attachEvent('on' + evType, fn);
|
||||
return r;
|
||||
}
|
||||
else {
|
||||
elm['on' + evType] = fn;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BrowserHistory = (function() {
|
||||
// type of browser
|
||||
var browser = {
|
||||
ie: false,
|
||||
firefox: false,
|
||||
safari: false,
|
||||
opera: false,
|
||||
version: -1
|
||||
};
|
||||
|
||||
// if setDefaultURL has been called, our first clue
|
||||
// that the SWF is ready and listening
|
||||
//var swfReady = false;
|
||||
|
||||
// the URL we'll send to the SWF once it is ready
|
||||
//var pendingURL = '';
|
||||
|
||||
// Default app state URL to use when no fragment ID present
|
||||
var defaultHash = '';
|
||||
|
||||
// Last-known app state URL
|
||||
var currentHref = document.location.href;
|
||||
|
||||
// Initial URL (used only by IE)
|
||||
var initialHref = document.location.href;
|
||||
|
||||
// Initial URL (used only by IE)
|
||||
var initialHash = document.location.hash;
|
||||
|
||||
// History frame source URL prefix (used only by IE)
|
||||
var historyFrameSourcePrefix = 'history/historyFrame.html?';
|
||||
|
||||
// History maintenance (used only by Safari)
|
||||
var currentHistoryLength = -1;
|
||||
|
||||
var historyHash = [];
|
||||
|
||||
var initialState = createState(initialHref, initialHref + '#' + initialHash, initialHash);
|
||||
|
||||
var backStack = [];
|
||||
var forwardStack = [];
|
||||
|
||||
var currentObjectId = null;
|
||||
|
||||
//UserAgent detection
|
||||
var useragent = navigator.userAgent.toLowerCase();
|
||||
|
||||
if (useragent.indexOf("opera") != -1) {
|
||||
browser.opera = true;
|
||||
} else if (useragent.indexOf("msie") != -1) {
|
||||
browser.ie = true;
|
||||
browser.version = parseFloat(useragent.substring(useragent.indexOf('msie') + 4));
|
||||
} else if (useragent.indexOf("safari") != -1) {
|
||||
browser.safari = true;
|
||||
browser.version = parseFloat(useragent.substring(useragent.indexOf('safari') + 7));
|
||||
} else if (useragent.indexOf("gecko") != -1) {
|
||||
browser.firefox = true;
|
||||
}
|
||||
|
||||
if (browser.ie == true && browser.version == 7) {
|
||||
window["_ie_firstload"] = false;
|
||||
}
|
||||
|
||||
// Accessor functions for obtaining specific elements of the page.
|
||||
function getHistoryFrame()
|
||||
{
|
||||
return document.getElementById('ie_historyFrame');
|
||||
}
|
||||
|
||||
function getAnchorElement()
|
||||
{
|
||||
return document.getElementById('firefox_anchorDiv');
|
||||
}
|
||||
|
||||
function getFormElement()
|
||||
{
|
||||
return document.getElementById('safari_formDiv');
|
||||
}
|
||||
|
||||
function getRememberElement()
|
||||
{
|
||||
return document.getElementById("safari_remember_field");
|
||||
}
|
||||
|
||||
/* Get the Flash player object for performing ExternalInterface callbacks. */
|
||||
function getPlayer(objectId) {
|
||||
var objectId = objectId || null;
|
||||
var player = null; /* AJH, needed? = document.getElementById(getPlayerId()); */
|
||||
if (browser.ie && objectId != null) {
|
||||
player = document.getElementById(objectId);
|
||||
}
|
||||
if (player == null) {
|
||||
player = document.getElementsByTagName('object')[0];
|
||||
}
|
||||
|
||||
if (player == null || player.object == null) {
|
||||
player = document.getElementsByTagName('embed')[0];
|
||||
}
|
||||
|
||||
return player;
|
||||
}
|
||||
|
||||
function getPlayers() {
|
||||
var players = [];
|
||||
if (players.length == 0) {
|
||||
var tmp = document.getElementsByTagName('object');
|
||||
players = tmp;
|
||||
}
|
||||
|
||||
if (players.length == 0 || players[0].object == null) {
|
||||
var tmp = document.getElementsByTagName('embed');
|
||||
players = tmp;
|
||||
}
|
||||
return players;
|
||||
}
|
||||
|
||||
function getIframeHash() {
|
||||
var doc = getHistoryFrame().contentWindow.document;
|
||||
var hash = String(doc.location.search);
|
||||
if (hash.length == 1 && hash.charAt(0) == "?") {
|
||||
hash = "";
|
||||
}
|
||||
else if (hash.length >= 2 && hash.charAt(0) == "?") {
|
||||
hash = hash.substring(1);
|
||||
}
|
||||
return hash;
|
||||
}
|
||||
|
||||
/* Get the current location hash excluding the '#' symbol. */
|
||||
function getHash() {
|
||||
// It would be nice if we could use document.location.hash here,
|
||||
// but it's faulty sometimes.
|
||||
var idx = document.location.href.indexOf('#');
|
||||
return (idx >= 0) ? document.location.href.substr(idx+1) : '';
|
||||
}
|
||||
|
||||
/* Get the current location hash excluding the '#' symbol. */
|
||||
function setHash(hash) {
|
||||
// It would be nice if we could use document.location.hash here,
|
||||
// but it's faulty sometimes.
|
||||
if (hash == '') hash = '#'
|
||||
document.location.hash = hash;
|
||||
}
|
||||
|
||||
function createState(baseUrl, newUrl, flexAppUrl) {
|
||||
return { 'baseUrl': baseUrl, 'newUrl': newUrl, 'flexAppUrl': flexAppUrl, 'title': null };
|
||||
}
|
||||
|
||||
/* Add a history entry to the browser.
|
||||
* baseUrl: the portion of the location prior to the '#'
|
||||
* newUrl: the entire new URL, including '#' and following fragment
|
||||
* flexAppUrl: the portion of the location following the '#' only
|
||||
*/
|
||||
function addHistoryEntry(baseUrl, newUrl, flexAppUrl) {
|
||||
|
||||
//delete all the history entries
|
||||
forwardStack = [];
|
||||
|
||||
if (browser.ie) {
|
||||
//Check to see if we are being asked to do a navigate for the first
|
||||
//history entry, and if so ignore, because it's coming from the creation
|
||||
//of the history iframe
|
||||
if (flexAppUrl == defaultHash && document.location.href == initialHref && window['_ie_firstload']) {
|
||||
currentHref = initialHref;
|
||||
return;
|
||||
}
|
||||
if ((!flexAppUrl || flexAppUrl == defaultHash) && window['_ie_firstload']) {
|
||||
newUrl = baseUrl + '#' + defaultHash;
|
||||
flexAppUrl = defaultHash;
|
||||
} else {
|
||||
// for IE, tell the history frame to go somewhere without a '#'
|
||||
// in order to get this entry into the browser history.
|
||||
getHistoryFrame().src = historyFrameSourcePrefix + flexAppUrl;
|
||||
}
|
||||
setHash(flexAppUrl);
|
||||
} else {
|
||||
|
||||
//ADR
|
||||
if (backStack.length == 0 && initialState.flexAppUrl == flexAppUrl) {
|
||||
initialState = createState(baseUrl, newUrl, flexAppUrl);
|
||||
} else if(backStack.length > 0 && backStack[backStack.length - 1].flexAppUrl == flexAppUrl) {
|
||||
backStack[backStack.length - 1] = createState(baseUrl, newUrl, flexAppUrl);
|
||||
}
|
||||
|
||||
if (browser.safari) {
|
||||
// for Safari, submit a form whose action points to the desired URL
|
||||
if (browser.version <= 419.3) {
|
||||
var file = window.location.pathname.toString();
|
||||
file = file.substring(file.lastIndexOf("/")+1);
|
||||
getFormElement().innerHTML = '<form name="historyForm" action="'+file+'#' + flexAppUrl + '" method="GET"></form>';
|
||||
//get the current elements and add them to the form
|
||||
var qs = window.location.search.substring(1);
|
||||
var qs_arr = qs.split("&");
|
||||
for (var i = 0; i < qs_arr.length; i++) {
|
||||
var tmp = qs_arr[i].split("=");
|
||||
var elem = document.createElement("input");
|
||||
elem.type = "hidden";
|
||||
elem.name = tmp[0];
|
||||
elem.value = tmp[1];
|
||||
document.forms.historyForm.appendChild(elem);
|
||||
}
|
||||
document.forms.historyForm.submit();
|
||||
} else {
|
||||
top.location.hash = flexAppUrl;
|
||||
}
|
||||
// We also have to maintain the history by hand for Safari
|
||||
historyHash[history.length] = flexAppUrl;
|
||||
_storeStates();
|
||||
} else {
|
||||
// Otherwise, write an anchor into the page and tell the browser to go there
|
||||
addAnchor(flexAppUrl);
|
||||
setHash(flexAppUrl);
|
||||
}
|
||||
}
|
||||
backStack.push(createState(baseUrl, newUrl, flexAppUrl));
|
||||
}
|
||||
|
||||
function _storeStates() {
|
||||
if (browser.safari) {
|
||||
getRememberElement().value = historyHash.join(",");
|
||||
}
|
||||
}
|
||||
|
||||
function handleBackButton() {
|
||||
//The "current" page is always at the top of the history stack.
|
||||
var current = backStack.pop();
|
||||
if (!current) { return; }
|
||||
var last = backStack[backStack.length - 1];
|
||||
if (!last && backStack.length == 0){
|
||||
last = initialState;
|
||||
}
|
||||
forwardStack.push(current);
|
||||
}
|
||||
|
||||
function handleForwardButton() {
|
||||
//summary: private method. Do not call this directly.
|
||||
|
||||
var last = forwardStack.pop();
|
||||
if (!last) { return; }
|
||||
backStack.push(last);
|
||||
}
|
||||
|
||||
function handleArbitraryUrl() {
|
||||
//delete all the history entries
|
||||
forwardStack = [];
|
||||
}
|
||||
|
||||
/* Called periodically to poll to see if we need to detect navigation that has occurred */
|
||||
function checkForUrlChange() {
|
||||
|
||||
if (browser.ie) {
|
||||
if (currentHref != document.location.href && currentHref + '#' != document.location.href) {
|
||||
//This occurs when the user has navigated to a specific URL
|
||||
//within the app, and didn't use browser back/forward
|
||||
//IE seems to have a bug where it stops updating the URL it
|
||||
//shows the end-user at this point, but programatically it
|
||||
//appears to be correct. Do a full app reload to get around
|
||||
//this issue.
|
||||
if (browser.version < 7) {
|
||||
currentHref = document.location.href;
|
||||
document.location.reload();
|
||||
} else {
|
||||
if (getHash() != getIframeHash()) {
|
||||
// this.iframe.src = this.blankURL + hash;
|
||||
var sourceToSet = historyFrameSourcePrefix + getHash();
|
||||
getHistoryFrame().src = sourceToSet;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (browser.safari) {
|
||||
// For Safari, we have to check to see if history.length changed.
|
||||
if (currentHistoryLength >= 0 && history.length != currentHistoryLength) {
|
||||
//alert("did change: " + history.length + ", " + historyHash.length + "|" + historyHash[history.length] + "|>" + historyHash.join("|"));
|
||||
// If it did change, then we have to look the old state up
|
||||
// in our hand-maintained array since document.location.hash
|
||||
// won't have changed, then call back into BrowserManager.
|
||||
currentHistoryLength = history.length;
|
||||
var flexAppUrl = historyHash[currentHistoryLength];
|
||||
if (flexAppUrl == '') {
|
||||
//flexAppUrl = defaultHash;
|
||||
}
|
||||
//ADR: to fix multiple
|
||||
if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
|
||||
var pl = getPlayers();
|
||||
for (var i = 0; i < pl.length; i++) {
|
||||
pl[i].browserURLChange(flexAppUrl);
|
||||
}
|
||||
} else {
|
||||
getPlayer().browserURLChange(flexAppUrl);
|
||||
}
|
||||
_storeStates();
|
||||
}
|
||||
}
|
||||
if (browser.firefox) {
|
||||
if (currentHref != document.location.href) {
|
||||
var bsl = backStack.length;
|
||||
|
||||
var urlActions = {
|
||||
back: false,
|
||||
forward: false,
|
||||
set: false
|
||||
}
|
||||
|
||||
if ((window.location.hash == initialHash || window.location.href == initialHref) && (bsl == 1)) {
|
||||
urlActions.back = true;
|
||||
// FIXME: could this ever be a forward button?
|
||||
// we can't clear it because we still need to check for forwards. Ugg.
|
||||
// clearInterval(this.locationTimer);
|
||||
handleBackButton();
|
||||
}
|
||||
|
||||
// first check to see if we could have gone forward. We always halt on
|
||||
// a no-hash item.
|
||||
if (forwardStack.length > 0) {
|
||||
if (forwardStack[forwardStack.length-1].flexAppUrl == getHash()) {
|
||||
urlActions.forward = true;
|
||||
handleForwardButton();
|
||||
}
|
||||
}
|
||||
|
||||
// ok, that didn't work, try someplace back in the history stack
|
||||
if ((bsl >= 2) && (backStack[bsl - 2])) {
|
||||
if (backStack[bsl - 2].flexAppUrl == getHash()) {
|
||||
urlActions.back = true;
|
||||
handleBackButton();
|
||||
}
|
||||
}
|
||||
|
||||
if (!urlActions.back && !urlActions.forward) {
|
||||
var foundInStacks = {
|
||||
back: -1,
|
||||
forward: -1
|
||||
}
|
||||
|
||||
for (var i = 0; i < backStack.length; i++) {
|
||||
if (backStack[i].flexAppUrl == getHash() && i != (bsl - 2)) {
|
||||
arbitraryUrl = true;
|
||||
foundInStacks.back = i;
|
||||
}
|
||||
}
|
||||
for (var i = 0; i < forwardStack.length; i++) {
|
||||
if (forwardStack[i].flexAppUrl == getHash() && i != (bsl - 2)) {
|
||||
arbitraryUrl = true;
|
||||
foundInStacks.forward = i;
|
||||
}
|
||||
}
|
||||
handleArbitraryUrl();
|
||||
}
|
||||
|
||||
// Firefox changed; do a callback into BrowserManager to tell it.
|
||||
currentHref = document.location.href;
|
||||
var flexAppUrl = getHash();
|
||||
if (flexAppUrl == '') {
|
||||
//flexAppUrl = defaultHash;
|
||||
}
|
||||
//ADR: to fix multiple
|
||||
if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
|
||||
var pl = getPlayers();
|
||||
for (var i = 0; i < pl.length; i++) {
|
||||
pl[i].browserURLChange(flexAppUrl);
|
||||
}
|
||||
} else {
|
||||
getPlayer().browserURLChange(flexAppUrl);
|
||||
}
|
||||
}
|
||||
}
|
||||
//setTimeout(checkForUrlChange, 50);
|
||||
}
|
||||
|
||||
/* Write an anchor into the page to legitimize it as a URL for Firefox et al. */
|
||||
function addAnchor(flexAppUrl)
|
||||
{
|
||||
if (document.getElementsByName(flexAppUrl).length == 0) {
|
||||
getAnchorElement().innerHTML += "<a name='" + flexAppUrl + "'>" + flexAppUrl + "</a>";
|
||||
}
|
||||
}
|
||||
|
||||
var _initialize = function () {
|
||||
if (browser.ie)
|
||||
{
|
||||
var scripts = document.getElementsByTagName('script');
|
||||
for (var i = 0, s; s = scripts[i]; i++) {
|
||||
if (s.src.indexOf("history.js") > -1) {
|
||||
var iframe_location = (new String(s.src)).replace("history.js", "historyFrame.html");
|
||||
}
|
||||
}
|
||||
historyFrameSourcePrefix = iframe_location + "?";
|
||||
var src = historyFrameSourcePrefix;
|
||||
|
||||
var iframe = document.createElement("iframe");
|
||||
iframe.id = 'ie_historyFrame';
|
||||
iframe.name = 'ie_historyFrame';
|
||||
//iframe.src = historyFrameSourcePrefix;
|
||||
try {
|
||||
document.body.appendChild(iframe);
|
||||
} catch(e) {
|
||||
setTimeout(function() {
|
||||
document.body.appendChild(iframe);
|
||||
}, 0);
|
||||
}
|
||||
}
|
||||
|
||||
if (browser.safari)
|
||||
{
|
||||
var rememberDiv = document.createElement("div");
|
||||
rememberDiv.id = 'safari_rememberDiv';
|
||||
document.body.appendChild(rememberDiv);
|
||||
rememberDiv.innerHTML = '<input type="text" id="safari_remember_field" style="width: 500px;">';
|
||||
|
||||
var formDiv = document.createElement("div");
|
||||
formDiv.id = 'safari_formDiv';
|
||||
document.body.appendChild(formDiv);
|
||||
|
||||
var reloader_content = document.createElement('div');
|
||||
reloader_content.id = 'safarireloader';
|
||||
var scripts = document.getElementsByTagName('script');
|
||||
for (var i = 0, s; s = scripts[i]; i++) {
|
||||
if (s.src.indexOf("history.js") > -1) {
|
||||
html = (new String(s.src)).replace(".js", ".html");
|
||||
}
|
||||
}
|
||||
reloader_content.innerHTML = '<iframe id="safarireloader-iframe" src="about:blank" frameborder="no" scrolling="no"></iframe>';
|
||||
document.body.appendChild(reloader_content);
|
||||
reloader_content.style.position = 'absolute';
|
||||
reloader_content.style.left = reloader_content.style.top = '-9999px';
|
||||
iframe = reloader_content.getElementsByTagName('iframe')[0];
|
||||
|
||||
if (document.getElementById("safari_remember_field").value != "" ) {
|
||||
historyHash = document.getElementById("safari_remember_field").value.split(",");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (browser.firefox)
|
||||
{
|
||||
var anchorDiv = document.createElement("div");
|
||||
anchorDiv.id = 'firefox_anchorDiv';
|
||||
document.body.appendChild(anchorDiv);
|
||||
}
|
||||
|
||||
//setTimeout(checkForUrlChange, 50);
|
||||
}
|
||||
|
||||
return {
|
||||
historyHash: historyHash,
|
||||
backStack: function() { return backStack; },
|
||||
forwardStack: function() { return forwardStack },
|
||||
getPlayer: getPlayer,
|
||||
initialize: function(src) {
|
||||
_initialize(src);
|
||||
},
|
||||
setURL: function(url) {
|
||||
document.location.href = url;
|
||||
},
|
||||
getURL: function() {
|
||||
return document.location.href;
|
||||
},
|
||||
getTitle: function() {
|
||||
return document.title;
|
||||
},
|
||||
setTitle: function(title) {
|
||||
try {
|
||||
backStack[backStack.length - 1].title = title;
|
||||
} catch(e) { }
|
||||
//if on safari, set the title to be the empty string.
|
||||
if (browser.safari) {
|
||||
if (title == "") {
|
||||
try {
|
||||
var tmp = window.location.href.toString();
|
||||
title = tmp.substring((tmp.lastIndexOf("/")+1), tmp.lastIndexOf("#"));
|
||||
} catch(e) {
|
||||
title = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
document.title = title;
|
||||
},
|
||||
setDefaultURL: function(def)
|
||||
{
|
||||
defaultHash = def;
|
||||
def = getHash();
|
||||
//trailing ? is important else an extra frame gets added to the history
|
||||
//when navigating back to the first page. Alternatively could check
|
||||
//in history frame navigation to compare # and ?.
|
||||
if (browser.ie)
|
||||
{
|
||||
window['_ie_firstload'] = true;
|
||||
var sourceToSet = historyFrameSourcePrefix + def;
|
||||
var func = function() {
|
||||
getHistoryFrame().src = sourceToSet;
|
||||
window.location.replace("#" + def);
|
||||
setInterval(checkForUrlChange, 50);
|
||||
}
|
||||
try {
|
||||
func();
|
||||
} catch(e) {
|
||||
window.setTimeout(function() { func(); }, 0);
|
||||
}
|
||||
}
|
||||
|
||||
if (browser.safari)
|
||||
{
|
||||
currentHistoryLength = history.length;
|
||||
if (historyHash.length == 0) {
|
||||
historyHash[currentHistoryLength] = def;
|
||||
var newloc = "#" + def;
|
||||
window.location.replace(newloc);
|
||||
} else {
|
||||
//alert(historyHash[historyHash.length-1]);
|
||||
}
|
||||
//setHash(def);
|
||||
setInterval(checkForUrlChange, 50);
|
||||
}
|
||||
|
||||
|
||||
if (browser.firefox || browser.opera)
|
||||
{
|
||||
var reg = new RegExp("#" + def + "$");
|
||||
if (window.location.toString().match(reg)) {
|
||||
} else {
|
||||
var newloc ="#" + def;
|
||||
window.location.replace(newloc);
|
||||
}
|
||||
setInterval(checkForUrlChange, 50);
|
||||
//setHash(def);
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
/* Set the current browser URL; called from inside BrowserManager to propagate
|
||||
* the application state out to the container.
|
||||
*/
|
||||
setBrowserURL: function(flexAppUrl, objectId) {
|
||||
if (browser.ie && typeof objectId != "undefined") {
|
||||
currentObjectId = objectId;
|
||||
}
|
||||
//fromIframe = fromIframe || false;
|
||||
//fromFlex = fromFlex || false;
|
||||
//alert("setBrowserURL: " + flexAppUrl);
|
||||
//flexAppUrl = (flexAppUrl == "") ? defaultHash : flexAppUrl ;
|
||||
|
||||
var pos = document.location.href.indexOf('#');
|
||||
var baseUrl = pos != -1 ? document.location.href.substr(0, pos) : document.location.href;
|
||||
var newUrl = baseUrl + '#' + flexAppUrl;
|
||||
|
||||
if (document.location.href != newUrl && document.location.href + '#' != newUrl) {
|
||||
currentHref = newUrl;
|
||||
addHistoryEntry(baseUrl, newUrl, flexAppUrl);
|
||||
currentHistoryLength = history.length;
|
||||
}
|
||||
|
||||
return false;
|
||||
},
|
||||
|
||||
browserURLChange: function(flexAppUrl) {
|
||||
var objectId = null;
|
||||
if (browser.ie && currentObjectId != null) {
|
||||
objectId = currentObjectId;
|
||||
}
|
||||
pendingURL = '';
|
||||
|
||||
if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
|
||||
var pl = getPlayers();
|
||||
for (var i = 0; i < pl.length; i++) {
|
||||
try {
|
||||
pl[i].browserURLChange(flexAppUrl);
|
||||
} catch(e) { }
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
getPlayer(objectId).browserURLChange(flexAppUrl);
|
||||
} catch(e) { }
|
||||
}
|
||||
|
||||
currentObjectId = null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
})();
|
||||
|
||||
// Initialization
|
||||
|
||||
// Automated unit testing and other diagnostics
|
||||
|
||||
function setURL(url)
|
||||
{
|
||||
document.location.href = url;
|
||||
}
|
||||
|
||||
function backButton()
|
||||
{
|
||||
history.back();
|
||||
}
|
||||
|
||||
function forwardButton()
|
||||
{
|
||||
history.forward();
|
||||
}
|
||||
|
||||
function goForwardOrBackInHistory(step)
|
||||
{
|
||||
history.go(step);
|
||||
}
|
||||
|
||||
//BrowserHistoryUtils.addEvent(window, "load", function() { BrowserHistory.initialize(); });
|
||||
(function(i) {
|
||||
var u =navigator.userAgent;var e=/*@cc_on!@*/false;
|
||||
var st = setTimeout;
|
||||
if(/webkit/i.test(u)){
|
||||
st(function(){
|
||||
var dr=document.readyState;
|
||||
if(dr=="loaded"||dr=="complete"){i()}
|
||||
else{st(arguments.callee,10);}},10);
|
||||
} else if((/mozilla/i.test(u)&&!/(compati)/.test(u)) || (/opera/i.test(u))){
|
||||
document.addEventListener("DOMContentLoaded",i,false);
|
||||
} else if(e){
|
||||
(function(){
|
||||
var t=document.createElement('doc:rdy');
|
||||
try{t.doScroll('left');
|
||||
i();t=null;
|
||||
}catch(e){st(arguments.callee,0);}})();
|
||||
} else{
|
||||
window.onload=i;
|
||||
}
|
||||
})( function() {BrowserHistory.initialize();} );
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
<html>
|
||||
<head>
|
||||
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
|
||||
<META HTTP-EQUIV="Expires" CONTENT="-1">
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
function processUrl()
|
||||
{
|
||||
|
||||
var pos = url.indexOf("?");
|
||||
url = pos != -1 ? url.substr(pos + 1) : "";
|
||||
if (!parent._ie_firstload) {
|
||||
parent.BrowserHistory.setBrowserURL(url);
|
||||
try {
|
||||
parent.BrowserHistory.browserURLChange(url);
|
||||
} catch(e) { }
|
||||
} else {
|
||||
parent._ie_firstload = false;
|
||||
}
|
||||
}
|
||||
|
||||
var url = document.location.href;
|
||||
processUrl();
|
||||
document.write(url);
|
||||
</script>
|
||||
Hidden frame for Browser History support.
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,113 @@
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||
|
||||
<!-- BEGIN Browser History required section -->
|
||||
<link rel="stylesheet" type="text/css" href="history/history.css"/>
|
||||
<!-- END Browser History required section -->
|
||||
|
||||
<title>Todo List</title>
|
||||
<script src="AC_OETags.js" language="javascript"></script>
|
||||
|
||||
<!-- BEGIN Browser History required section -->
|
||||
<script src="history/history.js" language="javascript"></script>
|
||||
<!-- END Browser History required section -->
|
||||
|
||||
<style>
|
||||
body {
|
||||
margin: 0px;
|
||||
overflow: hidden
|
||||
}
|
||||
</style>
|
||||
<script language="JavaScript" type="text/javascript">
|
||||
<!--
|
||||
// -----------------------------------------------------------------------------
|
||||
// Globals
|
||||
// Major version of Flash required
|
||||
var requiredMajorVersion = 9;
|
||||
// Minor version of Flash required
|
||||
var requiredMinorVersion = 0;
|
||||
// Minor version of Flash required
|
||||
var requiredRevision = 28;
|
||||
// -----------------------------------------------------------------------------
|
||||
// -->
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body scroll="no">
|
||||
<script language="JavaScript" type="text/javascript">
|
||||
<!--
|
||||
// Version check for the Flash Player that has the ability to start Player Product Install (6.0r65)
|
||||
var hasProductInstall = DetectFlashVer(6, 0, 65);
|
||||
|
||||
// Version check based upon the values defined in globals
|
||||
var hasRequestedVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
|
||||
|
||||
if (hasProductInstall && !hasRequestedVersion) {
|
||||
// DO NOT MODIFY THE FOLLOWING FOUR LINES
|
||||
// Location visited after installation is complete if installation is required
|
||||
var MMPlayerType = (isIE == true) ? "ActiveX" : "PlugIn";
|
||||
var MMredirectURL = window.location;
|
||||
document.title = document.title.slice(0, 47) + " - Flash Player Installation";
|
||||
var MMdoctitle = document.title;
|
||||
|
||||
AC_FL_RunContent(
|
||||
"src", "playerProductInstall",
|
||||
"FlashVars", "MMredirectURL=" + MMredirectURL + '&MMplayerType=' + MMPlayerType + '&MMdoctitle=' + MMdoctitle + "",
|
||||
"width", "100%",
|
||||
"height", "100%",
|
||||
"align", "middle",
|
||||
"id", "index",
|
||||
"quality", "high",
|
||||
"bgcolor", "#869ca7",
|
||||
"name", "index",
|
||||
"allowScriptAccess", "sameDomain",
|
||||
"type", "application/x-shockwave-flash",
|
||||
"pluginspage", "http://www.adobe.com/go/getflashplayer"
|
||||
);
|
||||
} else if (hasRequestedVersion) {
|
||||
// if we've detected an acceptable version
|
||||
// embed the Flash Content SWF when all tests are passed
|
||||
AC_FL_RunContent(
|
||||
"src", "todolist-ria-1.0-SNAPSHOT",
|
||||
"width", "100%",
|
||||
"height", "100%",
|
||||
"align", "middle",
|
||||
"id", "todolist-ria-1.0-SNAPSHOT",
|
||||
"quality", "high",
|
||||
"bgcolor", "#869ca7",
|
||||
"name", "todolist-ria-1.0-SNAPSHOT",
|
||||
"allowScriptAccess", "sameDomain",
|
||||
"type", "application/x-shockwave-flash",
|
||||
"pluginspage", "http://www.adobe.com/go/getflashplayer"
|
||||
);
|
||||
} else { // flash is too old or we can't detect the plugin
|
||||
var alternateContent = 'Alternate HTML content should be placed here. '
|
||||
+ 'This content requires the Adobe Flash Player. '
|
||||
+ '<a href=http://www.adobe.com/go/getflash/>Get Flash</a>';
|
||||
document.write(alternateContent); // insert non-flash content
|
||||
}
|
||||
// -->
|
||||
</script>
|
||||
<noscript>
|
||||
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
|
||||
id="index" width="100%" height="100%"
|
||||
codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab">
|
||||
<param name="movie" value="index.swf"/>
|
||||
<param name="quality" value="high"/>
|
||||
<param name="bgcolor" value="#869ca7"/>
|
||||
<param name="allowScriptAccess" value="sameDomain"/>
|
||||
<embed src="todolist-ria-1.0-SNAPSHOT.swf" quality="high" bgcolor="#869ca7"
|
||||
width="100%" height="100%" name="index" align="middle"
|
||||
play="true"
|
||||
loop="false"
|
||||
quality="high"
|
||||
allowScriptAccess="sameDomain"
|
||||
type="application/x-shockwave-flash"
|
||||
pluginspage="http://www.adobe.com/go/getflashplayer">
|
||||
</embed>
|
||||
</object>
|
||||
</noscript>
|
||||
</body>
|
||||
</html>
|
||||
BIN
Binary file not shown.
@@ -0,0 +1,73 @@
|
||||
<?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/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>net.aimeizi</groupId>
|
||||
<artifactId>maven-framework-project</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</parent>
|
||||
<artifactId>flex-todolist-example</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<modules>
|
||||
<module>flex-todolist-ria-example</module>
|
||||
<module>flex-todolist-web-example</module>
|
||||
<module>flex-todolist-config-example</module>
|
||||
</modules>
|
||||
|
||||
<build>
|
||||
<pluginManagement>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<version>2.0</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<version>2.2-beta-2</version>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
</build>
|
||||
|
||||
<repositories>
|
||||
|
||||
<repository>
|
||||
<id>flex-mojos</id>
|
||||
<url>http://josephj.com/lab/flex-mojos/flex-mojos-read-only/repository/</url>
|
||||
<releases>
|
||||
<enabled>true</enabled>
|
||||
</releases>
|
||||
<snapshots>
|
||||
<enabled>false</enabled>
|
||||
</snapshots>
|
||||
</repository>
|
||||
|
||||
</repositories>
|
||||
|
||||
<pluginRepositories>
|
||||
<pluginRepository>
|
||||
<id>flex-mojos-repository</id>
|
||||
<url>http://flex-mojos.googlecode.com/svn/trunk/repository/</url>
|
||||
<releases>
|
||||
<enabled>true</enabled>
|
||||
</releases>
|
||||
<snapshots>
|
||||
<enabled>false</enabled>
|
||||
</snapshots>
|
||||
</pluginRepository>
|
||||
|
||||
<pluginRepository>
|
||||
<id>flex-mojos</id>
|
||||
<url>http://josephj.com/lab/flex-mojos/flex-mojos-read-only/repository/</url>
|
||||
<releases>
|
||||
<enabled>true</enabled>
|
||||
</releases>
|
||||
<snapshots>
|
||||
<enabled>false</enabled>
|
||||
</snapshots>
|
||||
</pluginRepository>
|
||||
</pluginRepositories>
|
||||
|
||||
</project>
|
||||
Binary file not shown.
@@ -24,6 +24,8 @@
|
||||
<module>resteasy-ws-example</module>
|
||||
<module>cxf-soap-ws</module>
|
||||
<module>cxf-rest-ws</module>
|
||||
<module>flex-todolist-example</module>
|
||||
<module>spring-flex-testdrive</module>
|
||||
</modules>
|
||||
|
||||
<build>
|
||||
|
||||
+402
@@ -0,0 +1,402 @@
|
||||
<?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.
|
||||
-->
|
||||
|
||||
<!--
|
||||
| This is the configuration file for Maven. It can be specified at two levels:
|
||||
|
|
||||
| 1. User Level. This settings.xml file provides configuration for a single user,
|
||||
| and is normally provided in ${user.home}/.m2/settings.xml.
|
||||
|
|
||||
| NOTE: This location can be overridden with the CLI option:
|
||||
|
|
||||
| -s /path/to/user/settings.xml
|
||||
|
|
||||
| 2. Global Level. This settings.xml file provides configuration for all Maven
|
||||
| users on a machine (assuming they're all using the same Maven
|
||||
| installation). It's normally provided in
|
||||
| ${maven.home}/conf/settings.xml.
|
||||
|
|
||||
| NOTE: This location can be overridden with the CLI option:
|
||||
|
|
||||
| -gs /path/to/global/settings.xml
|
||||
|
|
||||
| The sections in this sample file are intended to give you a running start at
|
||||
| getting the most out of your Maven installation. Where appropriate, the default
|
||||
| values (values used when the setting is not specified) are provided.
|
||||
|
|
||||
|-->
|
||||
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
|
||||
<!-- localRepository
|
||||
| The path to the local repository maven will use to store artifacts.
|
||||
|
|
||||
| Default: ~/.m2/repository
|
||||
<localRepository>/path/to/local/repo</localRepository>
|
||||
-->
|
||||
<localRepository>D:/developer/.m2/repository</localRepository>
|
||||
<!-- interactiveMode
|
||||
| This will determine whether maven prompts you when it needs input. If set to false,
|
||||
| maven will use a sensible default value, perhaps based on some other setting, for
|
||||
| the parameter in question.
|
||||
|
|
||||
| Default: true
|
||||
<interactiveMode>true</interactiveMode>
|
||||
-->
|
||||
|
||||
<!-- offline
|
||||
| Determines whether maven should attempt to connect to the network when executing a build.
|
||||
| This will have an effect on artifact downloads, artifact deployment, and others.
|
||||
|
|
||||
| Default: false
|
||||
<offline>false</offline>
|
||||
-->
|
||||
|
||||
<!-- pluginGroups
|
||||
| This is a list of additional group identifiers that will be searched when resolving plugins by their prefix, i.e.
|
||||
| when invoking a command line like "mvn prefix:goal". Maven will automatically add the group identifiers
|
||||
| "org.apache.maven.plugins" and "org.codehaus.mojo" if these are not already contained in the list.
|
||||
|-->
|
||||
<pluginGroups>
|
||||
<!-- pluginGroup
|
||||
| Specifies a further group identifier to use for plugin lookup.
|
||||
<pluginGroup>com.your.plugins</pluginGroup>
|
||||
-->
|
||||
</pluginGroups>
|
||||
|
||||
<!-- proxies
|
||||
| This is a list of proxies which can be used on this machine to connect to the network.
|
||||
| Unless otherwise specified (by system property or command-line switch), the first proxy
|
||||
| specification in this list marked as active will be used.
|
||||
|-->
|
||||
<proxies>
|
||||
<!-- proxy
|
||||
| Specification for one proxy, to be used in connecting to the network.
|
||||
|
|
||||
<proxy>
|
||||
<id>optional</id>
|
||||
<active>true</active>
|
||||
<protocol>http</protocol>
|
||||
<username>proxyuser</username>
|
||||
<password>proxypass</password>
|
||||
<host>proxy.host.net</host>
|
||||
<port>80</port>
|
||||
<nonProxyHosts>local.net|some.host.com</nonProxyHosts>
|
||||
</proxy>
|
||||
-->
|
||||
|
||||
<!--设置http代理-->
|
||||
<!--
|
||||
<proxy>
|
||||
<id>optional</id>
|
||||
<active>true</active>
|
||||
<protocol>http</protocol>
|
||||
<host>127.0.0.1</host>
|
||||
<port>8081</port>
|
||||
</proxy>
|
||||
-->
|
||||
</proxies>
|
||||
|
||||
<!-- servers
|
||||
| This is a list of authentication profiles, keyed by the server-id used within the system.
|
||||
| Authentication profiles can be used whenever maven must make a connection to a remote server.
|
||||
|-->
|
||||
<servers>
|
||||
<!-- server
|
||||
| Specifies the authentication information to use when connecting to a particular server, identified by
|
||||
| a unique name within the system (referred to by the 'id' attribute below).
|
||||
|
|
||||
| NOTE: You should either specify username/password OR privateKey/passphrase, since these pairings are
|
||||
| used together.
|
||||
|
|
||||
<server>
|
||||
<id>deploymentRepo</id>
|
||||
<username>repouser</username>
|
||||
<password>repopwd</password>
|
||||
</server>
|
||||
-->
|
||||
|
||||
<!-- Another sample, using keys to authenticate.
|
||||
<server>
|
||||
<id>siteServer</id>
|
||||
<privateKey>/path/to/private/key</privateKey>
|
||||
<passphrase>optional; leave empty if not used.</passphrase>
|
||||
</server>
|
||||
-->
|
||||
|
||||
<server>
|
||||
<id>nexus-releases</id>
|
||||
<username>admin</username>
|
||||
<password>sysadmin</password>
|
||||
</server>
|
||||
|
||||
<server>
|
||||
<id>nexus-snapshots</id>
|
||||
<username>admin</username>
|
||||
<password>sysadmin</password>
|
||||
</server>
|
||||
|
||||
</servers>
|
||||
|
||||
<!-- mirrors
|
||||
| This is a list of mirrors to be used in downloading artifacts from remote repositories.
|
||||
|
|
||||
| It works like this: a POM may declare a repository to use in resolving certain artifacts.
|
||||
| However, this repository may have problems with heavy traffic at times, so people have mirrored
|
||||
| it to several places.
|
||||
|
|
||||
| That repository definition will have a unique id, so we can create a mirror reference for that
|
||||
| repository, to be used as an alternate download site. The mirror site will be the preferred
|
||||
| server for that repository.
|
||||
|-->
|
||||
<mirrors>
|
||||
<!-- mirror
|
||||
| Specifies a repository mirror site to use instead of a given repository. The repository that
|
||||
| this mirror serves has an ID that matches the mirrorOf element of this mirror. IDs are used
|
||||
| for inheritance and direct lookup purposes, and must be unique across the set of mirrors.
|
||||
|
|
||||
<mirror>
|
||||
<id>mirrorId</id>
|
||||
<mirrorOf>repositoryId</mirrorOf>
|
||||
<name>Human Readable Name for this Mirror.</name>
|
||||
<url>http://my.repository.com/repo/path</url>
|
||||
</mirror>
|
||||
-->
|
||||
|
||||
<!--Maven镜像-->
|
||||
|
||||
<!--所有的请求都走nexus私服-->
|
||||
<!--
|
||||
<mirror>
|
||||
<id>nexus</id>
|
||||
<mirrorOf>*</mirrorOf>
|
||||
<name>Nexus Mirror.</name>
|
||||
<url>http://localhost:8081/nexus/content/groups/public</url>
|
||||
</mirror>
|
||||
-->
|
||||
|
||||
<!--所有的请求都走oschina-->
|
||||
<!--
|
||||
<mirror>
|
||||
<id>nexus-osc</id>
|
||||
<mirrorOf>*</mirrorOf>
|
||||
<name>Nexus osc</name>
|
||||
<url>http://maven.oschina.net/content/groups/public/</url>
|
||||
</mirror>
|
||||
-->
|
||||
|
||||
</mirrors>
|
||||
|
||||
<!-- profiles
|
||||
| This is a list of profiles which can be activated in a variety of ways, and which can modify
|
||||
| the build process. Profiles provided in the settings.xml are intended to provide local machine-
|
||||
| specific paths and repository locations which allow the build to work in the local environment.
|
||||
|
|
||||
| For example, if you have an integration testing plugin - like cactus - that needs to know where
|
||||
| your Tomcat instance is installed, you can provide a variable here such that the variable is
|
||||
| dereferenced during the build process to configure the cactus plugin.
|
||||
|
|
||||
| As noted above, profiles can be activated in a variety of ways. One way - the activeProfiles
|
||||
| section of this document (settings.xml) - will be discussed later. Another way essentially
|
||||
| relies on the detection of a system property, either matching a particular value for the property,
|
||||
| or merely testing its existence. Profiles can also be activated by JDK version prefix, where a
|
||||
| value of '1.4' might activate a profile when the build is executed on a JDK version of '1.4.2_07'.
|
||||
| Finally, the list of active profiles can be specified directly from the command line.
|
||||
|
|
||||
| NOTE: For profiles defined in the settings.xml, you are restricted to specifying only artifact
|
||||
| repositories, plugin repositories, and free-form properties to be used as configuration
|
||||
| variables for plugins in the POM.
|
||||
|
|
||||
|-->
|
||||
<profiles>
|
||||
<!-- profile
|
||||
| Specifies a set of introductions to the build process, to be activated using one or more of the
|
||||
| mechanisms described above. For inheritance purposes, and to activate profiles via <activatedProfiles/>
|
||||
| or the command line, profiles have to have an ID that is unique.
|
||||
|
|
||||
| An encouraged best practice for profile identification is to use a consistent naming convention
|
||||
| for profiles, such as 'env-dev', 'env-test', 'env-production', 'user-jdcasey', 'user-brett', etc.
|
||||
| This will make it more intuitive to understand what the set of introduced profiles is attempting
|
||||
| to accomplish, particularly when you only have a list of profile id's for debug.
|
||||
|
|
||||
| This profile example uses the JDK version to trigger activation, and provides a JDK-specific repo.
|
||||
<profile>
|
||||
<id>jdk-1.4</id>
|
||||
|
||||
<activation>
|
||||
<jdk>1.4</jdk>
|
||||
</activation>
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>jdk14</id>
|
||||
<name>Repository for JDK 1.4 builds</name>
|
||||
<url>http://www.myhost.com/maven/jdk14</url>
|
||||
<layout>default</layout>
|
||||
<snapshotPolicy>always</snapshotPolicy>
|
||||
</repository>
|
||||
</repositories>
|
||||
</profile>
|
||||
-->
|
||||
|
||||
<!--
|
||||
| Here is another profile, activated by the system property 'target-env' with a value of 'dev',
|
||||
| which provides a specific path to the Tomcat instance. To use this, your plugin configuration
|
||||
| might hypothetically look like:
|
||||
|
|
||||
| ...
|
||||
| <plugin>
|
||||
| <groupId>org.myco.myplugins</groupId>
|
||||
| <artifactId>myplugin</artifactId>
|
||||
|
|
||||
| <configuration>
|
||||
| <tomcatLocation>${tomcatPath}</tomcatLocation>
|
||||
| </configuration>
|
||||
| </plugin>
|
||||
| ...
|
||||
|
|
||||
| NOTE: If you just wanted to inject this configuration whenever someone set 'target-env' to
|
||||
| anything, you could just leave off the <value/> inside the activation-property.
|
||||
|
|
||||
<profile>
|
||||
<id>env-dev</id>
|
||||
|
||||
<activation>
|
||||
<property>
|
||||
<name>target-env</name>
|
||||
<value>dev</value>
|
||||
</property>
|
||||
</activation>
|
||||
|
||||
<properties>
|
||||
<tomcatPath>/path/to/tomcat/instance</tomcatPath>
|
||||
</properties>
|
||||
</profile>
|
||||
-->
|
||||
|
||||
<!--仓库配置,搭建的私服-->
|
||||
<profile>
|
||||
<id>nexus</id>
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>nexus</id>
|
||||
<name>Nexus</name>
|
||||
<url>http://localhost:8081/nexus/content/groups/public/</url>
|
||||
<releases>
|
||||
<enabled>true</enabled>
|
||||
</releases>
|
||||
<snapshots>
|
||||
<enabled>false</enabled>
|
||||
</snapshots>
|
||||
</repository>
|
||||
</repositories>
|
||||
<pluginRepositories>
|
||||
<pluginRepository>
|
||||
<id>nexus</id>
|
||||
<name>Nexus</name>
|
||||
<url>http://localhost:8081/nexus/content/groups/public/</url>
|
||||
<releases>
|
||||
<enabled>true</enabled>
|
||||
</releases>
|
||||
<snapshots>
|
||||
<enabled>false</enabled>
|
||||
</snapshots>
|
||||
</pluginRepository>
|
||||
</pluginRepositories>
|
||||
</profile>
|
||||
|
||||
<!--仓库配置oschina-->
|
||||
<profile>
|
||||
<id>nexus-osc</id>
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>nexus</id>
|
||||
<name>local private nexus</name>
|
||||
<url>http://maven.oschina.net/content/groups/public/</url>
|
||||
<releases>
|
||||
<enabled>true</enabled>
|
||||
</releases>
|
||||
<snapshots>
|
||||
<enabled>false</enabled>
|
||||
</snapshots>
|
||||
</repository>
|
||||
</repositories>
|
||||
<pluginRepositories>
|
||||
<pluginRepository>
|
||||
<id>nexus</id>
|
||||
<name>local private nexus</name>
|
||||
<url>http://maven.oschina.net/content/groups/public/</url>
|
||||
<releases>
|
||||
<enabled>true</enabled>
|
||||
</releases>
|
||||
<snapshots>
|
||||
<enabled>false</enabled>
|
||||
</snapshots>
|
||||
</pluginRepository>
|
||||
</pluginRepositories>
|
||||
</profile>
|
||||
|
||||
<!--覆盖中央仓库-->
|
||||
<profile>
|
||||
<id>central</id>
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>central</id>
|
||||
<url>http://central</url>
|
||||
<releases>
|
||||
<enabled>true</enabled>
|
||||
</releases>
|
||||
<snapshots>
|
||||
<enabled>false</enabled>
|
||||
</snapshots>
|
||||
</repository>
|
||||
</repositories>
|
||||
<pluginRepositories>
|
||||
<pluginRepository>
|
||||
<id>central</id>
|
||||
<url>http://central</url>
|
||||
<releases>
|
||||
<enabled>true</enabled>
|
||||
</releases>
|
||||
<snapshots>
|
||||
<enabled>false</enabled>
|
||||
</snapshots>
|
||||
</pluginRepository>
|
||||
</pluginRepositories>
|
||||
</profile>
|
||||
|
||||
</profiles>
|
||||
|
||||
<!-- activeProfiles
|
||||
| List of profiles that are active for all builds.
|
||||
|
|
||||
<activeProfiles>
|
||||
<activeProfile>alwaysActiveProfile</activeProfile>
|
||||
<activeProfile>anotherAlwaysActiveProfile</activeProfile>
|
||||
</activeProfiles>
|
||||
-->
|
||||
|
||||
<activeProfiles>
|
||||
<!--<activeProfile>nexus</activeProfile>-->
|
||||
<activeProfile>nexus-osc</activeProfile>
|
||||
<!--<activeProfile>central</activeProfile>-->
|
||||
</activeProfiles>
|
||||
|
||||
</settings>
|
||||
@@ -0,0 +1,4 @@
|
||||
# spring-flex-testdrive
|
||||
|
||||
|
||||
[http://www.adobe.com/devnet/flex/articles/spring_blazeds_testdrive.html](http://www.adobe.com/devnet/flex/articles/spring_blazeds_testdrive.html)
|
||||
@@ -0,0 +1,10 @@
|
||||
<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/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>net.aimeizi</groupId>
|
||||
<artifactId>maven-framework-project</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</parent>
|
||||
<artifactId>spring-flex-testdrive</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
</project>
|
||||
Binary file not shown.
+31
-1
@@ -32,7 +32,37 @@ public class Customer {
|
||||
}
|
||||
|
||||
|
||||
public String getName() {
|
||||
public CustomerNumber getNumber() {
|
||||
return number;
|
||||
}
|
||||
|
||||
|
||||
public void setNumber(CustomerNumber number) {
|
||||
this.number = number;
|
||||
}
|
||||
|
||||
|
||||
public String getFirstname() {
|
||||
return firstname;
|
||||
}
|
||||
|
||||
|
||||
public void setFirstname(String firstname) {
|
||||
this.firstname = firstname;
|
||||
}
|
||||
|
||||
|
||||
public String getLastname() {
|
||||
return lastname;
|
||||
}
|
||||
|
||||
|
||||
public void setLastname(String lastname) {
|
||||
this.lastname = lastname;
|
||||
}
|
||||
|
||||
|
||||
public String getName() {
|
||||
|
||||
return String.format("%s %s", firstname, lastname);
|
||||
}
|
||||
|
||||
+12
-1
@@ -18,7 +18,12 @@ import net.aimeizi.spring.rest.example.customer.internal.CustomerNumberTypeAdapt
|
||||
@XmlJavaTypeAdapter(CustomerNumberTypeAdapter.class)
|
||||
public class CustomerNumber {
|
||||
|
||||
private final String number;
|
||||
public String getNumber() {
|
||||
return number;
|
||||
}
|
||||
|
||||
|
||||
private final String number;
|
||||
|
||||
|
||||
@Override
|
||||
@@ -37,4 +42,10 @@ public class CustomerNumber {
|
||||
|
||||
return new CustomerNumber(UUID.randomUUID().toString());
|
||||
}
|
||||
|
||||
|
||||
public CustomerNumber(String number) {
|
||||
super();
|
||||
this.number = number;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user