mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged HEAD-BUG-FIX (4.3/Cloud) to HEAD (4.3/Cloud)
58203: Merged V4.2-BUG-FIX (4.2.1) to HEAD-BUG-FIX (Cloud/4.3) 58139: Merged DEV to V4.2-BUG-FIX (4.2.1) 49098 : MNT-7059 : Search description in search result not sensible when using only advanced fields. - Added a method, that get a search value by fields "title", "description", "author" for advanced search in Alfresco Explorer git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@61942 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -39,6 +39,7 @@ import org.alfresco.service.cmr.repository.Path;
|
||||
import org.alfresco.service.namespace.NamespaceService;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import org.alfresco.util.ISO9075;
|
||||
import org.alfresco.web.app.Application;
|
||||
import org.alfresco.web.bean.repository.Repository;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
@@ -648,6 +649,45 @@ public class SearchContext implements Serializable
|
||||
this.mode = mode;
|
||||
}
|
||||
|
||||
public String getSearchText()
|
||||
{
|
||||
if (this.text != null && this.text.trim().length() > 0)
|
||||
{
|
||||
return getText();
|
||||
}
|
||||
StringBuilder res = new StringBuilder();
|
||||
for (QName attrName : this.queryAttributes.keySet())
|
||||
{
|
||||
if (ContentModel.PROP_TITLE.isMatch(attrName))
|
||||
{
|
||||
res.append(res.length() > 0 ? ", " : "");
|
||||
res.append(Application.getMessage(FacesContext.getCurrentInstance(), "title"));
|
||||
res.append(": ");
|
||||
res.append(this.queryAttributes.get(attrName));
|
||||
}
|
||||
else if (ContentModel.PROP_DESCRIPTION.isMatch(attrName))
|
||||
{
|
||||
res.append(res.length() > 0 ? ", " : "");
|
||||
res.append(Application.getMessage(FacesContext.getCurrentInstance(), "description"));
|
||||
res.append(": ");
|
||||
res.append(this.queryAttributes.get(attrName));
|
||||
}
|
||||
else if (ContentModel.PROP_AUTHOR.isMatch(attrName))
|
||||
{
|
||||
res.append(res.length() > 0 ? ", " : "");
|
||||
res.append(Application.getMessage(FacesContext.getCurrentInstance(), "author"));
|
||||
res.append(": ");
|
||||
res.append(this.queryAttributes.get(attrName));
|
||||
}
|
||||
else
|
||||
{
|
||||
res.append(res.length() > 0 ? ", " : "");
|
||||
res.append(this.queryAttributes.get(attrName));
|
||||
}
|
||||
}
|
||||
return res.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Returns the search text string.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user