pvollenweider    2005/10/07 16:32:21 CEST

  Modified files:
    src/view/jsp         searchresult.jsp 
  Log:
  Update query (KN)
  
  Revision  Changes    Path
  1.24      +27 -63    corporate_portal_templates/src/view/jsp/searchresult.jsp
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/corporate_portal_templates/src/view/jsp/searchresult.jsp.diff?r1=1.23&r2=1.24&f=h
  
  
  
  Index: searchresult.jsp
  ===================================================================
  RCS file: 
/home/cvs/repository/corporate_portal_templates/src/view/jsp/searchresult.jsp,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- searchresult.jsp  6 Sep 2005 16:01:07 -0000       1.23
  +++ searchresult.jsp  7 Oct 2005 14:32:21 -0000       1.24
  @@ -45,7 +45,6 @@
        String updateDate = "";
        String occurence = "";
        String contentType = "";
  -     String occurenceField = "";
        String[] searchDomains = new String[]{};
   
        if ( searchView == null ){
  @@ -62,7 +61,7 @@
   
                        Date maxUpdateDate = getUpdateDateRange(updateDate);
                        advOptions.append("(");
  -                     advOptions.append("lastmodifdate:[");
  +                     
advOptions.append(JahiaSearchConstant.METADATA_PREFIX+"lastmodifdate:[");
                        
advOptions.append(NumberPadding.pad(maxUpdateDate.getTime()));
                        advOptions.append(" TO ");
                        
advOptions.append(NumberPadding.pad(cal.getTime().getTime()));
  @@ -70,46 +69,7 @@
                }
   
                // occurence
  -             occurence = 
JahiaTools.getStrParameter(request,"occurence","anywhere");
  -             if ( "fileproperties".equals(occurence) ){
  -                     occurence = "anywhere";
  -             }
  -             if ( !"anywhere".equals(occurence)      ){
  -                     boolean closeClause = false;
  -                     if ( "title".equals(occurence) || 
"author".equals(occurence) || "contributor".equals(occurence) ) {
  -                             if ( advOptions.length()>0 ){
  -                                     advOptions.append(" AND (");
  -                             } else {
  -                                     advOptions.append("(");
  -                             }
  -                             closeClause = true;
  -                     }
  -                     if ( "title".equals(occurence) ){
  -                             advOptions.append("fieldname:");
  -                             advOptions.append("title");
  -                     } else if ( "author".equals(occurence) ){
  -                             advOptions.append("fieldname:");
  -                             advOptions.append("creator");
  -                     } else if ( "file.title".equals(occurence) ){
  -                             occurenceField = "file_property_title";
  -                     } else if ( "file.subject".equals(occurence) ){
  -                             occurenceField = "file_property_subject";
  -                     } else if ( "file.comments".equals(occurence) ){
  -                             occurenceField = "file_property_comments";
  -                     } else if ( "file.keywords".equals(occurence) ){
  -                             occurenceField = "file_property_keywords";
  -                     } else if ( "file.author".equals(occurence) ){
  -                             occurenceField = "file_property_author";
  -                     } else if ( "contributor".equals(occurence) ){
  -                             advOptions.append("fieldname:");
  -                             advOptions.append("lastContributor");
  -                     } else if ( "file.contributor".equals(occurence) ){
  -                             occurenceField = "file_property_lastauthor";
  -                     }
  -                     if ( closeClause ) {
  -                             advOptions.append(")");
  -                     }
  -             }
  +             occurence = JahiaTools.getStrParameter(request,"occurence","");
   
                // contentType
                contentType = 
