Merged V3.4-BUG-FIX to HEAD

30744: ALF-9524: WCM: Defining a complex type with 'abstract' attribute to true does not allow other complex types to define elements with the same name 
      - Fix by Pavel
   30804: ALF-9524: Fix to NPE by Pavel
   30812: ALF-718: Rules Fire Emails before Transaction Commit/Rollback
   Added tests and moved email sending into a post commit callback.
   30820: Fix for ALF-10516 - 'My Sites' dashlet should indicate it is loading rather than say 'No sites'
   30824: Fixed ALF-10470: DeclaritiveRegistry is looping continuously and re-initializing
    - Only replicate removals for the cache.  The reset always does a remove first.
       <cache 
           name="org.alfresco.cache.webScriptsRegistryCache"
                                    ...
                                    replicateUpdates = false,
                                    ...
       </cache>
   30827: ALF-10513 60k Site Performance: Unable to delete user + request not acknowledged for 2 minutes
     Now about 3 to 4 seconds
   30828: Andy H recommended change to lucene indexer values
   30831: ALF-718: Fix for InvitationServiceImplTest
   Fixes behaviour broken by original fix for ALF-718: the send-after-commit does NOT work for the invitation service, so it was necessary
   to change the code to only send-after-commit in the context of a rule.  
   30843: Fixed ALF-7698 "Defects in tags picker in SHARE." according to feedback provided in ALF-9953 "Decide order where new items shall appear in the object finder."
   30844: ALF-9544 - Inbound email restricts file name to 86 characters or less.
     used QName.createQNameWithValidLocalName()  as suggested.
     added new EmailServiceImplTest
   30849: Fixed ALF-8776 "Rule details dialog handling of apostrophes"
   30862: Merged DEV/TEMPORARY to V3.4-BUG-FIX (with improvements)
      30856: ALF-10288: Regression of ALF-1997: non domain users cannot bypass SSO in Share using /share/page?pt=login
         In SSOAuthenticationFilter.doFilter() method added check (PAGE_SERVLET_PATH.equals(req.getServletPath()) && LOGIN_PATH_INFORMATION.equals(req.getPathInfo()).
   30864: SMTP Server, To and From address format.
     - Out standards for from and to address were stuck in the 1980s!
   30867: ALF-10517 - 'My Content' slow
    - performance improvements by reworking Lucene queries used to retrieve recently modified and recently created content for a user
    - converted queries to fts-alfresco
    - improvements from 3.5sec per page render down to 1.1 secs
   30874: MERGE DEV to V3.4-BUG-FIX
         30851 : ALF-9558 - Unchecked Return Value
   30882: - ScriptGroup.isRootGroup() now stops if it finds a single parent rather than doing a size on all parent groups.
     Not sure the logic (not changed by me) is correct as it includes parents that are site groups.
   - SiteServiceImpl now only gets the specified number of sites. Sometimes it would have return more if AuthorityDAOImpl
     switched approach used to get containing authorities.
   - Overloaded getContainingAuthorities to take a size parameter, deprecated other and switched calling code
     Done for isRootGroup activity.
   30910: - Fix build error
   - Found a better way to use filter in AuthorityDAOImpl.getContainingAuthoritiesInZone
     so that we don't need to reset the filter, by using the +ve hits from first approach
     if we switch to second approach.
   30925: - ALF-10501 60k Site Performance: Searching for a group to add to a site with a value that matches a few sites takes 2 minutes
     ALF-10502 60k Site Performance: Admin Console | Groups: search with a value that matches a few sites takes 70 seconds
     ALF-10504 60k Site Performance: Admin Console | Groups | Browse Groups page appears corrupt as it never finishes loading
     - All the above were slow as a result of ScriptGroup.isRootGroup()
     - ScriptGroup.isRootGroup() and ScriptGroup.isAdminGroup() removed - Checked with KevinR that these are not needed any more.
     - Removed code added on 30 Sep 11 to support isRootGroup (the size parameter to AuthorityDAO.getContainingAuthorities)

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@30935 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alan Davis
2011-10-03 16:23:14 +00:00
parent 1a5408636e
commit 447394297c
3 changed files with 29 additions and 43 deletions

View File

@@ -6,10 +6,6 @@
"shortName": "${authority.shortName}", "shortName": "${authority.shortName}",
"fullName": "${authority.fullName}", "fullName": "${authority.fullName}",
"displayName": "${authority.displayName}", "displayName": "${authority.displayName}",
<#-- Group specific properties -->
<#if authority.rootGroup??>"isRootGroup": ${authority.rootGroup?string("true", "false")},</#if>
<#if authority.adminGroup??>"isAdminGroup": ${authority.adminGroup?string("true", "false")},</#if>
<#-- end of group specific properties -->
<#if authority.authorityType = "GROUP"> <#if authority.authorityType = "GROUP">
"url": "/api/groups/${authority.shortName?url}" "url": "/api/groups/${authority.shortName?url}"
</#if> </#if>

View File

@@ -6,23 +6,38 @@ function getContents(user, type, maxResults)
{ {
return (number < 10) ? '0' + number : number; return (number < 10) ? '0' + number : number;
} }
//set range to within last 28 days //set range to within last 28 days
var date = new Date(); var date = new Date();
var toQuery = date.getFullYear() + "\\-" + padZeros((date.getMonth()+1)) + "\\-" + padZeros(date.getDate()); var toQuery = date.getFullYear() + "-" + padZeros((date.getMonth()+1)) + "-" + padZeros(date.getDate());
date.setDate(date.getDate() - 28); date.setDate(date.getDate() - 28);
var fromQuery = date.getFullYear() + "\\-" + padZeros((date.getMonth()+1)) + "\\-" + padZeros(date.getDate()); var fromQuery = date.getFullYear() + "-" + padZeros((date.getMonth()+1)) + "-" + padZeros(date.getDate());
var userType = (type == 'created') ? 'creator' : 'modifier';
var query = "+PATH:\"/app:company_home/st:sites/*//*\"" + var userProperty = (type == 'created') ? 'creator' : 'modifier';
" +@cm\\:" + userType + ":\"" + user + "\"" + var query = 'PATH:"/*/st:sites/*/*//*" ' +
" +@cm\\:" + type + ":[" + fromQuery + "T00\\:00\\:00 TO " + toQuery + "T23\\:59\\:59]" + 'AND +@cm:' + userProperty + ':"' + user + '" ' +
" +TYPE:\"cm:content\"" + 'AND +@cm:' + type + ':["' + fromQuery + '" TO "' + toQuery + '"] ' +
" -TYPE:\"dl:dataListItem\"" + 'AND +TYPE:"cm:content" ' +
" -TYPE:\"cm:thumbnail\""; 'AND -TYPE:"ia:calendarEvent" ' +
'AND -TYPE:"dl:dataListItem" ';
var nodes = search.luceneSearch(query, "@cm:" + type, false, maxResults); // perform fts-alfresco language query
//reset processed results (in search.lib.js) var sortColumns = [];
sortColumns.push(
{
column: "@" + utils.longQName("cm:" + type),
ascending: false
});
var queryDef = {
query: query,
language: "fts-alfresco",
page: {maxItems: maxResults},
onerror: "no-results",
sort: sortColumns
};
var nodes = search.query(queryDef);
// reset processed results (in search.lib.js)
processedCache = {} processedCache = {}
return processResults(nodes, maxResults); return processResults(nodes, maxResults);
} }

