Share Advanced Search checkpoint:

- Header bar and simple search page refactor
 - Removal of site specific and all sites searches (searches now always across all sites)
 - Simple search page as per latest wireframes - search box, search button and paging for large results sets
 - Increased default max results size to 250 items with 50 per page by default (configurable)
 - Clean up of some old code and CSS

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@20872 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Kevin Roast
2010-06-30 10:32:26 +00:00
parent aa31993e22
commit f37ec0f7f7

View File

@@ -1,12 +1,15 @@
/** /**
* Search Component: search * Search Component
* *
* Inputs: * Inputs:
* optional: site = the site to search into. * optional: site = the site to search into, null for all sites
* optional: container = the component the search in * optional: container = the component the search in, null for all components in the site
* * optional: term = search terms, should be supplied if tag is not
* optional: tag = search tag, should be supplied if term is not
* maxResults = maximum results to return
*
* Outputs: * Outputs:
* data.items/data.error - object containing list of search results * items - Array of objects containing the search results
*/ */
const DEFAULT_MAX_RESULTS = 100; const DEFAULT_MAX_RESULTS = 100;
const SITES_SPACE_QNAME_PATH = "/app:company_home/st:sites/"; const SITES_SPACE_QNAME_PATH = "/app:company_home/st:sites/";
@@ -14,10 +17,10 @@ const QUERY_TEMPLATES = [
{field: "keywords", template: "%(cm:name cm:title cm:description ia:whatEvent ia:descriptionEvent lnk:title lnk:description TEXT)"}]; {field: "keywords", template: "%(cm:name cm:title cm:description ia:whatEvent ia:descriptionEvent lnk:title lnk:description TEXT)"}];
/** /**
* Returns site data as returned to the user. * Returns site information data structure.
* { shortName: siteId, title: title } * { shortName: siteId, title: title }
* *
* Caches the sites to avoid repeatedly querying the repository. * Caches the data to avoid repeatedly querying the repository.
*/ */
var siteDataCache = []; var siteDataCache = [];
function getSiteData(siteId) function getSiteData(siteId)
@@ -30,12 +33,8 @@ function getSiteData(siteId)
var data = var data =
{ {
shortName : siteId, shortName : siteId,
title : "unknown" title : (site !== null ? site.title : "unknown")
}; };
if (site !== null)
{
data.title = site.title;
}
siteDataCache[siteId] = data; siteDataCache[siteId] = data;
return data; return data;
} }
@@ -398,35 +397,28 @@ function getLinkItem(siteId, containerId, restOfPath, node)
*/ */
function getItem(siteId, containerId, restOfPath, node) function getItem(siteId, containerId, restOfPath, node)
{ {
if (containerId == "documentLibrary") switch ("" + containerId)
{ {
return getDocumentItem(siteId, containerId, restOfPath, node); case "documentLibrary":
} return getDocumentItem(siteId, containerId, restOfPath, node);
else if (containerId == "blog") break;
{ case "blog":
return getBlogPostItem(siteId, containerId, restOfPath, node); return getBlogPostItem(siteId, containerId, restOfPath, node);
} break;
else if (containerId == "discussions") case "discussions":
{ return getForumPostItem(siteId, containerId, restOfPath, node);
return getForumPostItem(siteId, containerId, restOfPath, node); break;
} case "calendar":
else if (containerId == "calendar") return getCalendarItem(siteId, containerId, restOfPath, node);
{ break;
return getCalendarItem(siteId, containerId, restOfPath, node); case "wiki":
} return getWikiItem(siteId, containerId, restOfPath, node);
else if (containerId == "wiki") break;
{ case "links":
return getWikiItem(siteId, containerId, restOfPath, node); return getLinkItem(siteId, containerId, restOfPath, node);
} break;
else if (containerId == "links")
{
return getLinkItem(siteId, containerId, restOfPath, node);
}
else
{
// unknown container
return null;
} }
return null;
} }
/** /**