[flexcoders] Re: TileList Loading shows duplicate ArrayCollection?
Hi Kevin, (BTW, my flexcoders filter looks for various keywords in the subject like DataServices, Livecycle, etc. so I missed this one originally) Are you using paging with your filled collection? If you are not paging, we return the entire collection in one batch. We do dispatch collection events as we are walking through the collection. The UI controls should be watching these events and invalidating their display lists as necessary but the revalidation occurs during the next enter frame event. I don't think it is possible for the redisplay to occur in the middle of us processing the fill result however so it seems like more likely you are paging in values if you are seeing visual artifacts as the data comes in. Turning off paging might improve the display but obviously would have other side effects. If paging is on, we send the collection events as each page comes in (replacing NULL with the item for each index in the ArrayCollection). So unfortunately the only way to listen for these events is the same way the TileList listens for them. you could always listen for these events and use some trigger as the means to set the dataProvider for the TileList. Or I think I sent you my NotPendingCollection.as class which can be used as a means to suppress pending errors altogether... putting that between the TileList and the ArrayCollection might yield better behavior. When you are processing pushed changes from the server, you do have more control. You can turn off autoMerge. The pushed changes then queue up on the client until you call dataStore.merge(). At that point all pending changes are applied. Again, this method should invalidate the display list of any UI controls but the actual rendering will take place in the next enter frame event which should occur after all of the merged changes have been applied. Jeff --- In flexcoders@yahoogroups.com, Kevin [EMAIL PROTECTED] wrote: I am getting some odd behavior from the TileList when loading and ArrayCollection from the server. I am not sure if this is an actionscript issue OR the way Data Services serializes the collections. I have bound the DataProvider of my TileList to a paged collection that get's automatically lazy loaded from the server. When the collection comes in, you can see the TileList load with double the amount of records and then eventually redraw with the correct list. 1. Can I listen for the completed load from the server and then draw my TileList then? It seems in efficient (if not dangerous) to keep drawing the TileList as the collection update. I also would want to disable the TileList when new loads are getting pushed to the client. (These seem to be causing redraw issues.) 2. Can I monitor the progress of the collection as it fills from the server and create a progress monitor. Presumably we know how many we are expecting because data services pulls in the id's. Is there a way to then monitor the load in realtime. OR 3. Is this a problem in TileList and how the TileList lays out it's children? Is it best practice to hide the component until all the children are laid out to avoid this. Thanks for the input on this one. - Kevin
[flexcoders] Re: FDS ManualSync and AS [Managed] Metadata
--- In flexcoders@yahoogroups.com, Jeff Glass [EMAIL PROTECTED] wrote: I have some questions about manual sync with LCDS 2.5.1. --- In flexcoders@yahoogroups.com, Jeff Vroom jvroom@ wrote: One other difference is that the refresh fill process - i.e. where the server refreshes fill methods after an insert or update or explicit refreshFill call is made on the server does not work with manual sync. Since the server has no knowledge of what fills each client is actively managing and does not cache its current set of ids, it can't refresh it. But the assembler doesn't know what fills are active, either. Or am I missing something? The assembler can keep track of a client's initial use of a fill (by saving the fillParams argument to the assembler's fill method), but can the assembler get notification when the fill is no longer being used (e.g., when the client goes away)? Yes, this is the case. The auto sync mechanism is what keeps track of which fills clients are looking at specifically. You would have to duplicate this logic and it is not trivial. To solve this generally is a bit tricky - you need to watch when fills are made, associate them with a session and remove that when the session expires. You might also need to add a remote object call to release the collection if the client stops looking at the results of that query. There could be short cuts based on how your app uses queries and what changes might affect those queries. Clearly this is something we need to address by supporting the paged fill functionality with auto-sync=true. You can still update queries by using the DataServiceTransaction.addItemToFill and removeItemFromFill methods. In my experimentation, you have to call addItemToFill and removeItemFromFill with the *exact* fill parameters (unlike the matching that is done by refreshFill). Hence the need to keep track of which fills are active. Also, in my experimentation, the client only seems to get the collection-change event if the addItemToFill call has position=-1. Is that expected? In my application, the fills have a sort value, meaning that the new item could be in different positions in different fills anyway, so what I think the client should do is to just start the fill over again when an item is created. How would the assembler notify the client that it should do that? (That is, how do I get something similar to a refreshFill method returning EXECUTE_FILL in the auto-sync case?) This sounds like a bug which is fixed in a hotfix we have. I think that the addItemToFill method would fail if the index was not -1 and there was no sequence. Again, we just don't have a great way to refresh an entire sequence when auto sync is false. It sounds like you really need the auto- sync=true with the paged fill support. Of course the other server side methods updateItem, createItem, and deleteItem also still work though make sure that any use of these apis also supply the producerSubtopics or producerDefaultHeaders needed to route these changes to the right clients. What exactly are createItem and deleteItem good for in the manual- sync case? They're not pushing anything to the clients. You can route createItem messages to other clients but you also need to push some updateCollection or updateItem to add a reference to that item for it to show up someplace. The deleteItem should just be handled automatically... when a delete is pushed to a client, it is automatically removed from any refernces.
[flexcoders] Re: Urgent call for Flex Portlet (Flex Taglibs) specialists (James Ward, help!)
I'm not sure why this is happening unfortunately. In both of those stack traces, the line of code looks like: String uri = request.getRequestURL().toString(); So either request is null or the request.getRequestURL() method is returning null? I'm not sure why either of those would happen. Jeff --- In flexcoders@yahoogroups.com, johan.wasserman johan.wasserman@ wrote: I have tried and tried, fried my brain, and I am desperate. I firstly wrote a simple portlet and tried to present a flex page on JBoss portal, unsuccessfull because of the - java.lang.NullPointerException at flex.server.j2ee.cache.CacheKeyUtils.generateJspCacheKe (CacheKeyUtils.java:68) OR generateSwfCacheKey(CacheKeyUtils.java:54) if I try to show the mxml file directly, without going through the taglib. - error. Then, with effort, learned how another portal server works, I inastalled and configured Jetspeed 2, and after trying just about every trick in the book, had to give up and realised the same - java.lang.NullPointerException at flex.server.j2ee.cache.CacheKeyUtils.generateJspCacheKey (CacheKeyUtils.java:68) - error haunting me. I have a simple, yet urgent requirement, I need to make Flex applications available as portlets, on (prefferably) an Appache opensource portal server. PLEASE will SOMEONE help me?! I'll send my JBoss and / or Jetspeed 2 installation, zipped, so you can have the full config and everything I have done, I'll send the MySQL databases for these portal servers, ANYTHING, just say what you need. The only common denominator is that both these portal servers are based on Apache Tomcat PLEASE PLEASE ASSIST.
[flexcoders] Re: Lost commit on data source with polling AMF
What is happening here is that the latency introduced by the poll is causing the client to receive the response from its commit before a previously queued pushed message to that client. By the time it receives the pushed message, it is stale - i.e. the previous version is not accurate anymore. We should be sending those queued messages to the client before the client processes the response to its operation. Thus the client would receive notification of the conflict two times in this case but it would be the same conflict so you would only have to resolve it once. The only workaround I can think of right now is to resolve that second (stale) conflict using acceptClient without reporting it to the user. The problem though is knowing when this is a stale conflict versus a real new conflict. There is a timestamp in the message which theoretically could be used to detect that but it is pretty tricky so I'm not sure I'd recommend trying this workaround. I am working on a fix now... once it is ready we could investigate the possibility of turning it into a hotfix. Sorry for the problems and thanks for reporting this issue. Jeff -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links * To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ * Your email settings: Individual Email | Traditional * To change settings online go to: http://groups.yahoo.com/group/flexcoders/join (Yahoo! ID required) * To change settings via email: mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
[flexcoders] Re: fill() with multiple ArrayCollections
The deleteItem method implies you want to delete the method from all collections it lives in so I would not use that at all to remove the item from a group. Usually, there is a property on the item itself which indicates which group it is in. You might just set that property to null and commit that change. If you have autoRefresh enabled for your fills, they would be reinvoked to refresh their contents. The first one would still return the item, but the second one would no longer return the item because the item's group property was not set to that value anymore. This assumes that the fill to retrieve a group's members is made on a query against properties on the item in the group. It is also possible that the group membership is maintained by some separate table which is not part of the state of the item in the group. In this case, the other way you can do this is to implement the flex.data.assemblers.Assembler interface (if you are not already) and override the removeItemFromFill method. Then on the client, you just remove the item from the second collection using one of the ArrayCollection.removeItem or removeItemAt methods. When you commit, your Assembler.removeItemFromFill method should be called which you can use to update that other table. Jeff --- In flexcoders@yahoogroups.com, dreuimar [EMAIL PROTECTED] wrote: Hi everyone, In FDS I have a Java class that with no parameters fills an ArrayCollection with all possible items, and by passing a parameter (such as a group number) another ArrayCollection is filled with what items have been 'added' to a particular group. Now this assembler obviously has a deleteItem method. When an item is deleted from the master list it should delete from both with FDS, and it is. The problem I'm having is that when someone deletes something from one of these 'groups' I just want it deleted from that group, rather than from the whole database. Any ideas on how to pass parameters to deleteItem() without putting some property in the object or what I could do about this? (I think deleteItem only supports an object as a param. -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links * To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
[flexcoders] Re: FDS - how do I manage a single item?
Either with dataService.getItem, if the item exists and you have its id or dataService.createItem if the item does not exist and you want to create a new one. If you need to actually execute a query to retrieve the item (e.g. you are trying to retrieve a User by the lastName), you have to use the fill method to pass in the parameters and just have that fill method return a Collection with just one item. In this case, the fill method returns an AsyncToken whose responder will be called when the fill results are returned to the client. At that point, you could look at the filled array collection and call getItemAt(0) to get the first item in the list. Jeff --- In flexcoders@yahoogroups.com, Dmitry Miller [EMAIL PROTECTED] wrote: I have a managed class. [Managed] class User { } and in the main application .mxml file I have a reference of this type that I want to manage by a data service i.e. mx:DataService id=ds destination=userSvc / mx:Script [Bindable] public var me:User; /mx:Script Now, how do I get to populate variable me and get it maneged by userSvc? Thanks, --- Dmitry -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links * To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
[flexcoders] Re: FDS: Can I disconnect a specific client from the server?
It looks like this is something we (Adobe) are going to need to improve upon though there is a workaround for now. First off a little background info. There are two different ways you can manage subscription timeouts with FDS. If you set the session- timeout on the destination to 0, FDS ties the subscription for a given client to the flex session's lifecycle. If your destination is setup this way, invalidating the session will remove the subscription for that consumer (this is the same as calling consumer.disconnect on the client). This has the effect of disconnecting the consumer, and if that consumer is the last service using a given channel it will drop the connection. Unfortunately this will not disconnect the producer and usually a client will have both a producer and consumer using the same channel. So you'd still need to send a message to the client to tell it to disconnect the producer (as well as any other services using the channel). Also, this assumes a cooperative SWF and does not address the hacked swf which can ignore this message. Note however that for now at least there is a workaround for this hacked SWF case. If you throw a runtime exception from the code which is handling a message, the RTMP channel is closed which will prevent the malicious SWF from continuing to use that connection. This is a short-term workaround at best and that behavior might change in the future (since it is not clear you always want an RTE to abort the connection). I think we need to provide a more reliable way for the server to unconditionally close the RTMP connection for a given client and this is likely serious enough to warrant a hotfix in the near future. If you set an explicit session-timeout for the destination or leave it as the default (20 minutes), the subscription is not tied to the session and invalidating the session does not affect the consumer's subscription or connection state. Jeff Vroom --- In flexcoders@yahoogroups.com, Dave Wolf [EMAIL PROTECTED] wrote: More reason to simply destroy their J2EE session which would let the container enforce the ban. -- Dave Wolf Cynergy Systems, Inc. Adobe Flex Alliance Partner http://www.cynergysystems.com http://www.cynergysystems.com/blogs Email: [EMAIL PROTECTED] Office: 866-CYNERGY --- In flexcoders@yahoogroups.com, Tom Bray tombray@ wrote: That would work if we could trust that our SWF hasn't been hacked. We have people trying to hack our clients all the time and they're often the ones we want to disconnect in the first place. If we relied on the client to disconnect itself, these guys would prevent that message from getting through. -Tom On 7/23/06, James Ward jamesw@ wrote: I can't find anything in the api: http://livedocs.macromedia.com/flex/2/fds2javadoc/index.html However, this could be easily achived my sending a message to the flex client (via messaging) which told the flex app to disconnect. -James On Sat, 2006-07-22 at 14:28 -0700, Tom Bray wrote: No, I'm talking about disconnecting on the server-side with Java. In other words, getting a reference to the server-side client object using the FDS API and disconnecting it. -Tom On 7/22/06, James Ward jamesw@ jamesw%40cayambe.com wrote: Yup. Look into the disconnect() method on Consumer and DataService objects. http://livedocs.macromedia.com/flex/2/langref/mx/messaging/Consumer.ht ml#disconnect () http://livedocs.macromedia.com/flex/2/langref/mx/data/DataService.html #disconnect () -James On Fri, 2006-07-21 at 14:07 -0700, Tom Bray wrote: I'm coming to FDS from FMS2 where I have the ability to disconnect any client for any reason -- say after a period of inactivity or because an administrator of the chat has banned a user. Can I do this in FDS? Thanks, Tom -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links * To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/