View File

@@ -210,7 +210,6 @@ public class GroupsTest extends BaseWebScriptTest
JSONArray data = top.getJSONArray("data"); JSONArray data = top.getJSONArray("data");
assertTrue(data.length() >= 3); assertTrue(data.length() >= 3);
boolean gotRootGroup = false; boolean gotRootGroup = false;
boolean gotAdminGroup = false;
boolean gotEmailGroup = false; boolean gotEmailGroup = false;
@@ -223,22 +222,14 @@ public class GroupsTest extends BaseWebScriptTest
assertEquals("shortName wrong", TEST_ROOTGROUP, rootGroup.getString("shortName")); assertEquals("shortName wrong", TEST_ROOTGROUP, rootGroup.getString("shortName"));
assertEquals("displayName wrong", TEST_ROOTGROUP_DISPLAY_NAME, rootGroup.getString("displayName")); assertEquals("displayName wrong", TEST_ROOTGROUP_DISPLAY_NAME, rootGroup.getString("displayName"));
assertEquals("authorityType wrong", "GROUP", rootGroup.getString("authorityType")); assertEquals("authorityType wrong", "GROUP", rootGroup.getString("authorityType"));
assertFalse("test rootgroup is admin group", rootGroup.getBoolean("isAdminGroup"));
gotRootGroup = true; gotRootGroup = true;
} }
if(rootGroup.getString("shortName").equals(ADMIN_GROUP))
{
gotAdminGroup = true;
//assertTrue("admin group is not admin group", rootGroup.getBoolean("isAdminGroup"));
}
if(rootGroup.getString("shortName").equals(EMAIL_GROUP)) if(rootGroup.getString("shortName").equals(EMAIL_GROUP))
{ {
//assertTrue("admin group is not admin group", rootGroup.getBoolean("isAdminGroup"));
gotEmailGroup = true; gotEmailGroup = true;
} }
} }
assertTrue("root group not found", gotRootGroup); assertTrue("root group not found", gotRootGroup);
assertTrue("admin group not found", gotAdminGroup);
assertTrue("email group not found", gotEmailGroup); assertTrue("email group not found", gotEmailGroup);
} }
@@ -272,11 +263,6 @@ public class GroupsTest extends BaseWebScriptTest
assertEquals("shortName wrong", TEST_ROOTGROUP, rootGroup.getString("shortName")); assertEquals("shortName wrong", TEST_ROOTGROUP, rootGroup.getString("shortName"));
assertEquals("displayName wrong", TEST_ROOTGROUP_DISPLAY_NAME, rootGroup.getString("displayName")); assertEquals("displayName wrong", TEST_ROOTGROUP_DISPLAY_NAME, rootGroup.getString("displayName"));
assertEquals("authorityType wrong", "GROUP", rootGroup.getString("authorityType")); assertEquals("authorityType wrong", "GROUP", rootGroup.getString("authorityType"));
assertFalse("test rootgroup is admin group", rootGroup.getBoolean("isAdminGroup"));
}
if(rootGroup.getString("shortName").equals(ADMIN_GROUP))
{
//assertTrue("admin group is not admin group", rootGroup.getBoolean("isAdminGroup"));
} }
} }
} }
@@ -300,11 +286,6 @@ public class GroupsTest extends BaseWebScriptTest
assertEquals("shortName wrong", TEST_ROOTGROUP, rootGroup.getString("shortName")); assertEquals("shortName wrong", TEST_ROOTGROUP, rootGroup.getString("shortName"));
assertEquals("displayName wrong", TEST_ROOTGROUP_DISPLAY_NAME, rootGroup.getString("displayName")); assertEquals("displayName wrong", TEST_ROOTGROUP_DISPLAY_NAME, rootGroup.getString("displayName"));
assertEquals("authorityType wrong", "GROUP", rootGroup.getString("authorityType")); assertEquals("authorityType wrong", "GROUP", rootGroup.getString("authorityType"));
assertFalse("test rootgroup is admin group", rootGroup.getBoolean("isAdminGroup"));
}
if(rootGroup.getString("shortName").equals(ADMIN_GROUP))
{
//assertTrue("admin group is not admin group", rootGroup.getBoolean("isAdminGroup"));
} }
} }
} }
@@ -336,8 +317,6 @@ public class GroupsTest extends BaseWebScriptTest
logger.debug(response.getContentAsString()); logger.debug(response.getContentAsString());
JSONObject data = top.getJSONObject("data"); JSONObject data = top.getJSONObject("data");
assertTrue(data.length() > 0); assertTrue(data.length() > 0);
//assertTrue("admin group is not admin group", data.getBoolean("isAdminGroup"));
assertTrue("admin group is not root group", data.getBoolean("isRootGroup"));
} }
{ {
@@ -353,8 +332,6 @@ public class GroupsTest extends BaseWebScriptTest
logger.debug(response.getContentAsString()); logger.debug(response.getContentAsString());
JSONObject data = top.getJSONObject("data"); JSONObject data = top.getJSONObject("data");
assertTrue(data.length() > 0); assertTrue(data.length() > 0);
assertFalse("group B is not admin group", data.getBoolean("isAdminGroup"));
assertFalse("group B is not root group", data.getBoolean("isRootGroup"));
} }
/** /**
@@ -366,8 +343,6 @@ public class GroupsTest extends BaseWebScriptTest
logger.debug(response.getContentAsString()); logger.debug(response.getContentAsString());
JSONObject data = top.getJSONObject("data"); JSONObject data = top.getJSONObject("data");
assertTrue(data.length() > 0); assertTrue(data.length() > 0);
assertFalse("group E is not admin group", data.getBoolean("isAdminGroup"));
assertFalse("group E is not root group", data.getBoolean("isRootGroup"));
} }
} }
@@ -928,7 +903,7 @@ public class GroupsTest extends BaseWebScriptTest
assertFalse("The first group should not be the same!!", firstGroup.equals(data.get(0).toString())); assertFalse("The first group should not be the same!!", firstGroup.equals(data.get(0).toString()));
// Test maxItems and skipCount when maxItems is too big. // Test maxItems and skipCount when maxItems is too big.
// Shoudl return last 2 items. // Should return last 2 items.
data = getDataArray(baseUrl + "?skipCount=1&maxItems=5"); data = getDataArray(baseUrl + "?skipCount=1&maxItems=5");
assertEquals("The number of groups returned is wrong!", 2, data.length()); assertEquals("The number of groups returned is wrong!", 2, data.length());
assertFalse("The first group should not be the same!!", firstGroup.equals(data.get(0).toString())); assertFalse("The first group should not be the same!!", firstGroup.equals(data.get(0).toString()));
@@ -944,7 +919,7 @@ public class GroupsTest extends BaseWebScriptTest
// Test maxItems works // Test maxItems works
data = getDataArray(baseUrl +"&maxItems=2"); data = getDataArray(baseUrl +"&maxItems=2");
assertEquals("There should only be 3 groups!", 2, data.length()); assertEquals("There should only be 2 groups!", 2, data.length());
assertEquals("The first group should be the same!!", firstGroup, data.get(0).toString()); assertEquals("The first group should be the same!!", firstGroup, data.get(0).toString());
// Test skipCount works // Test skipCount works