Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 02868200CC1 for ; Mon, 10 Jul 2017 18:30:59 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 00BA5163F9F; Mon, 10 Jul 2017 16:30:59 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 212FA163F9A for ; Mon, 10 Jul 2017 18:30:57 +0200 (CEST) Received: (qmail 3905 invoked by uid 500); 10 Jul 2017 16:30:57 -0000 Mailing-List: contact commits-help@flex.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@flex.apache.org Delivered-To: mailing list commits@flex.apache.org Received: (qmail 3897 invoked by uid 99); 10 Jul 2017 16:30:57 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 Jul 2017 16:30:57 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 3D3F1DFE22; Mon, 10 Jul 2017 16:30:57 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: yishayw@apache.org To: commits@flex.apache.org Message-Id: <13e892a8d8464ca08fadfe93ebcb9e3e@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: git commit: [flex-asjs] [refs/heads/develop] - Add FileUploaderWithResponseData Date: Mon, 10 Jul 2017 16:30:57 +0000 (UTC) archived-at: Mon, 10 Jul 2017 16:30:59 -0000 Repository: flex-asjs Updated Branches: refs/heads/develop c6a24011b -> 54d00a044 Add FileUploaderWithResponseData Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/54d00a04 Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/54d00a04 Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/54d00a04 Branch: refs/heads/develop Commit: 54d00a044196ec62e81840b3134f9f17f26f4cb1 Parents: c6a2401 Author: DESKTOP-RH4S838\Yishay Authored: Mon Jul 10 19:30:12 2017 +0300 Committer: DESKTOP-RH4S838\Yishay Committed: Mon Jul 10 19:30:12 2017 +0300 ---------------------------------------------------------------------- .../main/flex/org/apache/flex/file/FileProxy.as | 9 ++++ .../flex/file/beads/FileLoaderAndUploader.as | 2 +- .../org/apache/flex/file/beads/FileUploader.as | 18 ++++++++ .../file/beads/FileUploaderWithResponseData.as | 43 ++++++++++++++++++++ .../src/main/resources/basic-manifest.xml | 1 + 5 files changed, 72 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/54d00a04/frameworks/projects/Network/src/main/flex/org/apache/flex/file/FileProxy.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Network/src/main/flex/org/apache/flex/file/FileProxy.as b/frameworks/projects/Network/src/main/flex/org/apache/flex/file/FileProxy.as index 738cf55..38c2fe8 100644 --- a/frameworks/projects/Network/src/main/flex/org/apache/flex/file/FileProxy.as +++ b/frameworks/projects/Network/src/main/flex/org/apache/flex/file/FileProxy.as @@ -23,6 +23,15 @@ package org.apache.flex.file import org.apache.flex.file.beads.FileModel; /** + * Indicates that the model has changed + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion FlexJS 0.9 + */ + [Event(name="modelChanged", type="org.apache.flex.events.Event")] + /** * The FileProxy class is where beads regarding file operations are added. * Information about operations can be queried in the file model, or by * listenening to events dispatched by beads. http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/54d00a04/frameworks/projects/Network/src/main/flex/org/apache/flex/file/beads/FileLoaderAndUploader.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Network/src/main/flex/org/apache/flex/file/beads/FileLoaderAndUploader.as b/frameworks/projects/Network/src/main/flex/org/apache/flex/file/beads/FileLoaderAndUploader.as index 77ba96c..2b66552 100644 --- a/frameworks/projects/Network/src/main/flex/org/apache/flex/file/beads/FileLoaderAndUploader.as +++ b/frameworks/projects/Network/src/main/flex/org/apache/flex/file/beads/FileLoaderAndUploader.as @@ -21,7 +21,7 @@ package org.apache.flex.file.beads import org.apache.flex.events.Event; /** - * The FileLoaderUploader is a compound bead that allows you + * The FileLoaderAndUploader is a compound bead that allows you * to load a file and upload it in one operation. * * http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/54d00a04/frameworks/projects/Network/src/main/flex/org/apache/flex/file/beads/FileUploader.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Network/src/main/flex/org/apache/flex/file/beads/FileUploader.as b/frameworks/projects/Network/src/main/flex/org/apache/flex/file/beads/FileUploader.as index 0cf4d5f..470eb28 100644 --- a/frameworks/projects/Network/src/main/flex/org/apache/flex/file/beads/FileUploader.as +++ b/frameworks/projects/Network/src/main/flex/org/apache/flex/file/beads/FileUploader.as @@ -19,6 +19,8 @@ package org.apache.flex.file.beads { import org.apache.flex.core.IBead; import org.apache.flex.core.IStrand; + import org.apache.flex.events.Event; + import org.apache.flex.events.IEventDispatcher; import org.apache.flex.file.FileProxy; import org.apache.flex.net.URLBinaryLoader; import org.apache.flex.net.URLRequest; @@ -37,6 +39,15 @@ package org.apache.flex.file.beads } /** + * Indicates that the upload operation is complete + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion FlexJS 0.9 + */ + [Event(name="complete", type="org.apache.flex.events.Event")] + /** * The FileUploader class is a bead which adds to FileProxy * the ability to upload files. * @@ -70,9 +81,16 @@ package org.apache.flex.file.beads var binaryUploader:URLBinaryLoader = new URLBinaryLoader(); var req:URLRequest = new URLRequest(); req.data = (host.model as FileModel).blob; + binaryUploader.addEventListener(Event.COMPLETE, completeHandler); binaryUploader.load(req); } + protected function completeHandler(event:Event):void + { + (event.target as IEventDispatcher).removeEventListener(Event.COMPLETE, completeHandler); + (host as IEventDispatcher).dispatchEvent(event); + } + /** * @copy org.apache.flex.core.IBead#strand * http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/54d00a04/frameworks/projects/Network/src/main/flex/org/apache/flex/file/beads/FileUploaderWithResponseData.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Network/src/main/flex/org/apache/flex/file/beads/FileUploaderWithResponseData.as b/frameworks/projects/Network/src/main/flex/org/apache/flex/file/beads/FileUploaderWithResponseData.as new file mode 100644 index 0000000..99d0b03 --- /dev/null +++ b/frameworks/projects/Network/src/main/flex/org/apache/flex/file/beads/FileUploaderWithResponseData.as @@ -0,0 +1,43 @@ +// +// 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 org.apache.flex.file.beads +{ + import org.apache.flex.events.Event; + import org.apache.flex.net.URLBinaryLoader; + + /** + * FileUploaderWithResponseData records responseData before dispatching the complete event + * + * + * @toplevel + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion FlexJS 0.9 + */ + public class FileUploaderWithResponseData extends FileUploader + { + public var responseData:Object; + + override protected function completeHandler(event:Event):void + { + responseData = (event.target as URLBinaryLoader).data; + super.completeHandler(event); + } + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/54d00a04/frameworks/projects/Network/src/main/resources/basic-manifest.xml ---------------------------------------------------------------------- diff --git a/frameworks/projects/Network/src/main/resources/basic-manifest.xml b/frameworks/projects/Network/src/main/resources/basic-manifest.xml index eabda27..4a55df4 100644 --- a/frameworks/projects/Network/src/main/resources/basic-manifest.xml +++ b/frameworks/projects/Network/src/main/resources/basic-manifest.xml @@ -27,5 +27,6 @@ +