mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged from BRANCHES/DEV/KEVINR:
. NodeInfo panel and Ajax client library - Rewrite of Node Info panel - Alfresco common DOM methods refactored into namespaced object (YUI/Dojo style) Alfresco.Dom - Addition of useful DOM and 'smart' alignment method to common.js - OpenSearch now uses additional namespace for it's global method handlers: Alfresco.OpenSearchEngine - Temporary icons added for pop-up node info panel . Additional FreeMarker model API method "cropContent(contentprop, length)" to return the first N bytes of a content stream - auto converted to plain/text from all supported transformation mimetypes . DownloadContentServlet now handles ContentIOException more gracefully . AbstractContentReader fixed to handle empty file data when requesting N characters from a content stream . Yahoo scripts move to PageTag rendering as appropriate . Refactoring of existing ajax components that output Yahoo scripts git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5253 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -169,8 +169,8 @@ Alfresco.OpenSearchClient.prototype =
|
||||
{
|
||||
YAHOO.util.Connect.asyncRequest("GET", searchUrl,
|
||||
{
|
||||
success: Alfresco.processSearchResults,
|
||||
failure: Alfresco.handleSearchError,
|
||||
success: Alfresco.OpenSearchEngine.processSearchResults,
|
||||
failure: Alfresco.OpenSearchEngine.handleSearchError,
|
||||
argument: [ose.id, this]
|
||||
},
|
||||
null);
|
||||
@@ -191,8 +191,8 @@ Alfresco.OpenSearchClient.prototype =
|
||||
// execute the query and process the results
|
||||
YAHOO.util.Connect.asyncRequest("GET", url,
|
||||
{
|
||||
success: Alfresco.processShowPageResults,
|
||||
failure: Alfresco.handleSearchError,
|
||||
success: Alfresco.OpenSearchEngine.processShowPageResults,
|
||||
failure: Alfresco.OpenSearchEngine.handleSearchError,
|
||||
argument: [engineId, this]
|
||||
},
|
||||
null);
|
||||
@@ -340,21 +340,21 @@ Alfresco.OpenSearchClient.prototype =
|
||||
var elResult = results[x];
|
||||
|
||||
// get the title, icon and summary
|
||||
var title = getElementTextByTagName(elResult, "title");
|
||||
var icon = getElementTextByTagName(elResult, "icon");
|
||||
var title = Alfresco.Dom.getElementTextByTagName(elResult, "title");
|
||||
var icon = Alfresco.Dom.getElementTextByTagName(elResult, "icon");
|
||||
var summary = null;
|
||||
if (isAtom)
|
||||
{
|
||||
summary = getElementTextByTagName(elResult, "summary");
|
||||
summary = Alfresco.Dom.getElementTextByTagName(elResult, "summary");
|
||||
}
|
||||
else
|
||||
{
|
||||
summary = getElementTextByTagName(elResult, "description");
|
||||
summary = Alfresco.Dom.getElementTextByTagName(elResult, "description");
|
||||
}
|
||||
|
||||
// get the link href
|
||||
var link = null;
|
||||
var elLink = getElementByTagName(elResult, "link");
|
||||
var elLink = Alfresco.Dom.getElementByTagName(elResult, "link");
|
||||
if (elLink != null)
|
||||
{
|
||||
if (isAtom)
|
||||
@@ -363,7 +363,7 @@ Alfresco.OpenSearchClient.prototype =
|
||||
}
|
||||
else
|
||||
{
|
||||
link = getElementText(elLink);
|
||||
link = Alfresco.Dom.getElementText(elLink);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -416,10 +416,10 @@ Alfresco.OpenSearchClient.prototype =
|
||||
var startIndex = 0;
|
||||
|
||||
// check there are results
|
||||
var elTotalResults = getElementByTagNameNS(feed, _OS_NS_URI, _OS_NS_PREFIX, "totalResults");
|
||||
var elTotalResults = Alfresco.Dom.getElementByTagNameNS(feed, _OS_NS_URI, _OS_NS_PREFIX, "totalResults");
|
||||
if (elTotalResults != null)
|
||||
{
|
||||
totalResults = getElementText(elTotalResults);
|
||||
totalResults = Alfresco.Dom.getElementText(elTotalResults);
|
||||
}
|
||||
|
||||
// if there are no results return an empty string
|
||||
@@ -428,16 +428,16 @@ Alfresco.OpenSearchClient.prototype =
|
||||
return "";
|
||||
}
|
||||
|
||||
var elStartIndex = getElementByTagNameNS(feed, _OS_NS_URI, _OS_NS_PREFIX, "startIndex");
|
||||
var elStartIndex = Alfresco.Dom.getElementByTagNameNS(feed, _OS_NS_URI, _OS_NS_PREFIX, "startIndex");
|
||||
if (elStartIndex != null)
|
||||
{
|
||||
startIndex = getElementText(elStartIndex);
|
||||
startIndex = Alfresco.Dom.getElementText(elStartIndex);
|
||||
}
|
||||
|
||||
var elItemsPerPage = getElementByTagNameNS(feed, _OS_NS_URI, _OS_NS_PREFIX, "itemsPerPage");
|
||||
var elItemsPerPage = Alfresco.Dom.getElementByTagNameNS(feed, _OS_NS_URI, _OS_NS_PREFIX, "itemsPerPage");
|
||||
if (elItemsPerPage != null)
|
||||
{
|
||||
pageSize = getElementText(elItemsPerPage);
|
||||
pageSize = Alfresco.Dom.getElementText(elItemsPerPage);
|
||||
}
|
||||
|
||||
// calculate the number of pages the results span
|
||||
@@ -587,7 +587,7 @@ Alfresco.OpenSearchClient.prototype =
|
||||
/**
|
||||
* Processes the XML search results
|
||||
*/
|
||||
Alfresco.processSearchResults = function(ajaxResponse)
|
||||
Alfresco.OpenSearchEngine.processSearchResults = function(ajaxResponse)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -599,7 +599,7 @@ Alfresco.processSearchResults = function(ajaxResponse)
|
||||
// if the name of the feed element is "rss", get the channel child element
|
||||
if (feed.tagName == "rss")
|
||||
{
|
||||
feed = getElementByTagName(feed, "channel");
|
||||
feed = Alfresco.Dom.getElementByTagName(feed, "channel");
|
||||
}
|
||||
|
||||
var resultsDiv = clientInstance.renderSearchResults(engineId, feed);
|
||||
@@ -628,7 +628,7 @@ Alfresco.processSearchResults = function(ajaxResponse)
|
||||
* Processes the search results and updates the postion, result list
|
||||
* and paging controls.
|
||||
*/
|
||||
Alfresco.processShowPageResults = function(ajaxResponse)
|
||||
Alfresco.OpenSearchEngine.processShowPageResults = function(ajaxResponse)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -640,7 +640,7 @@ Alfresco.processShowPageResults = function(ajaxResponse)
|
||||
// if the name of the feed element is "rss", get the channel child element
|
||||
if (feed.tagName == "rss")
|
||||
{
|
||||
feed = getElementByTagName(feed, "channel");
|
||||
feed = Alfresco.Dom.getElementByTagName(feed, "channel");
|
||||
}
|
||||
|
||||
// append the results list to the results list div
|
||||
@@ -668,7 +668,7 @@ Alfresco.processShowPageResults = function(ajaxResponse)
|
||||
/**
|
||||
* Error handler for Ajax call to search engine
|
||||
*/
|
||||
Alfresco.handleSearchError = function(ajaxResponse)
|
||||
Alfresco.OpenSearchEngine.handleSearchError = function(ajaxResponse)
|
||||
{
|
||||
var engineId = ajaxResponse.argument[0];
|
||||
var clientInstance = ajaxResponse.argument[1];
|
||||
|
Reference in New Issue
Block a user