Re: AMF and class aliases

2019-07-14 Thread Alex Harui
IMO, localization may perform better with a custom bead or two.  Generic 
binding must watch something for changes that might require that getString() be 
called again, but in general, either bindings to locales are set up early (so 
no change watcher is needed at all), or because of PAYG, you should pay more to 
watch something like the locale changing.  But a custom binding bead could know 
to watch whatever you are using to load localized strings instead of using the 
generic watching rules.

HTH,
-Alex

On 7/12/19, 9:12 AM, "Frost, Andrew"  wrote:

Thanks

Yes, binding is one that we're definitely also having some fun with. Wrote 
our own little binding bead for now but at some point I'll get round to looking 
in depth to see if there's a way of doing this using the 'proper' beads. In 
case you're that interested: it's for localisation where we have an object 
assigned to the class and when a property of the object is updated, it fires a 
"changed" event which we need to listen out for and then re-load in all the 
bound details, which are function calls with parameters i.e. 
this.localised.getString('id'). Tried a couple of binding beads and 
investigated what was happening, they were able to detect when the 'localised' 
variable was being changed i.e. a new one being added to 'this', but that's not 
what we're looking for. I think the use of the basic "changed" event rather 
than "ValueChangedEvent" might be confusing it..

Anyway. Getting there. There is a response coming from the server now 
although I'm not sure whether this is then getting handled properly and what 
the next event is that's going out to the server, it's not working fully yet. 
Trying to remotely debug without any access to this myself :-(


thanks

   Andrew



-Original Message-
From: Carlos Rovira  
Sent: 12 July 2019 11:45
To: dev@royale.apache.org
Subject: [EXTERNAL] Re: AMF and class aliases

Yeah! we are in production with AMF for around 4 months without any issue!
So RO works great for Royale ;)

this kind of problems where something is not working and is about a missed 
bead are very typical to Royale.
Is the same with binding, statesbut our brains ends taking that into 
account and soon you'll get to that process ;)

Best

Carlos



El vie., 12 jul. 2019 a las 0:38, Greg Dove ()
escribió:

> Yes, it should just work. There is at least one working example in the 
> examples set, and it should work with CommandMessage etc, without any 
> of the tweaks that you mentioned.
>
> Carlos is using amf extensively and it is currently in use in a 
> production app.
>
> Let me know if you see any bugs.
>
> cheers,
> Greg
>
>
>
> On Fri, Jul 12, 2019 at 10:31 AM Frost, Andrew 
> 
> wrote:
>
> > Oh it's that simple!
> >
> > Yes I just took a look, that does appear to go through it all and 
> > set everything up...
> >
> > Thank you!  that saved us a bit of effort trying to update the 
> > compiler
> ;-)
> >
> >
> >
> >
> > -Original Message-
> > From: Greg Dove 
> > Sent: 11 July 2019 23:27
> > To: dev@royale.apache.org
> > Subject: [EXTERNAL] Re: AMF and class aliases
> >
> > Hi Andrew,
> > 'but I can't see anywhere that this list is accessed/used.'
> >
> > I think you need ClassAliasBead on your Application level, which 
> > will process all the definitions.
> >
> >
> >
> >
> >
> >
> > On Fri, Jul 12, 2019 at 10:22 AM Frost, Andrew 
> > 
> > wrote:
> >
> > > Hi all
> > >
> > > We're trying to get a connection to work from our Royale-based 
> > > code to a LiveCycle back-end, and having to debug why the AMF 
> > > message is different between the Flex version and the Royale 
> > > version (and trying to work out why the server is rejecting our 
> > > initial ping message..)
> > >
> > > One thing that's cropped up is that Flex embeds the name of the 
> > > class
> > > - or rather, the alias of this - when it writes the object:
> > > [RemoteClass(alias="flex.messaging.messages.CommandMessage")]
> > >
> > > In Royale, this capability exists in the
> > > AMFBinaryData.writeObjectVariant() method where it's using the 
> > > "localTraits", and we have:
> > > var alias:String = classInfo.alias;// 
> > > getAliasByClass(instance.constructor
> > > as Class); //<- @todo possible optimization: registerClassAlias 
> > > implementation stores in the classInfo Object, access directly
> > >
> > > The commented-out code does exactly what the new code does, which 
> > > is that it accesses the ROYALE_CLASS_INFO structure:
> > > var classInfo:Object = 
> > > instance.R

Re: Crux Branch

2019-07-14 Thread Alex Harui
Regarding naming, giving something a longer more descriptive name can also make 
it harder to use and then folks start using the short name and then there can 
be confusion again.

