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