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 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. * 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 * The Map returned implements the Scriptable interface to allow access to the assoc arrays via JavaScript

View File

@@ -167,6 +167,8 @@ public class InMemoryTicketComponentImpl implements TicketComponent
if (sessionId != null) if (sessionId != null)
{ {
Ticket ticketObj = ticketsCache.get(ticketKey); Ticket ticketObj = ticketsCache.get(ticketKey);
if (ticketObj != null)
{
ticketObj = ticketObj.removeSessionId(sessionId); ticketObj = ticketObj.removeSessionId(sessionId);
if (ticketObj == null) if (ticketObj == null)
{ {
@@ -177,6 +179,7 @@ public class InMemoryTicketComponentImpl implements TicketComponent
ticketsCache.put(ticketKey, ticketObj); ticketsCache.put(ticketKey, ticketObj);
} }
} }
}
else else
{ {
ticketsCache.remove(ticketKey); ticketsCache.remove(ticketKey);

View File

@@ -28,8 +28,10 @@ import java.io.Serializable;
import java.io.StringReader; import java.io.StringReader;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Set;
import org.alfresco.model.ContentModel; import org.alfresco.model.ContentModel;
import org.alfresco.service.ServiceRegistry; import org.alfresco.service.ServiceRegistry;
@@ -336,6 +338,23 @@ public class TemplateNode extends BasePermissionsNode implements NamespacePrefix
return getChildAssocs(); return getChildAssocs();
} }
/**
* @return The list of children of this Node that match a specific object type.
*/
public List<TemplateNode> getChildAssocsByType(String type)
{
Set<QName> types = new HashSet<QName>(1, 1.0f);
types.add(createQName(type));
List<ChildAssociationRef> refs = this.services.getNodeService().getChildAssocs(this.nodeRef, types);
List<TemplateNode> nodes = new ArrayList<TemplateNode>(refs.size());
for (ChildAssociationRef ref : refs)
{
String qname = ref.getTypeQName().toString();
nodes.add( new TemplateNode(ref.getChildRef(), this.services, this.imageResolver) );
}
return nodes;
}
/** /**
* @return true if the node is currently locked * @return true if the node is currently locked
*/ */
@@ -520,6 +539,27 @@ public class TemplateNode extends BasePermissionsNode implements NamespacePrefix
return this.imageResolver; return this.imageResolver;
} }
/**
* Helper to create a QName from either a fully qualified or short-name QName string
*
* @param s Fully qualified or short-name QName string
*
* @return QName
*/
private QName createQName(String s)
{
QName qname;
if (s.indexOf(NAMESPACE_BEGIN) != -1)
{
qname = QName.createQName(s);
}
else
{
qname = QName.createQName(s, this.services.getNamespaceService());
}
return qname;
}
// ------------------------------------------------------------------------------ // ------------------------------------------------------------------------------
// Inner classes // Inner classes