AIUI, trademark issues are about confusion.  Names like "Basic" and "Jewel" 
don't appear to have uses that could be confusing.  "Crux" appears to be some 
sort of language thing for Java being brought over to JS, so my concern is that 
someone may someday want Royale to support a Crux library that is based on the 
Java thing.

We are using MXRoyale and SparkRoyale as names for the emulations of Flex's MX 
and Spark components.  "SwizRoyale" would be consistent, especially if the goal 
is to emulate Swiz and potentially get more of the Swiz code officially 
contributed to Apache Royale.  Having renamed lots of FlexJS to Royale, I can 
tell you that renaming still takes time.

My 2 cents,
-Alex

On 7/12/19, 3:41 AM, "Carlos Rovira"  wrote:

Hi Greg!

great progress with the latest touches.

My latest days was in Crux branch so for me is ok to do the merge I think
we cover all the things needed like licensing and avoid name conflicts.
Even we always can improve any of those things over time. So it's ok.

About the name: You're right, Apache Royale Crux is like other "parts" in
Apache Royale, i.e Apache Royale Basic, Apache Royale Jewel,  just a
convenient name to refer a concrete part of the Apache Royale ecosystem
with a bit of meaning and other bit of marketing (I plan to create some
icon for the web in the future as I did with Jewel, and we can do some
graphics and more when we reach a good point with the actual documentation
effort). One important thing for me with the name is to make it different
to Swiz to avoid confusion on that part: Swiz is for Flex, while Crux is
for Royale. So if people talks about Swiz it will be clear that is about
the project for Apache Flex, while if talks about Crux is clear that is for
Apache Royale. The same happens at major level with Apache Flex and Apache
Royale project.

So for me it's all ok.

Thanks for the hard work in this regard Greg!

Carlos






El vie., 12 jul. 2019 a las 9:31, Piotr Zarzycki 
()
escribió:

> Hi Greg,
>
> Thanks for update. I'm having again more important tasks and that is why I
> didn't start release process yet. It looks like I will have for sure 2 
full
> working days to start process on upcoming Wednesday. If you make it till
> that time it would be great, if not let's stay on the branch.
>
> Thanks,
> Piotr
>
> pt., 12 lip 2019 o 07:26 Greg Dove  napisał(a):
>
> > Just a quick update...
> >
> > I just fixed the ant builds for the 3 simple crux examples in the 
branch,
> > which were not working yet.
> >
> > There will continue to be improvements and fixes over time, but I
> actually
> > think it's at a state where it could be merged into develop. Unless 
there
> > is a reason not to, I plan to do this by start of next week.
> > This should not impact anyone else because it is something new, there 
are
> > no changes to anything already present.
> >
> > In terms of the name as 'Crux', so far I had feedback from one person to
> > give the naming some more thought, mainly because of the possibility for
> > name conflicts with other libraries.
> > Carlos suggested to me that we should always use 'Apache Royale Crux' in
> > terms of a general reference or to introduce it for the first time, and
> > then (iirc) 'Crux' by itself only in a very clear Apache Royale context,
> > which avoids naming conflicts. As I understand it, this type of issue is
> > similar to some other things from the past.
> >
> > So far I don't see anything holding back a merge. But please let me know
> if
> > there is anything else.
> >
> > Thanks,
> > -Greg
> >
> >
> >
> > On Sat, Jul 6, 2019 at 3:35 AM Josh Tynjala 
> > wrote:
> >
> > > Interesting! I didn't know that the capture phase worked for
> non-bubbling
> > > events. Good to know. Thanks for looking into it and sharing your
> > findings,
> > > Greg.
> > >
> > > - Josh
> > >
> > >
> > > On Thu, Jul 4, 2019, 11:12 PM Greg Dove  wrote:
> > >
> > > > Hi Josh,
> > > >
> > > > For the addedToStage stuff:
> > > > You made me look! Swiz does not actually use the ADDED event, it
> > > definitely
> > > > does use ADDED_TO_STAGE by default, but you're absolutely right, 
this
> > > does
> > > > not bubble.
> > > >
> > > > I did not pay too much attention to the 'bubbling' side of things
> > > because I
> > > > could see it working in flash and just assumed that's what was
> > happening.
> > > > But it is actually being listened to

Re: Uploading files with parameters

2019-07-14 Thread Piotr Zarzycki
This is great idea Yishay, but I see one scenario where having in model
blop property as FormData type will fail. If I would like to Load and
Upload later file blop has to be BinaryData. - This is actually what we are
trying to do. We need to use FileLoaderAndUploader.

However if I create that new model with additional field called params:
FormData  it could use in following way with code [1]

