http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/012fad7c/attic/apps/samples/WEB-INF/src/flex/samples/qos/CustomDelayQueueProcessor.java ---------------------------------------------------------------------- diff --git a/attic/apps/samples/WEB-INF/src/flex/samples/qos/CustomDelayQueueProcessor.java b/attic/apps/samples/WEB-INF/src/flex/samples/qos/CustomDelayQueueProcessor.java index 189e76e..3841e2a 100755 --- a/attic/apps/samples/WEB-INF/src/flex/samples/qos/CustomDelayQueueProcessor.java +++ b/attic/apps/samples/WEB-INF/src/flex/samples/qos/CustomDelayQueueProcessor.java @@ -1,121 +1,121 @@ -/* - * 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 flex.samples.qos; - -import java.util.ArrayList; -import java.util.List; - -import flex.messaging.client.FlexClient; -import flex.messaging.client.FlexClientOutboundQueueProcessor; -import flex.messaging.client.FlushResult; -import flex.messaging.config.ConfigMap; -import flex.messaging.MessageClient; - -/** - * Per client queue processor that applies custom quality of services parameters (in this case: delay). - * Custom quality of services parameters are read from the client FlexClient instance. - * In this sample, these parameters are set in the FlexClient instance by the client application - * using the flex.samples.qos.FlexClientConfigService RemoteObject. - * - * This class is used in the channel definition (see services-config.xml)that the 'market-data-feed' - * message destination (see messaging-config.xml) references. - * - * Each client that connects to this channel's endpoint gets a unique instance of this class to manage - * its specific outbound queue of messages. - */ -public class CustomDelayQueueProcessor extends FlexClientOutboundQueueProcessor -{ - /** - * Used to store the last time this queue was flushed. - * Starts off with an initial value of the construct time for the instance. - */ - private long lastFlushTime = System.currentTimeMillis(); - - /** - * Driven by configuration, this is the configurable delay time between flushes. - */ - private int delayTimeBetweenFlushes; - - public CustomDelayQueueProcessor() { - } - - /** - * Sets up the default delay time between flushes. This default is used if a client-specific - * value has not been set in the FlexClient instance. - * - * @param properties A ConfigMap containing any custom initialization properties. - */ - public void initialize(ConfigMap properties) - { - delayTimeBetweenFlushes = properties.getPropertyAsInt("flush-delay", -1); - if (delayTimeBetweenFlushes < 0) - throw new RuntimeException("Flush delay time for DelayedDeliveryQueueProcessor must be a positive value."); - } - - /** - * This flush implementation delays flushing messages from the queue until 3 seconds - * have passed since the last flush. - * - * @param outboundQueue The queue of outbound messages. - * @return An object containing the messages that have been removed from the outbound queue - * to be written to the network and a wait time for the next flush of the outbound queue - * that is the default for the underlying Channel/Endpoint. - */ - public FlushResult flush(List outboundQueue) - { - int delay = delayTimeBetweenFlushes; - // Read custom delay from client's FlexClient instance - FlexClient flexClient = getFlexClient(); - if (flexClient != null) - { - Object obj = flexClient.getAttribute("market-data-delay"); - if (obj != null) - { - try { - delay = Integer.parseInt((String) obj); - } catch (NumberFormatException ignore) { - } - } - } - - long currentTime = System.currentTimeMillis(); - if ((currentTime - lastFlushTime) < delay) - { - // Delaying flush. No messages will be returned at this point - FlushResult flushResult = new FlushResult(); - // Don't return any messages to flush. - // And request that the next flush doesn't occur until 3 seconds since the previous. - flushResult.setNextFlushWaitTimeMillis((int)(delay - (currentTime - lastFlushTime))); - return flushResult; - } - else // OK to flush. - { - // Flushing. All queued messages will now be returned - lastFlushTime = currentTime; - FlushResult flushResult = new FlushResult(); - flushResult.setNextFlushWaitTimeMillis(delay); - flushResult.setMessages(new ArrayList(outboundQueue)); - outboundQueue.clear(); - return flushResult; - } - } - - public FlushResult flush(MessageClient client, List outboundQueue) { - return super.flush(client, outboundQueue); - } - +/* + * 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 flex.samples.qos; + +import java.util.ArrayList; +import java.util.List; + +import flex.messaging.client.FlexClient; +import flex.messaging.client.FlexClientOutboundQueueProcessor; +import flex.messaging.client.FlushResult; +import flex.messaging.config.ConfigMap; +import flex.messaging.MessageClient; + +/** + * Per client queue processor that applies custom quality of services parameters (in this case: delay). + * Custom quality of services parameters are read from the client FlexClient instance. + * In this sample, these parameters are set in the FlexClient instance by the client application + * using the flex.samples.qos.FlexClientConfigService RemoteObject. + * + * This class is used in the channel definition (see services-config.xml)that the 'market-data-feed' + * message destination (see messaging-config.xml) references. + * + * Each client that connects to this channel's endpoint gets a unique instance of this class to manage + * its specific outbound queue of messages. + */ +public class CustomDelayQueueProcessor extends FlexClientOutboundQueueProcessor +{ + /** + * Used to store the last time this queue was flushed. + * Starts off with an initial value of the construct time for the instance. + */ + private long lastFlushTime = System.currentTimeMillis(); + + /** + * Driven by configuration, this is the configurable delay time between flushes. + */ + private int delayTimeBetweenFlushes; + + public CustomDelayQueueProcessor() { + } + + /** + * Sets up the default delay time between flushes. This default is used if a client-specific + * value has not been set in the FlexClient instance. + * + * @param properties A ConfigMap containing any custom initialization properties. + */ + public void initialize(ConfigMap properties) + { + delayTimeBetweenFlushes = properties.getPropertyAsInt("flush-delay", -1); + if (delayTimeBetweenFlushes < 0) + throw new RuntimeException("Flush delay time for DelayedDeliveryQueueProcessor must be a positive value."); + } + + /** + * This flush implementation delays flushing messages from the queue until 3 seconds + * have passed since the last flush. + * + * @param outboundQueue The queue of outbound messages. + * @return An object containing the messages that have been removed from the outbound queue + * to be written to the network and a wait time for the next flush of the outbound queue + * that is the default for the underlying Channel/Endpoint. + */ + public FlushResult flush(List outboundQueue) + { + int delay = delayTimeBetweenFlushes; + // Read custom delay from client's FlexClient instance + FlexClient flexClient = getFlexClient(); + if (flexClient != null) + { + Object obj = flexClient.getAttribute("market-data-delay"); + if (obj != null) + { + try { + delay = Integer.parseInt((String) obj); + } catch (NumberFormatException ignore) { + } + } + } + + long currentTime = System.currentTimeMillis(); + if ((currentTime - lastFlushTime) < delay) + { + // Delaying flush. No messages will be returned at this point + FlushResult flushResult = new FlushResult(); + // Don't return any messages to flush. + // And request that the next flush doesn't occur until 3 seconds since the previous. + flushResult.setNextFlushWaitTimeMillis((int)(delay - (currentTime - lastFlushTime))); + return flushResult; + } + else // OK to flush. + { + // Flushing. All queued messages will now be returned + lastFlushTime = currentTime; + FlushResult flushResult = new FlushResult(); + flushResult.setNextFlushWaitTimeMillis(delay); + flushResult.setMessages(new ArrayList(outboundQueue)); + outboundQueue.clear(); + return flushResult; + } + } + + public FlushResult flush(MessageClient client, List outboundQueue) { + return super.flush(client, outboundQueue); + } + } \ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/012fad7c/attic/apps/samples/WEB-INF/src/flex/samples/qos/FlexClientConfigService.java ---------------------------------------------------------------------- diff --git a/attic/apps/samples/WEB-INF/src/flex/samples/qos/FlexClientConfigService.java b/attic/apps/samples/WEB-INF/src/flex/samples/qos/FlexClientConfigService.java index d6bfac9..c66d46b 100755 --- a/attic/apps/samples/WEB-INF/src/flex/samples/qos/FlexClientConfigService.java +++ b/attic/apps/samples/WEB-INF/src/flex/samples/qos/FlexClientConfigService.java @@ -1,74 +1,74 @@ -/* - * 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 flex.samples.qos; - -import java.util.ArrayList; -import java.util.Enumeration; -import java.util.List; - -import flex.messaging.FlexContext; -import flex.messaging.client.FlexClient; - -public class FlexClientConfigService -{ - - public void setAttribute(String name, Object value) - { - FlexClient flexClient = FlexContext.getFlexClient(); - flexClient.setAttribute(name, value); - } - - public List getAttributes() - { - FlexClient flexClient = FlexContext.getFlexClient(); - List attributes = new ArrayList(); - Enumeration attrNames = flexClient.getAttributeNames(); - while (attrNames.hasMoreElements()) - { - String attrName = (String) attrNames.nextElement(); - attributes.add(new Attribute(attrName, flexClient.getAttribute(attrName))); - } - - return attributes; - - } - - public class Attribute { - - private String name; - private Object value; - - public Attribute(String name, Object value) { - this.name = name; - this.value = value; - } - public String getName() { - return name; - } - public void setName(String name) { - this.name = name; - } - public Object getValue() { - return value; - } - public void setValue(Object value) { - this.value = value; - } - - } - -} +/* + * 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 flex.samples.qos; + +import java.util.ArrayList; +import java.util.Enumeration; +import java.util.List; + +import flex.messaging.FlexContext; +import flex.messaging.client.FlexClient; + +public class FlexClientConfigService +{ + + public void setAttribute(String name, Object value) + { + FlexClient flexClient = FlexContext.getFlexClient(); + flexClient.setAttribute(name, value); + } + + public List getAttributes() + { + FlexClient flexClient = FlexContext.getFlexClient(); + List attributes = new ArrayList(); + Enumeration attrNames = flexClient.getAttributeNames(); + while (attrNames.hasMoreElements()) + { + String attrName = (String) attrNames.nextElement(); + attributes.add(new Attribute(attrName, flexClient.getAttribute(attrName))); + } + + return attributes; + + } + + public class Attribute { + + private String name; + private Object value; + + public Attribute(String name, Object value) { + this.name = name; + this.value = value; + } + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + public Object getValue() { + return value; + } + public void setValue(Object value) { + this.value = value; + } + + } + +} http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/012fad7c/attic/apps/samples/WEB-INF/src/flex/samples/runtimeconfig/ChatRoomService.java ---------------------------------------------------------------------- diff --git a/attic/apps/samples/WEB-INF/src/flex/samples/runtimeconfig/ChatRoomService.java b/attic/apps/samples/WEB-INF/src/flex/samples/runtimeconfig/ChatRoomService.java index 4f7c1a9..9e83da5 100755 --- a/attic/apps/samples/WEB-INF/src/flex/samples/runtimeconfig/ChatRoomService.java +++ b/attic/apps/samples/WEB-INF/src/flex/samples/runtimeconfig/ChatRoomService.java @@ -1,81 +1,81 @@ -/* - * 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 flex.samples.runtimeconfig; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import flex.messaging.MessageBroker; -import flex.messaging.MessageDestination; -//import flex.messaging.config.ServerSettings; -import flex.messaging.services.MessageService; - -/** - * Simplistic implementation of a chat room management service. Clients can add rooms, - * and obtain a list of rooms. The interesting part of this example is the "on-the-fly" - * creation of a message destination. The same technique can be used to create DataService - * and Remoting destinations. - */ -public class ChatRoomService { - - private List rooms; - - public ChatRoomService() - { - rooms = Collections.synchronizedList(new ArrayList()); - } - - public List getRoomList() - { - return rooms; - } - - public void createRoom(String id) { - - if (roomExists(id)) - { - throw new RuntimeException("Room already exists"); - } - - // Create a new Message destination dynamically - String serviceId = "message-service"; - MessageBroker broker = MessageBroker.getMessageBroker(null); - MessageService service = (MessageService) broker.getService(serviceId); - MessageDestination destination = (MessageDestination) service.createDestination(id); - - if (service.isStarted()) - { - destination.start(); - } - - rooms.add(id); - - } - - public boolean roomExists(String id) - { - int size = rooms.size(); - for (int i=0; i<size; i++) - { - if ( ((String)rooms.get(i)).equals(id) ) - { - return true; - } - } - return false; - } +/* + * 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 flex.samples.runtimeconfig; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import flex.messaging.MessageBroker; +import flex.messaging.MessageDestination; +//import flex.messaging.config.ServerSettings; +import flex.messaging.services.MessageService; + +/** + * Simplistic implementation of a chat room management service. Clients can add rooms, + * and obtain a list of rooms. The interesting part of this example is the "on-the-fly" + * creation of a message destination. The same technique can be used to create DataService + * and Remoting destinations. + */ +public class ChatRoomService { + + private List rooms; + + public ChatRoomService() + { + rooms = Collections.synchronizedList(new ArrayList()); + } + + public List getRoomList() + { + return rooms; + } + + public void createRoom(String id) { + + if (roomExists(id)) + { + throw new RuntimeException("Room already exists"); + } + + // Create a new Message destination dynamically + String serviceId = "message-service"; + MessageBroker broker = MessageBroker.getMessageBroker(null); + MessageService service = (MessageService) broker.getService(serviceId); + MessageDestination destination = (MessageDestination) service.createDestination(id); + + if (service.isStarted()) + { + destination.start(); + } + + rooms.add(id); + + } + + public boolean roomExists(String id) + { + int size = rooms.size(); + for (int i=0; i<size; i++) + { + if ( ((String)rooms.get(i)).equals(id) ) + { + return true; + } + } + return false; + } } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/012fad7c/attic/apps/samples/WEB-INF/src/flex/samples/runtimeconfig/EmployeeRuntimeRemotingDestination.java ---------------------------------------------------------------------- diff --git a/attic/apps/samples/WEB-INF/src/flex/samples/runtimeconfig/EmployeeRuntimeRemotingDestination.java b/attic/apps/samples/WEB-INF/src/flex/samples/runtimeconfig/EmployeeRuntimeRemotingDestination.java index e639fae..4624eba 100755 --- a/attic/apps/samples/WEB-INF/src/flex/samples/runtimeconfig/EmployeeRuntimeRemotingDestination.java +++ b/attic/apps/samples/WEB-INF/src/flex/samples/runtimeconfig/EmployeeRuntimeRemotingDestination.java @@ -1,54 +1,54 @@ -/* - * 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 flex.samples.runtimeconfig; - -import flex.messaging.config.ConfigMap; -import flex.messaging.services.AbstractBootstrapService; -import flex.messaging.services.RemotingService; -import flex.messaging.services.remoting.RemotingDestination; - -public class EmployeeRuntimeRemotingDestination extends AbstractBootstrapService -{ - private RemotingService remotingService; - - /** - * This method is called by FDS when FDS has been initialized but not started. - */ - public void initialize(String id, ConfigMap properties) - { - remotingService = (RemotingService) getMessageBroker().getService("remoting-service"); - RemotingDestination destination = (RemotingDestination) remotingService.createDestination(id); - destination.setSource("flex.samples.crm.employee.EmployeeDAO"); - } - - /** - * This method is called by FDS as FDS starts up (after initialization). - */ - public void start() - { - // No-op - } - - /** - * This method is called by FDS as FDS shuts down. - */ - public void stop() - { - // No-op - } - -} +/* + * 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 flex.samples.runtimeconfig; + +import flex.messaging.config.ConfigMap; +import flex.messaging.services.AbstractBootstrapService; +import flex.messaging.services.RemotingService; +import flex.messaging.services.remoting.RemotingDestination; + +public class EmployeeRuntimeRemotingDestination extends AbstractBootstrapService +{ + private RemotingService remotingService; + + /** + * This method is called by FDS when FDS has been initialized but not started. + */ + public void initialize(String id, ConfigMap properties) + { + remotingService = (RemotingService) getMessageBroker().getService("remoting-service"); + RemotingDestination destination = (RemotingDestination) remotingService.createDestination(id); + destination.setSource("flex.samples.crm.employee.EmployeeDAO"); + } + + /** + * This method is called by FDS as FDS starts up (after initialization). + */ + public void start() + { + // No-op + } + + /** + * This method is called by FDS as FDS shuts down. + */ + public void stop() + { + // No-op + } + +} http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/012fad7c/attic/apps/samples/WEB-INF/web.xml ---------------------------------------------------------------------- diff --git a/attic/apps/samples/WEB-INF/web.xml b/attic/apps/samples/WEB-INF/web.xml index 4fd913d..0a97d59 100755 --- a/attic/apps/samples/WEB-INF/web.xml +++ b/attic/apps/samples/WEB-INF/web.xml @@ -1,63 +1,63 @@ -<?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. - ---> - -<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd"> - -<web-app> - <display-name>BlazeDS Samples</display-name> - <description>BlazeDS Sample Application</description> - - <!-- Http Flex Session attribute and binding listener support --> - <listener> - <listener-class>flex.messaging.HttpFlexSession</listener-class> - </listener> - - <!-- MessageBroker Servlet --> - <servlet> - <servlet-name>MessageBrokerServlet</servlet-name> - <display-name>MessageBrokerServlet</display-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> - <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.htm</welcome-file> - </welcome-file-list> - - <!-- for WebSphere deployment, please uncomment --> - <!-- - <resource-ref> - <description>Flex Messaging WorkManager</description> - <res-ref-name>wm/MessagingWorkManager</res-ref-name> - <res-type>com.ibm.websphere.asynchbeans.WorkManager</res-type> - <res-auth>Container</res-auth> - <res-sharing-scope>Shareable</res-sharing-scope> - </resource-ref> - --> - -</web-app> +<?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. + +--> + +<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd"> + +<web-app> + <display-name>BlazeDS Samples</display-name> + <description>BlazeDS Sample Application</description> + + <!-- Http Flex Session attribute and binding listener support --> + <listener> + <listener-class>flex.messaging.HttpFlexSession</listener-class> + </listener> + + <!-- MessageBroker Servlet --> + <servlet> + <servlet-name>MessageBrokerServlet</servlet-name> + <display-name>MessageBrokerServlet</display-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> + <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.htm</welcome-file> + </welcome-file-list> + + <!-- for WebSphere deployment, please uncomment --> + <!-- + <resource-ref> + <description>Flex Messaging WorkManager</description> + <res-ref-name>wm/MessagingWorkManager</res-ref-name> + <res-type>com.ibm.websphere.asynchbeans.WorkManager</res-type> + <res-auth>Container</res-auth> + <res-sharing-scope>Shareable</res-sharing-scope> + </resource-ref> + --> + +</web-app> http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/012fad7c/attic/apps/samples/build.xml ---------------------------------------------------------------------- diff --git a/attic/apps/samples/build.xml b/attic/apps/samples/build.xml index 2a40ad9..609d314 100755 --- a/attic/apps/samples/build.xml +++ b/attic/apps/samples/build.xml @@ -1,168 +1,168 @@ -<?xml version="1.0"?> -<!-- - - 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="samples.war/build.xml" default="main" basedir="../.."> - <property file="${basedir}/build.properties"/> - <property name="samples.war" value="${basedir}/apps/samples"/> - <property name="dist.dir" value="${basedir}/dist"/> - <property name="src.dir" value="${samples.war}/WEB-INF/src"/> - <property name="classes.dir" value="${samples.war}/WEB-INF/classes"/> - <property name="context.root" value="samples" /> - - <path id="classpath"> - <fileset dir="${samples.war}/WEB-INF/lib" includes="**/*.jar"/> - <pathelement location="${servlet.jar}"/> - <pathelement location="${jms.jar}"/> - </path> - - <target name="main" depends="clean,samples"/> - <target name="samples" depends="prepare,copy-resources,compile"/> - - <target name="prepare"> - <mkdir dir="${samples.war}/WEB-INF/lib"/> - <mkdir dir="${samples.war}/WEB-INF/classes"/> - </target> - - <target name="copy-resources"> - <fail unless="local.sdk.lib.dir" message="must specify local.sdk.lib.dir in server/build.properties"/> - <fail unless="local.sdk.frameworks.dir" message="must specify local.sdk.frameworks.dir in build.properties"/> - - <!-- copy to the lib directory --> - <copy todir="${samples.war}/WEB-INF/lib"> - <fileset dir="${basedir}/lib" includes="${webapp.lib}" /> - <fileset file="${hsqldb.jar}" /> - </copy> - - <!-- copy to sampledb directory --> - <copy todir="${basedir}/sampledb"> - <fileset file="${hsqldb.jar}" /> - </copy> - - <!-- copy to the classes directory --> - <copy todir="${samples.war}/WEB-INF/classes"> - <fileset dir="${samples.war}/WEB-INF/src"> - <include name="**/*.xml"/> - </fileset> - <fileset dir="${basedir}/lib" includes="${webapp.classes}"/> - </copy> - - <!-- create version.properties --> - <propertyfile file="${samples.war}/WEB-INF/flex/version.properties"> - <entry key="build" value="${manifest.Implementation-Version}.${build.number}"/> - <entry key="minimumSDKVersion" value="${min.sdk.version}"/> - </propertyfile> - - </target> - - <target name="run-depend" if="src.depend"> - <echo message="Removing class files that changed and dependent class files."/> - <depend cache="${classes.dir}" srcdir="${src.dir}" destdir="${classes.dir}"/> - </target> - - <target name="compile" depends="prepare,run-depend,copy-resources" description="compile"> - <javac source="1.4" debug="${src.debug}" destdir="${classes.dir}" srcdir="${src.dir}" classpathref="classpath"/> - </target> - - <target name="compile-swfs"> - <property name="samples.src.dir" value="${samples.war}/WEB-INF/flex-src" /> - - <ant antfile="${samples.src.dir}/dashboard/build.xml" /> - <ant antfile="${samples.src.dir}/runtimeconfig-messaging/build.xml" /> - <ant antfile="${samples.src.dir}/runtimeconfig-remoting/build.xml" /> - <ant antfile="${samples.src.dir}/testdrive-101/build.xml" /> - <ant antfile="${samples.src.dir}/testdrive-chat/build.xml" /> - <ant antfile="${samples.src.dir}/testdrive-datapush/build.xml" /> - <ant antfile="${samples.src.dir}/testdrive-httpservice/build.xml" /> - <ant antfile="${samples.src.dir}/testdrive-remoteobject/build.xml" /> - <ant antfile="${samples.src.dir}/testdrive-update/build.xml" /> - <ant antfile="${samples.src.dir}/testdrive-webservice/build.xml" /> - <ant antfile="${samples.src.dir}/traderdesktop/build.xml" /> - <ant antfile="${samples.src.dir}/inventory/build.xml" /> - - </target> - - <target name="package" depends="compile-swfs" description=" Creates distribution war file"> - - <mkdir dir="${dist.dir}"/> - - <!-- - we don't want flex source naked in WEB-INF as that would lead to overlapping eclipse projects - instead, zip it up and then put it in the war - --> - <zip destfile="${samples.war}/WEB-INF/flex-src/flex-src.zip" - comment="${manifest.Implementation-Title} ${manifest.Implementation-Version}.${label} Samples Flex Source Code"> - <fileset dir="${samples.war}/WEB-INF/flex-src" - excludes="**/build*.xml,flex-src.zip"/> - </zip> - - <war file="${dist.dir}/samples.war" - webxml="${samples.war}/WEB-INF/web.xml"> - <manifest> - <attribute name="Sealed" value="${manifest.sealed}"/> - <attribute name="Implementation-Title" value="${manifest.Implementation-Title} - Samples Application"/> - <attribute name="Implementation-Version" value="${manifest.Implementation-Version}.${build.number}"/> - <attribute name="Implementation-Vendor" value="${manifest.Implementation-Vendor}"/> - </manifest> - <fileset dir="${samples.war}" > - <exclude name="**/**/build*.xml" /> - <exclude name="**/generated/**/*"/> - <exclude name="WEB-INF/jsp/**/*" /> - <exclude name="WEB-INF/sessions/**/*" /> - <exclude name="WEB-INF/flex-src/**/*" /> - <!-- This is included in the war task already --> - <exclude name="WEB-INF/web.xml" /> - </fileset> - <fileset dir="${samples.war}" includes="WEB-INF/flex-src/flex-src.zip" /> - </war> - - <copy todir="${dist.dir}/sampledb"> - <fileset dir="${basedir}/sampledb" /> - <fileset file="${hsqldb.jar}" /> - </copy> - - </target> - - <target name="clean" description="--> Removes jars and classes"> - <delete quiet="true" includeEmptyDirs="true"> - <fileset dir="${samples.war}/WEB-INF/lib" includes="${webapp.lib},${webtier.lib},${hsqldb.jar}"/> - <fileset dir="${samples.war}/WEB-INF/flex/jars" includes="**/*"/> - <fileset dir="${samples.war}/WEB-INF/flex/locale" includes="**/*"/> - <fileset dir="${samples.war}/WEB-INF/flex/libs" includes="**/*"/> +<?xml version="1.0"?> +<!-- + + 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="samples.war/build.xml" default="main" basedir="../.."> + <property file="${basedir}/build.properties"/> + <property name="samples.war" value="${basedir}/apps/samples"/> + <property name="dist.dir" value="${basedir}/dist"/> + <property name="src.dir" value="${samples.war}/WEB-INF/src"/> + <property name="classes.dir" value="${samples.war}/WEB-INF/classes"/> + <property name="context.root" value="samples" /> + + <path id="classpath"> + <fileset dir="${samples.war}/WEB-INF/lib" includes="**/*.jar"/> + <pathelement location="${servlet.jar}"/> + <pathelement location="${jms.jar}"/> + </path> + + <target name="main" depends="clean,samples"/> + <target name="samples" depends="prepare,copy-resources,compile"/> + + <target name="prepare"> + <mkdir dir="${samples.war}/WEB-INF/lib"/> + <mkdir dir="${samples.war}/WEB-INF/classes"/> + </target> + + <target name="copy-resources"> + <fail unless="local.sdk.lib.dir" message="must specify local.sdk.lib.dir in server/build.properties"/> + <fail unless="local.sdk.frameworks.dir" message="must specify local.sdk.frameworks.dir in build.properties"/> + + <!-- copy to the lib directory --> + <copy todir="${samples.war}/WEB-INF/lib"> + <fileset dir="${basedir}/lib" includes="${webapp.lib}" /> + <fileset file="${hsqldb.jar}" /> + </copy> + + <!-- copy to sampledb directory --> + <copy todir="${basedir}/sampledb"> + <fileset file="${hsqldb.jar}" /> + </copy> + + <!-- copy to the classes directory --> + <copy todir="${samples.war}/WEB-INF/classes"> + <fileset dir="${samples.war}/WEB-INF/src"> + <include name="**/*.xml"/> + </fileset> + <fileset dir="${basedir}/lib" includes="${webapp.classes}"/> + </copy> + + <!-- create version.properties --> + <propertyfile file="${samples.war}/WEB-INF/flex/version.properties"> + <entry key="build" value="${manifest.Implementation-Version}.${build.number}"/> + <entry key="minimumSDKVersion" value="${min.sdk.version}"/> + </propertyfile> + + </target> + + <target name="run-depend" if="src.depend"> + <echo message="Removing class files that changed and dependent class files."/> + <depend cache="${classes.dir}" srcdir="${src.dir}" destdir="${classes.dir}"/> + </target> + + <target name="compile" depends="prepare,run-depend,copy-resources" description="compile"> + <javac source="1.4" debug="${src.debug}" destdir="${classes.dir}" srcdir="${src.dir}" classpathref="classpath"/> + </target> + + <target name="compile-swfs"> + <property name="samples.src.dir" value="${samples.war}/WEB-INF/flex-src" /> + + <ant antfile="${samples.src.dir}/dashboard/build.xml" /> + <ant antfile="${samples.src.dir}/runtimeconfig-messaging/build.xml" /> + <ant antfile="${samples.src.dir}/runtimeconfig-remoting/build.xml" /> + <ant antfile="${samples.src.dir}/testdrive-101/build.xml" /> + <ant antfile="${samples.src.dir}/testdrive-chat/build.xml" /> + <ant antfile="${samples.src.dir}/testdrive-datapush/build.xml" /> + <ant antfile="${samples.src.dir}/testdrive-httpservice/build.xml" /> + <ant antfile="${samples.src.dir}/testdrive-remoteobject/build.xml" /> + <ant antfile="${samples.src.dir}/testdrive-update/build.xml" /> + <ant antfile="${samples.src.dir}/testdrive-webservice/build.xml" /> + <ant antfile="${samples.src.dir}/traderdesktop/build.xml" /> + <ant antfile="${samples.src.dir}/inventory/build.xml" /> + + </target> + + <target name="package" depends="compile-swfs" description=" Creates distribution war file"> + + <mkdir dir="${dist.dir}"/> + + <!-- + we don't want flex source naked in WEB-INF as that would lead to overlapping eclipse projects + instead, zip it up and then put it in the war + --> + <zip destfile="${samples.war}/WEB-INF/flex-src/flex-src.zip" + comment="${manifest.Implementation-Title} ${manifest.Implementation-Version}.${label} Samples Flex Source Code"> + <fileset dir="${samples.war}/WEB-INF/flex-src" + excludes="**/build*.xml,flex-src.zip"/> + </zip> + + <war file="${dist.dir}/samples.war" + webxml="${samples.war}/WEB-INF/web.xml"> + <manifest> + <attribute name="Sealed" value="${manifest.sealed}"/> + <attribute name="Implementation-Title" value="${manifest.Implementation-Title} - Samples Application"/> + <attribute name="Implementation-Version" value="${manifest.Implementation-Version}.${build.number}"/> + <attribute name="Implementation-Vendor" value="${manifest.Implementation-Vendor}"/> + </manifest> + <fileset dir="${samples.war}" > + <exclude name="**/**/build*.xml" /> + <exclude name="**/generated/**/*"/> + <exclude name="WEB-INF/jsp/**/*" /> + <exclude name="WEB-INF/sessions/**/*" /> + <exclude name="WEB-INF/flex-src/**/*" /> + <!-- This is included in the war task already --> + <exclude name="WEB-INF/web.xml" /> + </fileset> + <fileset dir="${samples.war}" includes="WEB-INF/flex-src/flex-src.zip" /> + </war> + + <copy todir="${dist.dir}/sampledb"> + <fileset dir="${basedir}/sampledb" /> + <fileset file="${hsqldb.jar}" /> + </copy> + + </target> + + <target name="clean" description="--> Removes jars and classes"> + <delete quiet="true" includeEmptyDirs="true"> + <fileset dir="${samples.war}/WEB-INF/lib" includes="${webapp.lib},${webtier.lib},${hsqldb.jar}"/> + <fileset dir="${samples.war}/WEB-INF/flex/jars" includes="**/*"/> + <fileset dir="${samples.war}/WEB-INF/flex/locale" includes="**/*"/> + <fileset dir="${samples.war}/WEB-INF/flex/libs" includes="**/*"/> <fileset dir="${samples.war}/WEB-INF/flex" includes="version.properties"/> - <fileset dir="${classes.dir}" includes="**/*.class"/> - <fileset dir="${basedir}/sampledb" includes="${hsqldb.jar}"/> - <fileset file="${dist.dir}/samples.war"/> - <fileset file="${samples.war}/WEB-INF/flex-src/flex-src.zip"/> - <fileset dir="${samples.war}/sqladmin"/> + <fileset dir="${classes.dir}" includes="**/*.class"/> + <fileset dir="${basedir}/sampledb" includes="${hsqldb.jar}"/> + <fileset file="${dist.dir}/samples.war"/> + <fileset file="${samples.war}/WEB-INF/flex-src/flex-src.zip"/> + <fileset dir="${samples.war}/sqladmin"/> <fileset dir="${classes.dir}"/> - </delete> - </target> - - <target name="generated-clean"> - <delete includeEmptyDirs="true" quiet="true"> - <fileset dir="${samples.war}" includes="**/generated/*" /> - </delete> - <delete includeEmptyDirs="true" quiet="true"> - <fileset dir="${samples.war}" includes="**/generated" /> - </delete> - </target> - -</project> + </delete> + </target> + + <target name="generated-clean"> + <delete includeEmptyDirs="true" quiet="true"> + <fileset dir="${samples.war}" includes="**/generated/*" /> + </delete> + <delete includeEmptyDirs="true" quiet="true"> + <fileset dir="${samples.war}" includes="**/generated" /> + </delete> + </target> + +</project> http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/012fad7c/attic/apps/samples/fb-project-setup.htm ---------------------------------------------------------------------- diff --git a/attic/apps/samples/fb-project-setup.htm b/attic/apps/samples/fb-project-setup.htm index 46e8781..ddc387c 100755 --- a/attic/apps/samples/fb-project-setup.htm +++ b/attic/apps/samples/fb-project-setup.htm @@ -1,67 +1,67 @@ -<!-- - 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. ---> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> -<title>BlazeDS Flex Builder Integration</title> -<link href="main.css" rel="stylesheet" type="text/css" /> -</head> -<body> - -<h1>Opening the Samples Source Code in Flex Builder 3</h1> -<h3>Unziping the samples source code </h3> -<ol> - <li>Locate <strong>flex-src.zip</strong> in the <strong>WEB-INF\flex-src</strong> directory of the samples web application. For example, on a typical Windows installation using the Tomcat integrated server, flex-src.zip is located in C:\blazeds\tomcat\webapps\samples\WEB-INF\flex-src.</li> - <li>Unzip flex-src.zip to the root folder of your Flex Builder workspace.</li> -</ol> -<h3>Creating Flex Builder projects </h3> -<p>Create a Flex Builder project for each sample application you are interested in. There are several approaches to create a Flex Builder project for a Flex application that works with BlazeDS. We describe a simple approach here:</p> -<ol> - <li>Select <strong>File>New>Project…</strong> in the Flex Builder menu.</li> - <li> Expand Flex Builder, select <strong>Flex Project</strong> and click Next.</li> - <li> Provide a project name. Use the exact name of the sample folder. For example testdrive-httpservice.</li> - <li> If you unzipped flex-src.zip in the root folder of your Flex Builder workspace, keep the <strong>use default location</strong> checkbox checked.</li> - <li> Select <strong>Web Application</strong> as the application type.</li> - <li> Select <strong>Java</strong> as the application server type.</li> - <li> Check use <strong>remote object access service</strong>.</li> - <li> Uncheck Create combined Java/Flex project using WTP. <strong>Note</strong> this checkbox will only exist if the Eclipse WTP feature is installed.</li> - <li> Click <strong>Next</strong>.</li> - <li> Make sure the root folder for LiveCycle Data Services matches the root folder of your BlazeDS web application. If you are using the Tomcat integrated server on Windows, the settings should look similar to this (you may need to adjust the exact folder based on your own settings):</li> - <blockquote> - <p>Root Folder: C:\blazeds\tomcat\webapps\samples<br /> - Root URL: <a href="http://localhost:8400/lcds-samples/">http://localhost:8400/samples/</a><br /> - Context Root: /samples</p> - </blockquote> - <li>Click <strong>Validate Configuration</strong>, then <strong>Finish</strong>.</li> -</ol> -<h3>Adding a linked resource to the server configuration files</h3> -<p>While working on the client-side of your applications, you may need to look at or change the BlazeDS server-side configuration. For example, you may need to look at existing destinations or create a new one. You can create a linked resource inside a Flex Builder project to make the BlazeDS configuration files easily accessible.</p> -<p>To create a linked resource to the BlazeDS configuration files: </p> -<ol> - <li>Right-click the project name in the project navigation view. </li> - <li>Select <strong>New>Folder</strong> in the popup menu.</li> - <li>Specify the name of the folder as it will appear in the navigation view. This name can be different from the name of the folder in the file system. For example type <strong>server-config</strong>. </li> - <li>Click the <strong>Advanced</strong> button.</li> - <li>Check <strong>Link to folder in the file system</strong>.</li> - <li>Click the <strong>Browse</strong> button and select the <strong>flex</strong> folder under the <strong>WEB-INF</strong> directory of your web application. For example, on a typical Windows installation using the Tomcat integrated server, select C:\blazeds\tomcat\webapps\samples\WEB-INF\flex. </li> - <li>Click <strong>Finish</strong>. The BlazeDS configuration files are now available in your Flex Builder project under the server-config folder. </li> -</ol> - -<p> </p> -</body> -</html> +<!-- + 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. +--> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> +<title>BlazeDS Flex Builder Integration</title> +<link href="main.css" rel="stylesheet" type="text/css" /> +</head> +<body> + +<h1>Opening the Samples Source Code in Flex Builder 3</h1> +<h3>Unziping the samples source code </h3> +<ol> + <li>Locate <strong>flex-src.zip</strong> in the <strong>WEB-INF\flex-src</strong> directory of the samples web application. For example, on a typical Windows installation using the Tomcat integrated server, flex-src.zip is located in C:\blazeds\tomcat\webapps\samples\WEB-INF\flex-src.</li> + <li>Unzip flex-src.zip to the root folder of your Flex Builder workspace.</li> +</ol> +<h3>Creating Flex Builder projects </h3> +<p>Create a Flex Builder project for each sample application you are interested in. There are several approaches to create a Flex Builder project for a Flex application that works with BlazeDS. We describe a simple approach here:</p> +<ol> + <li>Select <strong>File>New>Project…</strong> in the Flex Builder menu.</li> + <li> Expand Flex Builder, select <strong>Flex Project</strong> and click Next.</li> + <li> Provide a project name. Use the exact name of the sample folder. For example testdrive-httpservice.</li> + <li> If you unzipped flex-src.zip in the root folder of your Flex Builder workspace, keep the <strong>use default location</strong> checkbox checked.</li> + <li> Select <strong>Web Application</strong> as the application type.</li> + <li> Select <strong>Java</strong> as the application server type.</li> + <li> Check use <strong>remote object access service</strong>.</li> + <li> Uncheck Create combined Java/Flex project using WTP. <strong>Note</strong> this checkbox will only exist if the Eclipse WTP feature is installed.</li> + <li> Click <strong>Next</strong>.</li> + <li> Make sure the root folder for LiveCycle Data Services matches the root folder of your BlazeDS web application. If you are using the Tomcat integrated server on Windows, the settings should look similar to this (you may need to adjust the exact folder based on your own settings):</li> + <blockquote> + <p>Root Folder: C:\blazeds\tomcat\webapps\samples<br /> + Root URL: <a href="http://localhost:8400/lcds-samples/">http://localhost:8400/samples/</a><br /> + Context Root: /samples</p> + </blockquote> + <li>Click <strong>Validate Configuration</strong>, then <strong>Finish</strong>.</li> +</ol> +<h3>Adding a linked resource to the server configuration files</h3> +<p>While working on the client-side of your applications, you may need to look at or change the BlazeDS server-side configuration. For example, you may need to look at existing destinations or create a new one. You can create a linked resource inside a Flex Builder project to make the BlazeDS configuration files easily accessible.</p> +<p>To create a linked resource to the BlazeDS configuration files: </p> +<ol> + <li>Right-click the project name in the project navigation view. </li> + <li>Select <strong>New>Folder</strong> in the popup menu.</li> + <li>Specify the name of the folder as it will appear in the navigation view. This name can be different from the name of the folder in the file system. For example type <strong>server-config</strong>. </li> + <li>Click the <strong>Advanced</strong> button.</li> + <li>Check <strong>Link to folder in the file system</strong>.</li> + <li>Click the <strong>Browse</strong> button and select the <strong>flex</strong> folder under the <strong>WEB-INF</strong> directory of your web application. For example, on a typical Windows installation using the Tomcat integrated server, select C:\blazeds\tomcat\webapps\samples\WEB-INF\flex. </li> + <li>Click <strong>Finish</strong>. The BlazeDS configuration files are now available in your Flex Builder project under the server-config folder. </li> +</ol> + +<p> </p> +</body> +</html> http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/012fad7c/attic/apps/samples/index.htm ---------------------------------------------------------------------- diff --git a/attic/apps/samples/index.htm b/attic/apps/samples/index.htm index 1ffcf8e..e12ec93 100755 --- a/attic/apps/samples/index.htm +++ b/attic/apps/samples/index.htm @@ -1,101 +1,101 @@ -<!-- - 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. ---> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> -<title>BlazeDS Samples</title> -<link href="main.css" rel="stylesheet" type="text/css" /> -</head> -<body> - -<h1><img src="images/blazeds.png" width="100" height="105" /></h1> -<h1>BlazeDS Samples </h1> -<div class="highlight"> -<h3>Starting the Samples Database </h3> -<p>You have to <strong>start the sample database</strong> before you can run the BlazeDS samples. The samples use an HSQLDB database that located in the [installdir]/sampledb directory.</p> -<p>To start the sample database:</p> -<ol> - <li>Open a command prompt and go to the [installdir]/sampledb</li> - <li>Run startdb.bat (Windows) or startdb.sh (Unix-based systems)</li> -</ol> -</div> -<h2>Source Code</h2> -<p>The source code for all the sample applications is available in samples\WEB-INF\flex-src\flex-src.zip. </p> -<ul> - <li>If you want to examine the source code using your favorite code editor, unzip <strong>flex-src.zip</strong> anywhere on your file system. </li> - <li>If you want to work with and compile the sample applications in <strong>Flash Builder</strong>, read <a href="fb-project-setup.htm">these instructions</a> to set up your Flash Builder projects. </li> -</ul> - -<h2>30 Minute Test Drive</h2> -<p>The objective of this test drive is to give you, in a very short amount of time, an understanding of how the BlazeDS data services work and what they can do. -This test drive consists of a series of eight samples kept as concise as possible (typically between 10 and 50 lines of code) to clearly expose features of interest. </p> - -<p><a href="testdrive.htm">Take the test drive</a></p> - -<h2>Other Samples</h2> -<ul> -<li><a href="#inventory">Inventory Management</a></li> -<li><a href="#traderdesktop">Trader Desktop</a></li> -<li><a href="#dashboard">Collaboration Dashboard</a></li> -<li><a href="#runtimeconfig">Runtime Configuration</a></li> -</ul> - -<div class="item"> -<a name="inventory"></a> -<h3>Inventory Management</h3> -<p>This application demonstrates how to use the RemoteObject to build a simple CRUD (Create/Update/Delete) application.</p> -<p>Click <a href="inventory/index.html">here</a> to start the Inventory Management application</p> -</div> - -<div class="item"> -<a name="traderdesktop"></a> -<h3>Trader Desktop </h3> -<p>This example demonstrates how to use the message service to push data from the server to the client. At the server side, a Java component publishes simulated market data to a BlazeDS messaging destination. The Trader Desktop application subscribes to real time updates for the stocks specified in a configurable watch list. This application lets you experiment with different types of channels (streaming, polling) supported by BlazeDS as well as a channel that uses adaptive polling. Using adaptive polling (using a per client outbound message queue processor), you have full control over how messages are handled by queue processors and delivered to individual clients. For example you can specify per-client delays for message delivery, and provide custom logic defining how messages are merged between deliveries.</p> -<ol> - <li>Click <a href="traderdesktop/startfeed.jsp">here</a> to start the feed</li> - <li>Click <a href="traderdesktop/index.html">here</a> to start the Trader Desktop application</li> - <li>Click <a href="traderdesktop/stopfeed.jsp">here</a> to stop the feed</li> -</ol> -</div> - - -<div class="item"> -<a name="dashboard"></a> -<h3>Collaboration Dashboard</h3> -<p>The Collaboration Dashboard show how you can use the Message Service to build collaborative applications. To try this sample, open the application in two different browser windows -and notice how selections made in one window are reflected in the other window. For example, the chart on the left shows total revenue across all regions on a monthly basis. -When you select a month in this chart, the pie chart in the upper right panel is updated to display a regional breakdown for the selected month. -If you select a region in the pie chart, the chart in the lower-right panel is updated to display the selected region's results compared to the average for the given time period.</p> -<p><a href="dashboard/index.html">Run the sample </a></p> -</div> - -<div class="item"> -<a name="runtimeconfig"></a> -<h3>Runtime Configuration </h3> -<p>Runtime configuration provides an alternative approach to defining destinations and adapters. In addition to statically defining destinations and adapters in the XML configuration files (remoting-config.xml and messaging-config.xml), you can create destinations and adapters programmatically at runtime. Your runtime destinations and adapters can be injected at server startup, or created as needed during the life cycle of an application. The remoting destination samples provide examples of destinations injected at server startup. The messaging sample provides an example of a destination created as needed. </p> -<h4>Remoting destination </h4> -<p><a href="runtimeconfig-remoting/index.html">Run the sample</a> </p> -<p>See flex.samples.runtimeconfig.EmployeeRuntimeRemotingDestination.java to see how the "runtime-employee-ro" destination is created programmatically.</p> -<h4>Messaging destination </h4> -<p><a href="runtimeconfig-messaging/index.html">Run the sample</a> </p> -<p>See flex.samples.runtimeconfig.ChatRoomService.java to see how the chat room destinations are created programmatically.</p> -</div> - -<p>© 2004-2010 Adobe Systems Incorporated. All rights reserved. </p> -</body> +<!-- + 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. +--> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> +<title>BlazeDS Samples</title> +<link href="main.css" rel="stylesheet" type="text/css" /> +</head> +<body> + +<h1><img src="images/blazeds.png" width="100" height="105" /></h1> +<h1>BlazeDS Samples </h1> +<div class="highlight"> +<h3>Starting the Samples Database </h3> +<p>You have to <strong>start the sample database</strong> before you can run the BlazeDS samples. The samples use an HSQLDB database that located in the [installdir]/sampledb directory.</p> +<p>To start the sample database:</p> +<ol> + <li>Open a command prompt and go to the [installdir]/sampledb</li> + <li>Run startdb.bat (Windows) or startdb.sh (Unix-based systems)</li> +</ol> +</div> +<h2>Source Code</h2> +<p>The source code for all the sample applications is available in samples\WEB-INF\flex-src\flex-src.zip. </p> +<ul> + <li>If you want to examine the source code using your favorite code editor, unzip <strong>flex-src.zip</strong> anywhere on your file system. </li> + <li>If you want to work with and compile the sample applications in <strong>Flash Builder</strong>, read <a href="fb-project-setup.htm">these instructions</a> to set up your Flash Builder projects. </li> +</ul> + +<h2>30 Minute Test Drive</h2> +<p>The objective of this test drive is to give you, in a very short amount of time, an understanding of how the BlazeDS data services work and what they can do. +This test drive consists of a series of eight samples kept as concise as possible (typically between 10 and 50 lines of code) to clearly expose features of interest. </p> + +<p><a href="testdrive.htm">Take the test drive</a></p> + +<h2>Other Samples</h2> +<ul> +<li><a href="#inventory">Inventory Management</a></li> +<li><a href="#traderdesktop">Trader Desktop</a></li> +<li><a href="#dashboard">Collaboration Dashboard</a></li> +<li><a href="#runtimeconfig">Runtime Configuration</a></li> +</ul> + +<div class="item"> +<a name="inventory"></a> +<h3>Inventory Management</h3> +<p>This application demonstrates how to use the RemoteObject to build a simple CRUD (Create/Update/Delete) application.</p> +<p>Click <a href="inventory/index.html">here</a> to start the Inventory Management application</p> +</div> + +<div class="item"> +<a name="traderdesktop"></a> +<h3>Trader Desktop </h3> +<p>This example demonstrates how to use the message service to push data from the server to the client. At the server side, a Java component publishes simulated market data to a BlazeDS messaging destination. The Trader Desktop application subscribes to real time updates for the stocks specified in a configurable watch list. This application lets you experiment with different types of channels (streaming, polling) supported by BlazeDS as well as a channel that uses adaptive polling. Using adaptive polling (using a per client outbound message queue processor), you have full control over how messages are handled by queue processors and delivered to individual clients. For example you can specify per-client delays for message delivery, and provide custom logic defining how messages are merged between deliveries.</p> +<ol> + <li>Click <a href="traderdesktop/startfeed.jsp">here</a> to start the feed</li> + <li>Click <a href="traderdesktop/index.html">here</a> to start the Trader Desktop application</li> + <li>Click <a href="traderdesktop/stopfeed.jsp">here</a> to stop the feed</li> +</ol> +</div> + + +<div class="item"> +<a name="dashboard"></a> +<h3>Collaboration Dashboard</h3> +<p>The Collaboration Dashboard show how you can use the Message Service to build collaborative applications. To try this sample, open the application in two different browser windows +and notice how selections made in one window are reflected in the other window. For example, the chart on the left shows total revenue across all regions on a monthly basis. +When you select a month in this chart, the pie chart in the upper right panel is updated to display a regional breakdown for the selected month. +If you select a region in the pie chart, the chart in the lower-right panel is updated to display the selected region's results compared to the average for the given time period.</p> +<p><a href="dashboard/index.html">Run the sample </a></p> +</div> + +<div class="item"> +<a name="runtimeconfig"></a> +<h3>Runtime Configuration </h3> +<p>Runtime configuration provides an alternative approach to defining destinations and adapters. In addition to statically defining destinations and adapters in the XML configuration files (remoting-config.xml and messaging-config.xml), you can create destinations and adapters programmatically at runtime. Your runtime destinations and adapters can be injected at server startup, or created as needed during the life cycle of an application. The remoting destination samples provide examples of destinations injected at server startup. The messaging sample provides an example of a destination created as needed. </p> +<h4>Remoting destination </h4> +<p><a href="runtimeconfig-remoting/index.html">Run the sample</a> </p> +<p>See flex.samples.runtimeconfig.EmployeeRuntimeRemotingDestination.java to see how the "runtime-employee-ro" destination is created programmatically.</p> +<h4>Messaging destination </h4> +<p><a href="runtimeconfig-messaging/index.html">Run the sample</a> </p> +<p>See flex.samples.runtimeconfig.ChatRoomService.java to see how the chat room destinations are created programmatically.</p> +</div> + +<p>© 2004-2010 Adobe Systems Incorporated. All rights reserved. </p> +</body> </html> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/012fad7c/attic/apps/samples/main.css ---------------------------------------------------------------------- diff --git a/attic/apps/samples/main.css b/attic/apps/samples/main.css index 11b62c1..5470820 100755 --- a/attic/apps/samples/main.css +++ b/attic/apps/samples/main.css @@ -1,138 +1,138 @@ -/* - * 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. - */ -body { - font-family: Verdana, Arial, Helvetica, sans-serif; - margin-top: 30px; - margin-top: 30px; - margin-left: 8%; - margin-right: 8%; - font-size: 0.8em; - color: #333333; - background-color:#FFFFFF; -} - -h1, h2, h3 { - font-family: 'Trebuchet MS', 'Lucida Grande', Verdana, Arial, Sans-Serif; - font-weight: bold; -} - -h1 { - font-weight: bold; - margin-top: 4px; - margin-bottom: 12px; - font-size: 2em; -} - -h2 { - padding-top: 12px; - margin-bottom: 0px; - font-size: 1.6em; - color: #333333; -} - -h3 { - margin-top: 0px; - font-size: 1.3em; - color: #004477; -} - -h4 { - margin-top: 20px; - margin-bottom: 8px; - font-size: 12px; - color: #333333; -} - -.item { - border-bottom: 1px solid #CCCCCC; - padding-top: 12px; - padding-bottom: 0px; -} - -.highlight { - border: 1px solid #CCCCCC; - padding-top:10px; - padding-left:10px; - padding-right:10px; - padding-bottom:0px; - border-color: #2080B3; - margin-top:20px; - margin-bottom:20px; -} - -.footer { - color: #666666; - margin-top: 20px; - font-size: 0.75em; -} - -ul { - margin-top:8px; - margin-bottom:8px; -} - -li { - padding-bottom:8px; -} - -code { - color: #000099; - font-family: "Courier New", Courier, monospace; - font-size:1.1em; -} - -img { - border: 0; -} - -#col1{ - float:left; - width: 20%; - padding-right: 24px; -} - -#col2{ - float: left; - width: 55%; -} - -#col3{ - float: right; - width: 20%; - margin: 0px; - padding: 0px; -} - -a:link { - color: #006699; - text-decoration: none; -} - -a:visited { - text-decoration: none; - color: #006699; -} - -a:hover { - text-decoration: underline; - color: #006699; -} - -a:active { - text-decoration: none; - color: #006699; +/* + * 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. + */ +body { + font-family: Verdana, Arial, Helvetica, sans-serif; + margin-top: 30px; + margin-top: 30px; + margin-left: 8%; + margin-right: 8%; + font-size: 0.8em; + color: #333333; + background-color:#FFFFFF; +} + +h1, h2, h3 { + font-family: 'Trebuchet MS', 'Lucida Grande', Verdana, Arial, Sans-Serif; + font-weight: bold; +} + +h1 { + font-weight: bold; + margin-top: 4px; + margin-bottom: 12px; + font-size: 2em; +} + +h2 { + padding-top: 12px; + margin-bottom: 0px; + font-size: 1.6em; + color: #333333; +} + +h3 { + margin-top: 0px; + font-size: 1.3em; + color: #004477; +} + +h4 { + margin-top: 20px; + margin-bottom: 8px; + font-size: 12px; + color: #333333; +} + +.item { + border-bottom: 1px solid #CCCCCC; + padding-top: 12px; + padding-bottom: 0px; +} + +.highlight { + border: 1px solid #CCCCCC; + padding-top:10px; + padding-left:10px; + padding-right:10px; + padding-bottom:0px; + border-color: #2080B3; + margin-top:20px; + margin-bottom:20px; +} + +.footer { + color: #666666; + margin-top: 20px; + font-size: 0.75em; +} + +ul { + margin-top:8px; + margin-bottom:8px; +} + +li { + padding-bottom:8px; +} + +code { + color: #000099; + font-family: "Courier New", Courier, monospace; + font-size:1.1em; +} + +img { + border: 0; +} + +#col1{ + float:left; + width: 20%; + padding-right: 24px; +} + +#col2{ + float: left; + width: 55%; +} + +#col3{ + float: right; + width: 20%; + margin: 0px; + padding: 0px; +} + +a:link { + color: #006699; + text-decoration: none; +} + +a:visited { + text-decoration: none; + color: #006699; +} + +a:hover { + text-decoration: underline; + color: #006699; +} + +a:active { + text-decoration: none; + color: #006699; } \ No newline at end of file
