001/* 002 * This library is part of OpenCms - 003 * the Open Source Content Management System 004 * 005 * Copyright (c) Alkacon Software GmbH & Co. KG (http://www.alkacon.com) 006 * 007 * This library is free software; you can redistribute it and/or 008 * modify it under the terms of the GNU Lesser General Public 009 * License as published by the Free Software Foundation; either 010 * version 2.1 of the License, or (at your option) any later version. 011 * 012 * This library is distributed in the hope that it will be useful, 013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 015 * Lesser General Public License for more details. 016 * 017 * For further information about Alkacon Software, please see the 018 * company website: http://www.alkacon.com 019 * 020 * For further information about OpenCms, please see the 021 * project website: http://www.opencms.org 022 * 023 * You should have received a copy of the GNU Lesser General Public 024 * License along with this library; if not, write to the Free Software 025 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 026 */ 027 028package org.opencms.ade.galleries.shared; 029 030import org.opencms.ade.galleries.shared.I_CmsGalleryProviderConstants.GalleryMode; 031import org.opencms.ade.galleries.shared.I_CmsGalleryProviderConstants.GalleryTabId; 032import org.opencms.ade.galleries.shared.I_CmsGalleryProviderConstants.SortParams; 033import org.opencms.util.CmsStringUtil; 034 035import java.util.ArrayList; 036import java.util.Arrays; 037import java.util.HashSet; 038import java.util.List; 039import java.util.Set; 040 041import com.google.gwt.user.client.rpc.IsSerializable; 042 043/** 044 * This bean represents the current search object.<p> 045 * 046 * The search object collects the current parameters which are used for the search and 047 * contains the search results for the current search parameters. 048 * 049 * @since 8.0.0 050 */ 051public class CmsGallerySearchBean implements IsSerializable { 052 053 /** The default matches per page. */ 054 public static final int DEFAULT_MATCHES_PER_PAGE = 40; 055 056 /** The default tab id to use when the gallery is opened. */ 057 public static final int DEFAULT_TAB_ID = 0; 058 059 /** Name of the used JS variable. */ 060 public static final String DICT_NAME = "cms_gallery_search_bean"; 061 062 /** The list of selected categories ids (path). */ 063 private List<String> m_categories = new ArrayList<String>(); 064 065 /** The end creation date criteria as long. */ 066 private long m_dateCreatedEnd = -1L; 067 068 /** The start creation date criteria as long. */ 069 private long m_dateCreatedStart = -1L; 070 071 /** The end modification date criteria as long. */ 072 private long m_dateModifiedEnd = -1L; 073 074 /** The start modification date criteria as long. */ 075 private long m_dateModifiedStart = -1L; 076 077 /** Flag to disable the preview. */ 078 private boolean m_disablePreview; 079 080 /** The list of selected vfs folders. */ 081 private Set<String> m_folders = new HashSet<String>(); 082 083 /** The list of selected galleries ids (path). */ 084 private List<String> m_galleries = new ArrayList<String>(); 085 086 /** Flag to indicate whether the user changed the gallery selection. */ 087 private boolean m_galleriesChanged; 088 089 /** The gallery mode. */ 090 private GalleryMode m_galleryMode; 091 092 /** The prefix for the key used to store the last selected gallery. */ 093 private String m_galleryStoragePrefix; 094 095 /** Indicates the search exclude property should be ignored. */ 096 private boolean m_ignoreSearchExclude; 097 098 /** Flag indicating if the search should include expired or unreleased resources. */ 099 private boolean m_includeExpired; 100 101 /** The id of a tab which will be set after an initial (CmsGalleryDataBean) search. */ 102 private GalleryTabId m_initialTabId; 103 104 /** The index of the last search results page. */ 105 private int m_lastPage; 106 107 /** The selected locale for search. */ 108 private String m_locale; 109 110 /** The number of search results to be display pro page. */ 111 private int m_matchesPerPage; 112 113 /** The reason why an upload to the current target folder is not allowed. */ 114 private String m_noUploadReason; 115 116 /** The original gallery data for which this search bean was created. */ 117 private CmsGalleryDataBean m_originalGalleryData; 118 119 /** The current search result page. */ 120 private int m_page; 121 122 /** The search query string. */ 123 private String m_query; 124 125 /** The gallery reference path. */ 126 private String m_referencePath; 127 128 /** The path to the selected resource. */ 129 private String m_resourcePath; 130 131 /** The type of the selected resource. */ 132 private String m_resourceType; 133 134 /** The number of all search results. */ 135 private int m_resultCount; 136 137 /** The results to display in the list of search results. */ 138 private List<CmsResultItemBean> m_results; 139 140 /** The search scope. */ 141 private CmsGallerySearchScope m_scope; 142 143 /** The real list of types to be used for the search on the server. */ 144 private List<String> m_serverSearchTypes = new ArrayList<String>(); 145 146 /** The sitemap preload data. */ 147 private CmsSitemapEntryBean m_sitemapPreloadData; 148 149 /** The sort order of the search result. */ 150 private String m_sortOrder; 151 152 /** The tab id to be selected by opening the gallery dialog. */ 153 private String m_tabId = I_CmsGalleryProviderConstants.GalleryTabId.cms_tab_types.name(); 154 155 /** The list of the resource types ids (resource type name). */ 156 private List<String> m_types = new ArrayList<String>(); 157 158 /** The VFS tree preload data. */ 159 private CmsVfsEntryBean m_vfsPreloadData; 160 161 /** 162 * Empty default constructor. <p> 163 */ 164 public CmsGallerySearchBean() { 165 166 m_matchesPerPage = DEFAULT_MATCHES_PER_PAGE; 167 m_page = 1; 168 // default sorting by date last modified 169 m_sortOrder = SortParams.dateLastModified_desc.name(); 170 } 171 172 /** 173 * Constructor of the search object.<p> 174 * 175 * The constructor copies the content of the provided parameter to the current bean. 176 * 177 * @param searchObj a search object with content 178 */ 179 public CmsGallerySearchBean(CmsGallerySearchBean searchObj) { 180 181 setTypes(searchObj.getTypes()); 182 setGalleries(searchObj.getGalleries()); 183 setFolders(searchObj.getFolders()); 184 setCategories(searchObj.getCategories()); 185 setQuery(searchObj.getQuery()); 186 setLocale(searchObj.getLocale()); 187 setMatchesPerPage(searchObj.getMatchesPerPage()); 188 setSortOrder(searchObj.getSortOrder()); 189 setTabId(searchObj.getTabId()); 190 setPage(searchObj.getPage()); 191 setLastPage(searchObj.getLastPage()); 192 setDateCreatedEnd(searchObj.getDateCreatedEnd()); 193 setDateCreatedStart(searchObj.getDateCreatedStart()); 194 setDateModifiedEnd(searchObj.getDateModifiedEnd()); 195 setDateModifiedStart(searchObj.getDateModifiedStart()); 196 setScope(searchObj.getScope()); 197 setIncludeExpired(searchObj.isIncludeExpired()); 198 setIgnoreSearchExclude(searchObj.isIgnoreSearchExclude()); 199 setGalleryMode(searchObj.getGalleryMode()); 200 setGalleryStoragePrefix(searchObj.getGalleryStoragePrefix()); 201 setServerSearchTypes(searchObj.getServerSearchTypes()); 202 setOriginalGalleryData(searchObj.getOriginalGalleryData()); 203 } 204 205 /** 206 * Creates the key used to store the last selected gallery.<p> 207 * 208 * @param prefix the prefix for the key 209 * @param referenceType the type name of the reference resource 210 * 211 * @return the key to store the last selected gallery 212 */ 213 public static String getGalleryStorageKey(String prefix, String referenceType) { 214 215 return prefix + "#" + referenceType; 216 } 217 218 /** 219 * Adds a category to the categories list.<p> 220 * 221 * @param category the category 222 */ 223 public void addCategory(String category) { 224 225 if (!m_categories.contains(category)) { 226 m_categories.add(category); 227 } 228 } 229 230 /** 231 * Adds a new VFS folder to search in.<p> 232 * 233 * @param folder the folder to add 234 */ 235 public void addFolder(String folder) { 236 237 m_folders.add(folder); 238 } 239 240 /** 241 * Adds a gallery folder to the galleries list.<p> 242 * 243 * @param gallery the gallery 244 */ 245 public void addGallery(String gallery) { 246 247 if (!m_galleries.contains(gallery)) { 248 m_galleries.add(gallery); 249 } 250 } 251 252 /** 253 * Adds a type to the types list.<p> 254 * 255 * @param type the type 256 */ 257 public void addType(String type) { 258 259 if (!m_types.contains(type)) { 260 m_types.add(type); 261 } 262 } 263 264 /** 265 * Clears the categories list.<p> 266 */ 267 public void clearCategories() { 268 269 m_categories.clear(); 270 } 271 272 /** 273 * Clears the list of VFS folders.<p> 274 */ 275 public void clearFolders() { 276 277 m_folders.clear(); 278 } 279 280 /** 281 * Clears the full text search.<p> 282 */ 283 public void clearFullTextSearch() { 284 285 m_query = null; 286 m_dateCreatedEnd = -1L; 287 m_dateCreatedStart = -1L; 288 m_dateModifiedEnd = -1L; 289 m_dateModifiedStart = -1L; 290 } 291 292 /** 293 * Clears the galleries list.<p> 294 */ 295 public void clearGalleries() { 296 297 m_galleries.clear(); 298 } 299 300 /** 301 * Clears the types list.<p> 302 */ 303 public void clearTypes() { 304 305 m_types.clear(); 306 } 307 308 /** 309 * Returns the list of the available categories.<p> 310 * 311 * @return the categories 312 */ 313 public List<String> getCategories() { 314 315 return m_categories; 316 } 317 318 /** 319 * Returns the dateCreatedEnd.<p> 320 * 321 * @return the dateCreatedEnd 322 */ 323 public long getDateCreatedEnd() { 324 325 return m_dateCreatedEnd; 326 } 327 328 /** 329 * Returns the dateCreatedStart.<p> 330 * 331 * @return the dateCreatedStart 332 */ 333 public long getDateCreatedStart() { 334 335 return m_dateCreatedStart; 336 } 337 338 /** 339 * Returns the dateModifiedEnd.<p> 340 * 341 * @return the dateModifiedEnd 342 */ 343 public long getDateModifiedEnd() { 344 345 return m_dateModifiedEnd; 346 } 347 348 /** 349 * Returns the dateModifiedStart.<p> 350 * 351 * @return the dateModifiedStart 352 */ 353 public long getDateModifiedStart() { 354 355 return m_dateModifiedStart; 356 } 357 358 /** 359 * Returns the list of selected VFS folders.<p> 360 * 361 * @return the list of selected VFS folders 362 */ 363 public Set<String> getFolders() { 364 365 return m_folders; 366 } 367 368 /** 369 * Returns the list of the available galleries.<p> 370 * 371 * @return the galleries 372 */ 373 public List<String> getGalleries() { 374 375 return m_galleries; 376 } 377 378 /** 379 * Gets the gallery mode.<p> 380 * 381 * @return the gallery mode 382 */ 383 public GalleryMode getGalleryMode() { 384 385 return m_galleryMode; 386 } 387 388 /** 389 * Gets the key used to store the last selected gallery.<p> 390 * 391 * @return the key used to store the last selected gallery 392 */ 393 public String getGalleryStoragePrefix() { 394 395 return m_galleryStoragePrefix; 396 } 397 398 /** 399 * Gets the initial tab id.<p> 400 * 401 * @return the initial tab id 402 */ 403 public GalleryTabId getInitialTabId() { 404 405 return m_initialTabId; 406 } 407 408 /** 409 * Gets the index of the last search results page.<p> 410 * 411 * @return the index of the last search results page 412 */ 413 public int getLastPage() { 414 415 return m_lastPage; 416 } 417 418 /** 419 * Returns the search locale.<p> 420 * 421 * @return the locale 422 */ 423 public String getLocale() { 424 425 return m_locale; 426 } 427 428 /** 429 * Returns the number of matches per search page.<p> 430 * 431 * @return the matchesPerPage 432 */ 433 public int getMatchesPerPage() { 434 435 return m_matchesPerPage; 436 } 437 438 /** 439 * Returns the reason why an upload to the current target folder is not allowed.<p> 440 * 441 * @return the reason why an upload to the current target folder is not allowed 442 */ 443 public String getNoUploadReason() { 444 445 return m_noUploadReason; 446 } 447 448 /** 449 * Returns the original gallery data.<p> 450 * 451 * @return the original gallery data 452 */ 453 public CmsGalleryDataBean getOriginalGalleryData() { 454 455 return m_originalGalleryData; 456 } 457 458 /** 459 * Returns the page.<p> 460 * 461 * @return the page 462 */ 463 public int getPage() { 464 465 if (m_page < 1) { 466 return 1; 467 } 468 return m_page; 469 } 470 471 /** 472 * Returns the search query string.<p> 473 * 474 * @return the query 475 */ 476 public String getQuery() { 477 478 return m_query; 479 } 480 481 /** 482 * Gets the gallery reference path.<p> 483 * 484 * @return the gallery reference path 485 */ 486 public String getReferencePath() { 487 488 return m_referencePath; 489 } 490 491 /** 492 * Returns the path to the selected resource in the current search.<p> 493 * 494 * @return the path to the selected resource 495 */ 496 public String getResourcePath() { 497 498 return m_resourcePath; 499 } 500 501 /** 502 * Returns the resource type of the selected resource.<p> 503 * 504 * @return the resource type 505 */ 506 public String getResourceType() { 507 508 return m_resourceType; 509 } 510 511 /** 512 * Returns the resultCount.<p> 513 * 514 * @return the resultCount 515 */ 516 public int getResultCount() { 517 518 return m_resultCount; 519 } 520 521 /** 522 * Returns the results.<p> 523 * 524 * @return the results 525 */ 526 public List<CmsResultItemBean> getResults() { 527 528 return m_results; 529 } 530 531 /** 532 * Gets the search scope.<p> 533 * 534 * @return the search scope 535 */ 536 public CmsGallerySearchScope getScope() { 537 538 return m_scope; 539 } 540 541 /** 542 * Gets the server search types.<p> 543 * 544 * These are the types which are actually used for the search on the server, rather than the types 545 * which are checked in the types tab. The lists are different, for example, if the user hasn't selected any 546 * types. 547 * 548 * @return the server search types 549 */ 550 public List<String> getServerSearchTypes() { 551 552 return m_serverSearchTypes; 553 } 554 555 /** 556 * Gets the sitemap preload data.<p> 557 * 558 * @return the sitemap preload data 559 */ 560 public CmsSitemapEntryBean getSitemapPreloadData() { 561 562 return m_sitemapPreloadData; 563 } 564 565 /** 566 * Returns the sort order of the search results.<p> 567 * 568 * @return the sortOrder 569 */ 570 public String getSortOrder() { 571 572 return m_sortOrder; 573 } 574 575 /** 576 * Returns the tabId.<p> 577 * 578 * @return the tabId 579 */ 580 public String getTabId() { 581 582 return m_tabId; 583 } 584 585 /** 586 * Returns the list of the available type.<p> 587 * 588 * @return the typeNames 589 */ 590 public List<String> getTypes() { 591 592 return m_types; 593 } 594 595 /** 596 * Gets the VFS preload data.<p> 597 * 598 * @return the VFS preload data 599 */ 600 public CmsVfsEntryBean getVfsPreloadData() { 601 602 return m_vfsPreloadData; 603 } 604 605 /** 606 * Checks if there are more search items available on the next page.<p> 607 * 608 * @return <code>true</code> if there are more search results available <code>false</code> otherwise 609 */ 610 public boolean hasMore() { 611 612 return (m_resultCount > (m_page * m_matchesPerPage)); 613 } 614 615 /** 616 * Checks if the gallery selection was changed by the user.<p> 617 * 618 * @return true if the gallery selection was changed 619 */ 620 public boolean haveGalleriesChanged() { 621 622 return m_galleriesChanged; 623 } 624 625 /** 626 * Returns true if no preview should be shown for the search result.<p> 627 * 628 * @return true if no preview should be shown 629 */ 630 public boolean isDisablePreview() { 631 632 return m_disablePreview; 633 } 634 635 /** 636 * Checks if any search parameter are selected.<p> 637 * 638 * @return false if any search parameter is selected, true if there are no search parameter selected 639 */ 640 @SuppressWarnings("unchecked") 641 public boolean isEmpty() { 642 643 List<String>[] params = new List[] {m_types, m_galleries, m_categories, new ArrayList<String>(m_folders)}; 644 for (List<String> paramList : params) { 645 if ((paramList != null) && !paramList.isEmpty()) { 646 return false; 647 } 648 } 649 if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(m_query)) { 650 return false; 651 } 652 List<Long> dates = Arrays.asList( 653 new Long[] { 654 Long.valueOf(m_dateCreatedEnd), 655 Long.valueOf(m_dateCreatedStart), 656 Long.valueOf(m_dateModifiedEnd), 657 Long.valueOf(m_dateModifiedStart)}); 658 for (Long date : dates) { 659 if ((date != null) && (!date.equals(Long.valueOf(-1L)))) { 660 return false; 661 } 662 } 663 return true; 664 } 665 666 /** 667 * Returns the search exclude property ignore flag.<p> 668 * 669 * @return the search exclude property ignore flag 670 */ 671 public boolean isIgnoreSearchExclude() { 672 673 return m_ignoreSearchExclude; 674 } 675 676 /** 677 * Returns if the search should include expired or unreleased resources.<p> 678 * 679 * @return <code>true</code> if the search should include expired or unreleased resources 680 */ 681 public boolean isIncludeExpired() { 682 683 return m_includeExpired; 684 } 685 686 /** 687 * Removes a category from the categories list.<p> 688 * 689 * @param category the category 690 */ 691 public void removeCategory(String category) { 692 693 m_categories.remove(category); 694 } 695 696 /** 697 * Removes a folder from the folder list.<p> 698 * 699 * @param folder the folder to remove 700 */ 701 public void removeFolder(String folder) { 702 703 m_folders.remove(folder); 704 } 705 706 /** 707 * Removes a gallery folder from the galleries list.<p> 708 * 709 * @param gallery the gallery 710 */ 711 public void removeGallery(String gallery) { 712 713 m_galleries.remove(gallery); 714 } 715 716 /** 717 * Removes a type from the types list.<p> 718 * 719 * @param type the type 720 */ 721 public void removeType(String type) { 722 723 m_types.remove(type); 724 } 725 726 /** 727 * Sets the categories.<p> 728 * 729 * @param categories the categories to set 730 */ 731 public void setCategories(List<String> categories) { 732 733 m_categories = categories; 734 } 735 736 /** 737 * Sets the dateCreatedEnd.<p> 738 * 739 * @param dateCreatedEnd the dateCreatedEnd to set 740 */ 741 public void setDateCreatedEnd(long dateCreatedEnd) { 742 743 m_dateCreatedEnd = dateCreatedEnd; 744 } 745 746 /** 747 * Sets the dateCreatedStart.<p> 748 * 749 * @param dateCreatedStart the dateCreatedStart to set 750 */ 751 public void setDateCreatedStart(long dateCreatedStart) { 752 753 m_dateCreatedStart = dateCreatedStart; 754 } 755 756 /** 757 * Sets the dateModifiedEnd.<p> 758 * 759 * @param dateModifiedEnd the dateModifiedEnd to set 760 */ 761 public void setDateModifiedEnd(long dateModifiedEnd) { 762 763 m_dateModifiedEnd = dateModifiedEnd; 764 } 765 766 /** 767 * Sets the dateModifiedStart.<p> 768 * 769 * @param dateModifiedStart the dateModifiedStart to set 770 */ 771 public void setDateModifiedStart(long dateModifiedStart) { 772 773 m_dateModifiedStart = dateModifiedStart; 774 } 775 776 /** 777 * Sets the 'disable preview' flag.<p> 778 * 779 * @param disablePreview true if the preview for the search result should not be shown 780 */ 781 public void setDisablePreview(boolean disablePreview) { 782 783 m_disablePreview = disablePreview; 784 } 785 786 /** 787 * Sets the folders to search in.<p> 788 * 789 * @param folders the folders 790 */ 791 public void setFolders(Set<String> folders) { 792 793 m_folders = folders; 794 } 795 796 /** 797 * Sets the galleries.<p> 798 * 799 * @param galleries the galleries to set 800 */ 801 public void setGalleries(List<String> galleries) { 802 803 m_galleries = galleries; 804 } 805 806 /** 807 * Sets the "galleries changed" flag.<p> 808 * 809 * @param changed the new flag value 810 */ 811 public void setGalleriesChanged(boolean changed) { 812 813 m_galleriesChanged = changed; 814 } 815 816 /** 817 * Sets the gallery mode.<p> 818 * 819 * @param galleryMode the gallery mode to set 820 */ 821 public void setGalleryMode(GalleryMode galleryMode) { 822 823 m_galleryMode = galleryMode; 824 } 825 826 /** 827 * Sets the prefix of the key used to store the last selected gallery.<p> 828 * 829 * @param prefix the prefix of the key used to store the last selected gallery 830 */ 831 public void setGalleryStoragePrefix(String prefix) { 832 833 m_galleryStoragePrefix = prefix; 834 } 835 836 /** 837 * Sets the search exclude property ignore flag.<p> 838 * 839 * @param excludeForPageEditor the search exclude property ignore flag 840 */ 841 public void setIgnoreSearchExclude(boolean excludeForPageEditor) { 842 843 m_ignoreSearchExclude = excludeForPageEditor; 844 } 845 846 /** 847 * Sets if the search should include expired or unreleased resources.<p> 848 * 849 * @param includeExpired if the search should include expired or unreleased resources 850 */ 851 public void setIncludeExpired(boolean includeExpired) { 852 853 m_includeExpired = includeExpired; 854 } 855 856 /** 857 * Sets the initial tab id.<p> 858 * 859 * @param initialTabId the initial tab id 860 */ 861 public void setInitialTabId(GalleryTabId initialTabId) { 862 863 m_initialTabId = initialTabId; 864 } 865 866 /** 867 * Sets the index of the last search result page.<p> 868 * 869 * @param lastPage the index of the last search result page 870 */ 871 public void setLastPage(int lastPage) { 872 873 m_lastPage = lastPage; 874 } 875 876 /** 877 * Sets the locale.<p> 878 * 879 * @param locale the locale to set 880 */ 881 public void setLocale(String locale) { 882 883 m_locale = locale; 884 } 885 886 /** 887 * Sets the matchesPerPage.<p> 888 * 889 * @param matchesPerPage the matchesPerPage to set 890 */ 891 public void setMatchesPerPage(int matchesPerPage) { 892 893 m_matchesPerPage = matchesPerPage; 894 } 895 896 /** 897 * Sets the reason why an upload to the current target folder is not allowed.<p> 898 * 899 * @param noUploadReason the reason why an upload to the current target folder is not allowed to set 900 */ 901 public void setNoUploadReason(String noUploadReason) { 902 903 m_noUploadReason = noUploadReason; 904 } 905 906 /** 907 * Sets the original gallery data.<p> 908 * 909 * @param originalGalleryData the original gallery data to set 910 */ 911 public void setOriginalGalleryData(CmsGalleryDataBean originalGalleryData) { 912 913 m_originalGalleryData = originalGalleryData; 914 } 915 916 /** 917 * Sets the page.<p> 918 * 919 * @param page the page to set 920 */ 921 public void setPage(int page) { 922 923 m_page = page; 924 } 925 926 /** 927 * Sets the query.<p> 928 * 929 * @param query the query to set 930 */ 931 public void setQuery(String query) { 932 933 m_query = query; 934 } 935 936 /** 937 * Sets the gallery reference path.<p> 938 * 939 * @param referencePath the gallery reference path 940 */ 941 public void setReferencePath(String referencePath) { 942 943 m_referencePath = referencePath; 944 } 945 946 /** 947 * Sets the resourcePath.<p> 948 * 949 * @param resourcePath the resourcePath to set 950 */ 951 public void setResourcePath(String resourcePath) { 952 953 m_resourcePath = resourcePath; 954 } 955 956 /** 957 * Sets the resource type of the selected resource.<p> 958 * 959 * @param resourceType the resource type to set 960 */ 961 public void setResourceType(String resourceType) { 962 963 m_resourceType = resourceType; 964 } 965 966 /** 967 * Sets the resultCount.<p> 968 * 969 * @param resultCount the resultCount to set 970 */ 971 public void setResultCount(int resultCount) { 972 973 m_resultCount = resultCount; 974 } 975 976 /** 977 * Sets the results.<p> 978 * 979 * @param results the results to set 980 */ 981 public void setResults(List<CmsResultItemBean> results) { 982 983 m_results = results; 984 } 985 986 /** 987 * Sets the search scope.<p> 988 * 989 * @param scope the search scope 990 */ 991 public void setScope(CmsGallerySearchScope scope) { 992 993 m_scope = scope; 994 } 995 996 /** 997 * Sets the server search types.<p> 998 * 999 * @param types the server search types 1000 */ 1001 public void setServerSearchTypes(List<String> types) { 1002 1003 m_serverSearchTypes = types; 1004 } 1005 1006 /** 1007 * Sets the sitemap preload data.<p> 1008 * 1009 * @param preloadData the sitemap preload data 1010 */ 1011 public void setSitemapPreloadData(CmsSitemapEntryBean preloadData) { 1012 1013 m_sitemapPreloadData = preloadData; 1014 } 1015 1016 /** 1017 * Sets the sortOrder.<p> 1018 * 1019 * @param sortOrder the sortOrder to set 1020 */ 1021 public void setSortOrder(String sortOrder) { 1022 1023 m_sortOrder = sortOrder; 1024 } 1025 1026 /** 1027 * Sets the tabId.<p> 1028 * 1029 * @param tabId the tabId to set 1030 */ 1031 public void setTabId(String tabId) { 1032 1033 m_tabId = tabId; 1034 } 1035 1036 /** 1037 * Sets the type names.<p> 1038 * 1039 * @param types the type names to set 1040 */ 1041 public void setTypes(List<String> types) { 1042 1043 if (types == null) { 1044 m_types = new ArrayList<String>(); 1045 } else { 1046 m_types = types; 1047 } 1048 } 1049 1050 /** 1051 * Sets the VFS tree preload data.<p> 1052 * 1053 * @param preloadData the VFS tree preload data 1054 */ 1055 public void setVfsPreloadData(CmsVfsEntryBean preloadData) { 1056 1057 m_vfsPreloadData = preloadData; 1058 } 1059}