1) File is being browsed and assigned to "file" property in IFileModel
2) FileLoaderAndUploader - loads it cause "blop" property is empty
3) "blop" property is being filled after loading and it's BinaryData
4) Everything is happened in following line [2] when at the end when we
would like to upload stuff. Here we could use params (FormData), put File
in params and send. I don't know what should
be the name of the param actually for file, but maybe there is no official
default name. Here is some examples [3]

[1] https://paste.apache.org/8mxx3
[2]
https://github.com/apache/royale-asjs/blob/51636852d1d791703cb74b011741fb1f003d5863/frameworks/projects/Network/src/main/royale/org/apache/royale/net/URLStream.as#L136
[3]
https://developer.mozilla.org/en-US/docs/Web/API/FormData/Using_FormData_Objects

Thanks,
Piotr

niedz., 14 lip 2019 o 14:10 Yishay Weiss 
napisał(a):

> It could be enough to create a new model FileModelWithParams implements
> IFileModel which has blob() return FormData in JS. I don’t think you need
> FileUploaderWithParams because the present one reads the blob from the
> model anyway.
>
>
>
> 
> From: Piotr Zarzycki 
> Sent: Sunday, July 14, 2019 2:54:18 PM
> To: dev@royale.apache.org
> Subject: Re: Uploading files with parameters
>
> I just looked into  FileModel and IFileModel. FileUploader using FileModel,
> but this is because IFileModel doesn't contains "blop" property - I think
> IFileModel should contains such.
>
> It is definitely worth to make FileUploader using IFileModel.
>
> Next I could create bead FileUploaderWithParams extends FileUploader which
> could use new interface IFileModelWithParams extends IFileModel.
>
> Thoughts ?
>
> Thanks,
> Piotr
>
> niedz., 14 lip 2019 o 13:41 Piotr Zarzycki 
> napisał(a):
>
> > Hi Yishay,
> >
> > Some comments inline.
> >
> > [1]  https://paste.apache.org/rk1ro
> >
> > sob., 13 lip 2019 o 14:06 Yishay Weiss 
> > napisał(a):
> >
> >> Hi Piotr,
> >>
> >>
> >>
> >> The beads [1] you mentioned are supposed to implement FileReference
> >> methods, that’s why I was asking about the flash way of doing it.
> >>
> >>
> >>
> > *We are doing it in following way [1].*
> >
> >
> >>
> >> Maybe this example [3] helps.
> >>
> >>
> >>
> > *Yes this example was very helpful and we are doing upload in exactly the
> > same way. *
> >
> >
> >>
> >> As I understand the SO answers [2], they’re suggesting to either send
> the
> >> params on the url or in a FormData.
> >>
> >>
> >>
> >> For the former solution you can add  bead
> >> to the file proxy and then on blobChangedHandler() you can make a call
> like:
> >>
> >>
> >>
> >> myUploader.upload(url?param1=1¶m2=2)
> >>
> >>
> >>
> > *As you can see in my link [1] we are doing that in a way as you are
> > suggesting in Flex. In Royale I would like to avoid completely such
> things
> > like concatenating string in order to build url. That's way I have
> started
> > this thread to make sure that I'm not missing some better way than this.
> It
> > looks like I need to implement it. Thanks for confirmation actually.*
> >
> >
> >>
> >> If you want the latter solution you can create a new IFileModel bead
> with
> >> params that would implement FormData on the JS side.
> >>
> >>
> >>
> >> It could be that FileUploader needs to be refacotred to read and
> >> IFileModel instead of an IModel, and that blob() should be part of the
> >> interface and return an Object.
> >>
> >>
> >>
> > *Once I jump into implementation I will take into account your
> > suggestions.*
> >
> >
> >>
> >> Hope you understand when you look at the code, otherwise ask.
> >>
> >>
> >>
> >> Thanks.
> >>
> >>
> >>
> >> [1]
> >>
> https://github.com/apache/royale-asjs/tree/develop/frameworks/projects/Network/src/main/royale/org/apache/royale/file/beads
> >>
> >> [2] https://stackoverflow.com/questions/15218292/xhr-sendfile-params
> >>
> >> [3] https://github.com/yishayw/Examples/blob/FileProxy/Examples.mxml
> >>
> >>
> >>
> >> 
> >> From: Piotr Zarzycki 
> >> Sent: Friday, July 12, 2019 8:50:53 PM
> >> To: dev@royale.apache.org
> >> Subject: Re: Uploading files with parameters
> >>
> >> Hi Yishay,
> >>
> >> I'm trying to achieve exactly what is in the link from SOF.
> >>
> >> Thanks,
> >> Piotr
> >>
> >> On Fri, Jul 12, 2019, 7:35 PM Yishay Weiss 
> >> wrote:
> >>
> >> > Can you show a flash snippet of what you’re trying to achieve? Would
> you
> >> > be using FileReference in flash?
> >> >
> >> >
> >> >
> >> > 
> >> > From: Piotr Zarzycki 
> >> > Sent: Friday, July 12, 20

