Merged V3.2E to HEAD

17429: Fixed ETHREEOH-2319 "Share - Sticky image or videos in web view"
   17435: Fixed EETHREEOH-3325 "Add group button is disabled on Admin Console - New User page"
   17445: Fixed ETHREEOH-3306 "Large number of root groups causes Groups admin tool to lockup the sever and Share" 
          - Search panel is now the default panel and the loading of root groups only occurs if you click the "Browse" button and change to the browse panel
   17446: Fix for unreported issue where the InMemoryTicketComponent did not check for null value from ticketsCache.
          Can occur on tomcat sesson expire and caused NPE to be logged.
   17449: Merged V3.1 to V3.2
      17257: *RECORD ONLY* Merged V3.2 to V3.1
         13685: ACT 8490 - TinyMCE fails if told to load unsupported language (interim fix only) (ETHREEOH-1615)
      17372: First part of fix for ETHREEOH-2519.
      17448: Merged DEV-TEMPORARY to V3.1
         17390: ETHREEOH-1619: Letters and special symbols can be typed in Date value of property while creation of Content Rule and it leads to error
      17391: ETHREEOH-1058: It is possible to send invite email message with no subject from Web Project Wizard Step Seven - Email Users page
             ETHREEOH-1060: It is possible to send empty invitation email from Web Project Wizard Step Seven - Email users page
   17452: Fixed ETHREEOH-3306 "Large number of root groups causes Groups admin tool to lockup the sever and Share" part 2 
          - A "no result"-message was displayed to the user even though no search had been performed, now replaced by a usage message
   17453: Fixed ETHREEOH-2329 " Search doesn't work correctly on Groups page"
   17454: Fix for ETHREEOH-3084 - Error message appears in My Web Files part of My Alfresco Dashboard after configuring of the dashboard.
          - added new JavaScript and Template APIs to retrieve child nodes of a specific type - using fast direct DB NodeService call.
   17455: Fixed ETHREEOH-2329 " Search doesn't work correctly on Groups page" part 2
          - Added the prefix "*" to admin console group search as well to make it consistent

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@18122 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Kevin Roast
2010-01-19 11:23:38 +00:00
parent d34a495871
commit 86b95d1059
3 changed files with 72 additions and 7 deletions

View File

@@ -715,6 +715,28 @@ public class ScriptNode implements Serializable, Scopeable, NamespacePrefixResol
return getChildAssocs();
}
/**
* Return an Array of the associations from this Node that match a specific object type.
* <code>node.getChildAssocsByType("cm:folder")[0]</code>
*
* @return Array of child associations from this Node that match a specific object type.
*/
@SuppressWarnings("unchecked")
public Scriptable getChildAssocsByType(String type)
{
// get the list of child assoc nodes for each association type
Set<QName> types = new HashSet<QName>(1, 1.0f);
types.add(createQName(type));
List<ChildAssociationRef> refs = this.nodeService.getChildAssocs(this.nodeRef, types);
Object[] nodes = new Object[refs.size()];
for (int i=0; i<nodes.length; i++)
{
ChildAssociationRef ref = refs.get(i);
nodes[i] = newInstance(ref.getChildRef(), this.services, this.scope);
}
return Context.getCurrentContext().newArray(this.scope, nodes);
}
/**
* Return the parent associations to this Node. As a Map of assoc name to a JavaScript array of Nodes.
* The Map returned implements the Scriptable interface to allow access to the assoc arrays via JavaScript