Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

LCCS and Sourceforge...

Avatar

Level 3

Is LCCS going to be a part of the newly announce Sourceforge/Adobe partnership?

It would be great if there was a better way for me to submit patches than to post them here. RIght now I'm in the process of reworking SharedCollection to fix some of it's limitations.

For now I'll continue to post patches here.

-sandy

5 Replies

Avatar

Level 10

Hi Sandy,

At this time, no, we're not quite ready for the extra manpower it would

take to monitor patches - we're still too busy adding new features (coming

soon, weeks not months!).

That said, we're always interested in work you might be doing - what are

you changing in SharedCollection and why? With your permission, if it's

something we might want to bake into the platform, we'd definitely be

receptive to it.

thanks for your interest!

nigel

Avatar

Level 3

hey Nigel,

SharedCollection has some wonky stuff going on:

SharedCollection:onItemReceive:353

This code updates changes that were made in an object in the collection.

for (i in newItem) {

if (newItem[i]!=oldItem[i]) {

var tmpOldValue:Object = oldItem[i];

oldItem[i] = newItem[i];

itemUpdated(oldItem, i, tmpOldValue, oldItem[i]);

}

}

Problem:

for..in loops only iterate over dynamically added properties. So, if the type of newItem is, for instance, puzzlePieceVO, then none of the properties are iterated over. So we can only use SharedCollection for a collection of Objects with an idField. (Which is how SharedCollectionExample uses it.)

Solution:

In addition to the for..in loop, use describe type to get a list of the properties and accessor and iterate over them for update. This isn't great because I'd guess that describe type is pretty slow. We can cache the types if that becomes an issue.

The other, more subtle issue is in SharedCollection:getItemID:406

var testID:String = (p_item is IUID) ? IUID(p_item).uid : p_item[idField] as String;

Problem:

Since, onItemReceive only works with types of Object, (p_item is IUID) will always evaluate to False.

Solution:

Change the code to:

var itemID:String = p_item.hasOwnProperty('uid') ? p_item['uid'] : p_item[idField] as String;

If we do that, and use VOs created from the items, then we can use this (mostly) as documented.

Now it'll work with the VOs and when we fix onItemReceive, it will continue working.

I'd love to hear your feedback on my proposed changes.

-sandy

Avatar

Level 3

Nigel,

My patch for SharedCollection has some unit tests along with it.

Is there anyway for me to send you guys a file? I'm not seeing an "Attach File" button here in the forum.

-sandy

Avatar

Employee

I see an "Attach Files" button at the bottom of the edit box. Not sure if it only shows up to moderators.

Avatar

Level 3

I don't see one. Looks like it's moderators only.

That's alright, I put the source inline in a post for now. The tests/test support code isn't there, but at least the SharedCollection is.

You can find it here: http://forums.adobe.com/thread/683295?tstart=0