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