Maven Royale-compiler build

2019-07-14 Thread Piotr Zarzycki
All build are again up and running!

On Fri, Jul 12, 2019, 4:54 PM Piotr Zarzycki 
wrote:

> The same is with  https://builds.apache.org/job/Royale-asjs/1947/console
>
> pt., 12 lip 2019 o 16:52 Piotr Zarzycki 
> napisał(a):
>
>> I stopped the build for now.
>>
>> pt., 12 lip 2019 o 16:18 Piotr Zarzycki 
>> napisał(a):
>>
>>> Hi,
>>>
>>> I have finally get to the bottom of problems with Windows machines in
>>> Apache. It turns out that the old one was removed and there are new boxes.
>>> I have switched each of our build to new one and Compiler seems to stuck on
>>> accepting license for playerglobal.swc. [1] - Anyone know how to make it
>>> work ?
>>>
>>> [1]  https://builds.apache.org/job/Royale-compiler/966/console
>>>
>>> Thanks,
>>> --
>>>
>>> Piotr Zarzycki
>>>
>>> Patreon: *https://www.patreon.com/piotrzarzycki
>>> *
>>>
>>
>>
>> --
>>
>> Piotr Zarzycki
>>
>> Patreon: *https://www.patreon.com/piotrzarzycki
>> *
>>
>
>
> --
>
> Piotr Zarzycki
>
> Patreon: *https://www.patreon.com/piotrzarzycki
> *
>


Jenkins build is back to normal : royale-asjs_MXTests #933

2019-07-14 Thread Apache Royale CI Server
See 




Build failed in Jenkins: royale-asjs_MXTests #932

2019-07-14 Thread Apache Royale CI Server
See 