JahiaTools.getStrParameter(request,"contentType","any");
  @@ -120,17 +80,17 @@
                                advOptions.append("(");
                        }
                        if ( "pdf".equals(contentType) ){
  -                             advOptions.append("content_type:");
  -                             advOptions.append("application_pdf");
  +                             
advOptions.append(JahiaSearchConstant.FILE_CONTENT_TYPE+":");
  +                             advOptions.append("application/pdf");
                        } else if ( "doc".equals(contentType) ){
  -                             advOptions.append("content_type:");
  -                             advOptions.append("application_msword");
  +                             
advOptions.append(JahiaSearchConstant.FILE_CONTENT_TYPE+":");
  +                             advOptions.append("application/msword");
                        } else if ( "xls".equals(contentType) ){
  -                             advOptions.append("content_type:");
  -                             advOptions.append("application_vnd.ms-excel");
  +                             
advOptions.append(JahiaSearchConstant.FILE_CONTENT_TYPE+":");
  +                             advOptions.append("application/vnd.ms-excel");
                        } else if ( "ppt".equals(contentType) ){
  -                             advOptions.append("content_type:");
  -                             
advOptions.append("application_vnd.ms-powerpoint");
  +                             
advOptions.append(JahiaSearchConstant.FILE_CONTENT_TYPE+":");
  +                             
advOptions.append("application/vnd.ms-powerpoint");
                        }
                        advOptions.append(")");
                }
  @@ -154,8 +114,8 @@
                } else if ( advOptions.length()>0 ){
                        newQuery = "(" + newQuery + ") AND (" + 
advOptions.toString() + ")";
                }
  -             if ( !"".equals(occurenceField) && !"".equals(newQuery) ){
  -                     newQuery = occurenceField + ":(" + newQuery + ")";
  +             if ( !"".equals(occurence) && !"".equals(newQuery) ){
  +                     newQuery = occurence + ":(" + newQuery + ")";
                }
                searchViewHandler.setQuery(newQuery);
   
  @@ -365,17 +325,21 @@
                     terms occur</FONT></TD>
                   <TD><FONT size=-1>
                        <SELECT name="occurence">
  -                             <OPTION value="anywhere" <% if ( 
"anywhere".equals(occurence) ){%>selected<%}%>>-------------- In Jahia's 
content --------------
  -                             <!--<OPTION value="body">in the content-->
  -                             <OPTION value="author" <% if ( 
"author".equals(occurence) ){%>selected<%}%>>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;in 
the Author's name
  -                             <OPTION value="contributor" <% if ( 
"contributor".equals(occurence) 
){%>selected<%}%>>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;in the Contributor's name
  -                             <OPTION value="fileproperties" <% if ( 
"fileproperties".equals(occurence) ){%>selected<%}%>>-------------- In file's 
properties --------------
  -                             <OPTION value="file.author" <% if ( 
"file.author".equals(occurence) 
){%>selected<%}%>>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;in the Author property
  -                             <OPTION value="file.contributor" <% if ( 
"file.contributor".equals(occurence) 
){%>selected<%}%>>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;in the Contributor property
  -                             <OPTION value="file.title" <% if ( 
"file.title".equals(occurence) 
){%>selected<%}%>>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;in the Title property
  -                             <OPTION value="file.subjet" <% if ( 
"file.subject".equals(occurence) 
){%>selected<%}%>>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;in the Subject property
  -                             <OPTION value="file.comments" <% if ( 
"file.comments".equals(occurence) 
){%>selected<%}%>>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;in the Description property
  -                             <OPTION value="file.keywords" <% if ( 
"file.keywords".equals(occurence) 
){%>selected<%}%>>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;in the Keywords property
  +                             <OPTION 
value="<%=JahiaSearchConstant.ALL_FULLTEXT_SEARCH_FIELD%>" <% if ( 
JahiaSearchConstant.ALL_FULLTEXT_SEARCH_FIELD.equals(occurence) 
){%>selected<%}%>>Anywhere
  +                             <OPTION 
value="<%=JahiaSearchConstant.ALL_FULLTEXT_SEARCH_FIELD%>">
  +                             <OPTION 
value="<%=JahiaSearchConstant.CONTENT_FULLTEXT_SEARCH_FIELD%>" <% if ( 
JahiaSearchConstant.CONTENT_FULLTEXT_SEARCH_FIELD.equals(occurence) 
){%>selected<%}%>>In Jahia's content only
  +                             <OPTION 
value="<%=JahiaSearchConstant.METADATA_FULLTEXT_SEARCH_FIELD%>" <% if ( 
JahiaSearchConstant.METADATA_FULLTEXT_SEARCH_FIELD.equals(occurence) 
){%>selected<%}%>>In Jahia's metadatas only
  +                             <OPTION 
value="<%=JahiaSearchConstant.METADATA_PREFIX%>author" <% if ( 
(JahiaSearchConstant.METADATA_PREFIX+"author").equals(occurence) 
){%>selected<%}%>>In Jahia Author metadata
  +                             <OPTION 
value="<%=JahiaSearchConstant.METADATA_PREFIX%>lastcontributor" <% if ( 
(JahiaSearchConstant.METADATA_PREFIX+"lastcontributor").equals(occurence) 
){%>selected<%}%>>In Jahia Contributor metadata
  +                             <OPTION 
value="<%=JahiaSearchConstant.ALL_FULLTEXT_SEARCH_FIELD%>">
  +                             <OPTION 
value="<%=JahiaSearchConstant.FILE_CONTENT_FULLTEXT_SEARCH_FIELD%>" <% if ( 
JahiaSearchConstant.FILE_CONTENT_FULLTEXT_SEARCH_FIELD.equals(occurence) 
){%>selected<%}%>>In file's content only
  +                             <OPTION 
value="<%=JahiaSearchConstant.FILE_METADATA_FULLTEXT_SEARCH_FIELD%>" <% if ( 
JahiaSearchConstant.FILE_METADATA_FULLTEXT_SEARCH_FIELD.equals(occurence) 
){%>selected<%}%>>In file's properties only
  +                             <OPTION value="fileprop::author" <% if ( 
"fileprop::author".equals(occurence) ){%>selected<%}%>>In the file's Author 
property
  +                             <OPTION value="fileprop::contributor" <% if ( 
"fileprop::contributor".equals(occurence) ){%>selected<%}%>>In the file's last 
Contributor property
  +                             <OPTION value="fileprop::title" <% if ( 
"fileprop::title".equals(occurence) ){%>selected<%}%>>In the file's title 
property
  +                             <OPTION value="fileprop::subjet" <% if ( 
"fileprop::subject".equals(occurence) ){%>selected<%}%>>In the file's subject 
property
  +                             <OPTION value="fileprop::comments" <% if ( 
"fileprop::comments".equals(occurence) ){%>selected<%}%>>In the file's 
description property
  +                             <OPTION value="fileprop::keywords" <% if ( 
"fileprop::keywords".equals(occurence) ){%>selected<%}%>>In the file's keywords 
property
                        </SELECT></FONT></TD></TR></TBODY></TABLE></TD>
           <TR bgColor=#ffffff>
             <TD>
  

Reply via email to