--
[...truncated 945.94 KB...]
[mxmlc] scanning for overrides: DeviceNames
[mxmlc] scanning for overrides: DispatchKeyEvent
[mxmlc] scanning for overrides: DispatchMouseClickEvent
[mxmlc] scanning for overrides: DispatchMouseEvent
[mxmlc] scanning for overrides: MustellaLogEvent
[mxmlc] scanning for overrides: MustellaSandboxEvent
[mxmlc] scanning for overrides: ScriptRunner
[mxmlc] scanning for overrides: SetProperty
[mxmlc] scanning for overrides: TestCase
[mxmlc] scanning for overrides: TestOutput
[mxmlc] scanning for overrides: TestResult
[mxmlc] scanning for overrides: TypeInfo
[mxmlc] scanning for overrides: TextInputTests
[mxmlc] scanning for overrides: ComboBoxTests
[mxmlc] scanning for overrides: DateFieldTests
[mxmlc] scanning for overrides: RadioButtonTests
[mxmlc] scanning for overrides: Panel
[mxmlc] scanning for overrides: MenuBarTests
[mxmlc] scanning for overrides: IDataGrid
[mxmlc] scanning for overrides: IMenu
[mxmlc] scanning for overrides: ButtonAutoRepeatController
[mxmlc] scanning for overrides: LayoutChangeNotifier
[mxmlc] scanning for overrides: DataFieldProviderBead
[mxmlc] scanning for overrides: Container
[mxmlc] scanning for overrides: DataGridListArea
[mxmlc] scanning for overrides: DownArrowButtonView
[mxmlc] scanning for overrides: HScrollBarThumbView
[mxmlc] scanning for overrides: HScrollBarTrackView
[mxmlc] scanning for overrides: LeftArrowButtonView
[mxmlc] scanning for overrides: RightArrowButtonView
[mxmlc] scanning for overrides: TextButtonView
[mxmlc] scanning for overrides: Label
[mxmlc] scanning for overrides: TitleBarTitle
[mxmlc] scanning for overrides: UpArrowButtonView
[mxmlc] scanning for overrides: VScrollBarThumbView
[mxmlc] scanning for overrides: VScrollBarTrackView
[mxmlc] scanning for overrides: Border
[mxmlc] scanning for overrides: IDataGridColumn
[mxmlc] scanning for overrides: DataGridColumn
[mxmlc] scanning for overrides: DateChooserHeader
[mxmlc] scanning for overrides: DateChooserList
[mxmlc] scanning for overrides: DateHeaderButton
[mxmlc] scanning for overrides: IChrome
[mxmlc] scanning for overrides: IViewportScroller
[mxmlc] scanning for overrides: ScrollBar
[mxmlc] scanning for overrides: HScrollBar
[mxmlc] scanning for overrides: PanelLayoutProxy
[mxmlc] scanning for overrides: VScrollBar
[mxmlc] scanning for overrides: Menu
[mxmlc] scanning for overrides: CascadingMenu
[mxmlc] scanning for overrides: CloseButton
[mxmlc] scanning for overrides: ButtonBar
[mxmlc] scanning for overrides: DataGridButtonBar
[mxmlc] scanning for overrides: Group
[mxmlc] scanning for overrides: Spinner
[mxmlc] scanning for overrides: TextInput
[mxmlc] scanning for overrides: TitleBar
[mxmlc] scanning for overrides: ToolTip
[mxmlc] scanning for overrides: IGraphicShape
[mxmlc] scanning for overrides: GraphicShape
[mxmlc] scanning for overrides: ITransformHost
[mxmlc] scanning for overrides: IDrawable
[mxmlc] scanning for overrides: IRect
[mxmlc] scanning for overrides: Rect
[mxmlc] scanning for overrides: ChainBinding
[mxmlc] scanning for overrides: ChainWatcher
[mxmlc] scanning for overrides: IBinding
[mxmlc] scanning for overrides: ConstantBinding
[mxmlc] scanning for overrides: GenericBinding
[mxmlc] scanning for overrides: MXMLBeadViewDataBinding
[mxmlc] scanning for overrides: WatcherBase
[mxmlc] scanning for overrides: PropertyWatcher
[mxmlc] scanning for overrides: SimpleBinding
[mxmlc] scanning for overrides: ICollection
[mxmlc] scanning for overrides: ICollectionView
[mxmlc] scanning for overrides: LayoutData
[mxmlc] scanning for overrides: MarginData
[mxmlc] scanning for overrides: BorderStyles
[mxmlc] scanning for overrides: CSSTextField
[mxmlc] scanning for overrides: ClassFactory
[mxmlc] scanning for overrides: IContentView
[mxmlc] scanning for overrides: SimpleCSSStyles
[mxmlc] scanning for overrides: SimpleCSSStylesWithFlex
[mxmlc] scanning for overrides: IHandlesOriginalEvent
[mxmlc] scanning for overrides: CollectionEvent
[mxmlc] scanning for overrides: CustomEvent
[mxmlc] scanning for overrides: ItemAddedEvent
[mxmlc] scanning for overrides: ItemClickedEvent
[mxmlc] scanning for overrides: ItemRemovedEvent
[mxmlc] scanning for overrides: ItemRendererEvent
[mxmlc] scanning for overrides: Size
[mxmlc] scanning for overrides: ItemAndDescriptor
[mxmlc] scanning for overrides: SetEventHandler
[mxmlc] scanning for overrides: SetProperty
[mxmlc] scanning for overrides: CSSBorderUtils
[mxmlc] scanning for overrides: CSSUtils
[mxmlc

RE: Uploading files with parameters

2019-07-14 Thread Yishay Weiss
It could be enough to create a new model FileModelWithParams implements 
IFileModel which has blob() return FormData in JS. I don’t think you need 
FileUploaderWithParams because the present one reads the blob from the model 
anyway.




From: Piotr Zarzycki 
Sent: Sunday, July 14, 2019 2:54:18 PM
To: dev@royale.apache.org
Subject: Re: Uploading files with parameters

I just looked into  FileModel and IFileModel. FileUploader using FileModel,
but this is because IFileModel doesn't contains "blop" property - I think
IFileModel should contains such.

It is definitely worth to make FileUploader using IFileModel.

Next I could create bead FileUploaderWithParams extends FileUploader which
could use new interface IFileModelWithParams extends IFileModel.

Thoughts ?

Thanks,
Piotr

niedz., 14 lip 2019 o 13:41 Piotr Zarzycki 
napisał(a):

> Hi Yishay,
>
> Some comments inline.
>
> [1]  https://paste.apache.org/rk1ro
>
> sob., 13 lip 2019 o 14:06 Yishay Weiss 
> napisał(a):
>
>> Hi Piotr,
>>
>>
>>
>> The beads [1] you mentioned are supposed to implement FileReference
>> methods, that’s why I was asking about the flash way of doing it.
>>
>>
>>
> *We are doing it in following way [1].*
>
>
>>
>> Maybe this example [3] helps.
>>
>>
>>
> *Yes this example was very helpful and we are doing upload in exactly the
> same way. *
>
>
>>
>> As I understand the SO answers [2], they’re suggesting to either send the
>> params on the url or in a FormData.
>>
>>
>>
>> For the former solution you can add  bead
>> to the file proxy and then on blobChangedHandler() you can make a call like:
>>
>>
>>
>> myUploader.upload(url?param1=1¶m2=2)
>>
>>
>>
> *As you can see in my link [1] we are doing that in a way as you are
> suggesting in Flex. In Royale I would like to avoid completely such things
> like concatenating string in order to build url. That's way I have started
> this thread to make sure that I'm not missing some better way than this. It
> looks like I need to implement it. Thanks for confirmation actually.*
>
>
>>
>> If you want the latter solution you can create a new IFileModel bead with
>> params that would implement FormData on the JS side.
>>
>>
>>
>> It could be that FileUploader needs to be refacotred to read and
>> IFileModel instead of an IModel, and that blob() should be part of the
>> interface and return an Object.
>>
>>
>>
> *Once I jump into implementation I will take into account your
> suggestions.*
>
>
>>
>> Hope you understand when you look at the code, otherwise ask.
>>
>>
>>
>> Thanks.
>>
>>
>>
>> [1]
>> https://github.com/apache/royale-asjs/tree/develop/frameworks/projects/Network/src/main/royale/org/apache/royale/file/beads
>>
>> [2] https://stackoverflow.com/questions/15218292/xhr-sendfile-params
>>
>> [3] https://github.com/yishayw/Examples/blob/FileProxy/Examples.mxml
>>
>>
>>
>> 
>> From: Piotr Zarzycki 
>> Sent: Friday, July 12, 2019 8:50:53 PM
>> To: dev@royale.apache.org
>> Subject: Re: Uploading files with parameters
>>
>> Hi Yishay,
>>
>> I'm trying to achieve exactly what is in the link from SOF.
>>
>> Thanks,
>> Piotr
>>
>> On Fri, Jul 12, 2019, 7:35 PM Yishay Weiss 
>> wrote:
>>
>> > Can you show a flash snippet of what you’re trying to achieve? Would you
>> > be using FileReference in flash?
>> >
>> >
>> >
>> > 
>> > From: Piotr Zarzycki 
>> > Sent: Friday, July 12, 2019 4:02:13 PM
>> > To: dev@royale.apache.org
>> > Subject: Re: Uploading files with parameters
>> >
>> > Hi Harbs,
>> >
>> > I mean something like here [1] - I'm not sure if it answers to your
>> > question.
>> >
>> > [1] https://stackoverflow.com/questions/15218292/xhr-sendfile-params
>> >
>> > Thanks,
>> > Piotr
>> >
>> > pt., 12 lip 2019 o 14:58 Harbs  napisał(a):
>> >
>> > > Do you mean multipart or something else?
>> > >
>> > > > On Jul 12, 2019, at 3:44 PM, Piotr Zarzycki <
>> piotrzarzyck...@gmail.com
>> > >
>> > > wrote:
>> > > >
>> > > > Hey Guys,
>> > > >
>> > > > We are progressing with port Flex app to Royale. One of the feature
>> in
>> > > that
>> > > > app is uploading File to server sigh along with couple of additional
>> > > > parameters. I see that uploading is possible trough several beads
>> > > available
>> > > > here [1].
>> > > >
>> > > > Unfortunately non of them provides nice options to add as part of
>> the
>> > > > upload additional parameters.
>> > > >
>> > > > I'm going to implement FileUploaderWithParams bead where ability of
>> > > adding
>> > > > additional params as object will be handled.
>> > > >
>> > > > Is there anything that I'm missing here ?
>> > > >
>> > > > [1]
>> > > >
>> > >
>> >
>> https://github.com/apache/royale-asjs/tree/develop/frameworks/projects/Network/src/main/royale/org/apache/royale/file/beads
>> > > >
>> > > >
>> > > > Thanks,
>> > > > --
>> > > >
>> > > > Piotr Zarzycki
>> > > >
>> > > > Patreon: *https://www.patreon.com/piotrzarzycki
>> > > > 

Re: Uploading files with parameters

2019-07-14 Thread Piotr Zarzycki
I just looked into  FileModel and IFileModel. FileUploader using FileModel,
but this is because IFileModel doesn't contains "blop" property - I think
IFileModel should contains such.

It is definitely worth to make FileUploader using IFileModel.

Next I could create bead FileUploaderWithParams extends FileUploader which
could use new interface IFileModelWithParams extends IFileModel.

Thoughts ?

Thanks,
Piotr

niedz., 14 lip 2019 o 13:41 Piotr Zarzycki 
napisał(a):

> Hi Yishay,
>
> Some comments inline.
>
> [1]  https://paste.apache.org/rk1ro
>
> sob., 13 lip 2019 o 14:06 Yishay Weiss 
> napisał(a):
>
>> Hi Piotr,
>>
>>
>>
>> The beads [1] you mentioned are supposed to implement FileReference
>> methods, that’s why I was asking about the flash way of doing it.
>>
>>
>>
> *We are doing it in following way [1].*
>
>
>>
>> Maybe this example [3] helps.
>>
>>
>>
> *Yes this example was very helpful and we are doing upload in exactly the
> same way. *
>
>
>>
>> As I understand the SO answers [2], they’re suggesting to either send the
>> params on the url or in a FormData.
>>
>>
>>
>> For the former solution you can add  bead
>> to the file proxy and then on blobChangedHandler() you can make a call like:
>>
>>
>>
>> myUploader.upload(url?param1=1¶m2=2)
>>
>>
>>
> *As you can see in my link [1] we are doing that in a way as you are
> suggesting in Flex. In Royale I would like to avoid completely such things
> like concatenating string in order to build url. That's way I have started
> this thread to make sure that I'm not missing some better way than this. It
> looks like I need to implement it. Thanks for confirmation actually.*
>
>
>>
>> If you want the latter solution you can create a new IFileModel bead with
>> params that would implement FormData on the JS side.
>>
>>
>>
>> It could be that FileUploader needs to be refacotred to read and
>> IFileModel instead of an IModel, and that blob() should be part of the
>> interface and return an Object.
>>
>>
>>
> *Once I jump into implementation I will take into account your
> suggestions.*
>
>
>>
>> Hope you understand when you look at the code, otherwise ask.
>>
>>
>>
>> Thanks.
>>
>>
>>
>> [1]
>> https://github.com/apache/royale-asjs/tree/develop/frameworks/projects/Network/src/main/royale/org/apache/royale/file/beads
>>
>> [2] https://stackoverflow.com/questions/15218292/xhr-sendfile-params
>>
>> [3] https://github.com/yishayw/Examples/blob/FileProxy/Examples.mxml
>>
>>
>>
>> 
>> From: Piotr Zarzycki 
>> Sent: Friday, July 12, 2019 8:50:53 PM
>> To: dev@royale.apache.org
>> Subject: Re: Uploading files with parameters
>>
>> Hi Yishay,
>>
>> I'm trying to achieve exactly what is in the link from SOF.
>>
>> Thanks,
>> Piotr
>>
>> On Fri, Jul 12, 2019, 7:35 PM Yishay Weiss 
>> wrote:
>>
>> > Can you show a flash snippet of what you’re trying to achieve? Would you
>> > be using FileReference in flash?
>> >
>> >
>> >
>> > 
>> > From: Piotr Zarzycki 
>> > Sent: Friday, July 12, 2019 4:02:13 PM
>> > To: dev@royale.apache.org
>> > Subject: Re: Uploading files with parameters
>> >
>> > Hi Harbs,
>> >
>> > I mean something like here [1] - I'm not sure if it answers to your
>> > question.
>> >
>> > [1] https://stackoverflow.com/questions/15218292/xhr-sendfile-params
>> >
>> > Thanks,
>> > Piotr
>> >
>> > pt., 12 lip 2019 o 14:58 Harbs  napisał(a):
>> >
>> > > Do you mean multipart or something else?
>> > >
>> > > > On Jul 12, 2019, at 3:44 PM, Piotr Zarzycki <
>> piotrzarzyck...@gmail.com
>> > >
>> > > wrote:
>> > > >
>> > > > Hey Guys,
>> > > >
>> > > > We are progressing with port Flex app to Royale. One of the feature
>> in
>> > > that
>> > > > app is uploading File to server sigh along with couple of additional
>> > > > parameters. I see that uploading is possible trough several beads
>> > > available
>> > > > here [1].
>> > > >
>> > > > Unfortunately non of them provides nice options to add as part of
>> the
>> > > > upload additional parameters.
>> > > >
>> > > > I'm going to implement FileUploaderWithParams bead where ability of
>> > > adding
>> > > > additional params as object will be handled.
>> > > >
>> > > > Is there anything that I'm missing here ?
>> > > >
>> > > > [1]
>> > > >
>> > >
>> >
>> https://github.com/apache/royale-asjs/tree/develop/frameworks/projects/Network/src/main/royale/org/apache/royale/file/beads
>> > > >
>> > > >
>> > > > Thanks,
>> > > > --
>> > > >
>> > > > Piotr Zarzycki
>> > > >
>> > > > Patreon: *https://www.patreon.com/piotrzarzycki
>> > > > *
>> > >
>> > >
>> >
>> > --
>> >
>> > Piotr Zarzycki
>> >
>> > Patreon: *https://www.patreon.com/piotrzarzycki
>> > *
>> >
>>
>
>
> --
>
> Piotr Zarzycki
>
> Patreon: *https://www.patreon.com/piotrzarzycki
> *
>


-- 

Piotr Zarzycki

Patreon: *https://www.patreon.com/piotrzarzycki


Re: Uploading files with parameters

2019-07-14 Thread Piotr Zarzycki
Hi Yishay,

Some comments inline.

[1]  https://paste.apache.org/rk1ro

sob., 13 lip 2019 o 14:06 Yishay Weiss  napisał(a):

> Hi Piotr,
>
>
>
> The beads [1] you mentioned are supposed to implement FileReference
> methods, that’s why I was asking about the flash way of doing it.
>
>
>
*We are doing it in following way [1].*


>
> Maybe this example [3] helps.
>
>
>
*Yes this example was very helpful and we are doing upload in exactly the
same way. *


>
> As I understand the SO answers [2], they’re suggesting to either send the
> params on the url or in a FormData.
>
>
>
> For the former solution you can add  bead to
> the file proxy and then on blobChangedHandler() you can make a call like:
>
>
>
> myUploader.upload(url?param1=1¶m2=2)
>
>
>
*As you can see in my link [1] we are doing that in a way as you are
suggesting in Flex. In Royale I would like to avoid completely such things
like concatenating string in order to build url. That's way I have started
this thread to make sure that I'm not missing some better way than this. It
looks like I need to implement it. Thanks for confirmation actually.*


>
> If you want the latter solution you can create a new IFileModel bead with
> params that would implement FormData on the JS side.
>
>
>
> It could be that FileUploader needs to be refacotred to read and
> IFileModel instead of an IModel, and that blob() should be part of the
> interface and return an Object.
>
>
>
*Once I jump into implementation I will take into account your suggestions.*


>
> Hope you understand when you look at the code, otherwise ask.
>
>
>
> Thanks.
>
>
>
> [1]
> https://github.com/apache/royale-asjs/tree/develop/frameworks/projects/Network/src/main/royale/org/apache/royale/file/beads
>
> [2] https://stackoverflow.com/questions/15218292/xhr-sendfile-params
>
> [3] https://github.com/yishayw/Examples/blob/FileProxy/Examples.mxml
>
>
>
> 
> From: Piotr Zarzycki 
> Sent: Friday, July 12, 2019 8:50:53 PM
> To: dev@royale.apache.org
> Subject: Re: Uploading files with parameters
>
> Hi Yishay,
>
> I'm trying to achieve exactly what is in the link from SOF.
>
> Thanks,
> Piotr
>
> On Fri, Jul 12, 2019, 7:35 PM Yishay Weiss  wrote:
>
> > Can you show a flash snippet of what you’re trying to achieve? Would you
> > be using FileReference in flash?
> >
> >
> >
> > 
> > From: Piotr Zarzycki 
> > Sent: Friday, July 12, 2019 4:02:13 PM
> > To: dev@royale.apache.org
> > Subject: Re: Uploading files with parameters
> >
> > Hi Harbs,
> >
> > I mean something like here [1] - I'm not sure if it answers to your
> > question.
> >
> > [1] https://stackoverflow.com/questions/15218292/xhr-sendfile-params
> >
> > Thanks,
> > Piotr
> >
> > pt., 12 lip 2019 o 14:58 Harbs  napisał(a):
> >
> > > Do you mean multipart or something else?
> > >
> > > > On Jul 12, 2019, at 3:44 PM, Piotr Zarzycki <
> piotrzarzyck...@gmail.com
> > >
> > > wrote:
> > > >
> > > > Hey Guys,
> > > >
> > > > We are progressing with port Flex app to Royale. One of the feature
> in
> > > that
> > > > app is uploading File to server sigh along with couple of additional
> > > > parameters. I see that uploading is possible trough several beads
> > > available
> > > > here [1].
> > > >
> > > > Unfortunately non of them provides nice options to add as part of the
> > > > upload additional parameters.
> > > >
> > > > I'm going to implement FileUploaderWithParams bead where ability of
> > > adding
> > > > additional params as object will be handled.
> > > >
> > > > Is there anything that I'm missing here ?
> > > >
> > > > [1]
> > > >
> > >
> >
> https://github.com/apache/royale-asjs/tree/develop/frameworks/projects/Network/src/main/royale/org/apache/royale/file/beads
> > > >
> > > >
> > > > Thanks,
> > > > --
> > > >
> > > > Piotr Zarzycki
> > > >
> > > > Patreon: *https://www.patreon.com/piotrzarzycki
> > > > *
> > >
> > >
> >
> > --
> >
> > Piotr Zarzycki
> >
> > Patreon: *https://www.patreon.com/piotrzarzycki
> > *
> >
>


-- 

Piotr Zarzycki

Patreon: *https://www.patreon.com/piotrzarzycki
*