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 GmbH & Co. KG, 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.site;
029
030import org.opencms.file.CmsObject;
031import org.opencms.file.CmsResource;
032import org.opencms.i18n.CmsLocaleManager;
033import org.opencms.main.CmsLog;
034import org.opencms.main.OpenCms;
035import org.opencms.util.CmsStringUtil;
036import org.opencms.util.CmsUUID;
037
038import java.io.Serializable;
039import java.util.ArrayList;
040import java.util.List;
041import java.util.Locale;
042import java.util.Map;
043import java.util.SortedMap;
044import java.util.TreeMap;
045
046import org.apache.commons.logging.Log;
047
048import com.google.common.collect.Lists;
049import com.google.common.collect.Maps;
050
051/**
052 * Describes a configured site in OpenCms.<p>
053 *
054 * @since 6.0.0
055 */
056public final class CmsSite implements Cloneable, Comparable<CmsSite>, Serializable {
057
058    /**
059     * The site localization modes.<p>
060     */
061    public enum LocalizationMode {
062        /** The multi tree localization mode. */
063        multiTree,
064
065        /** The single tree localization mode. */
066        singleTree,
067
068        /** The default mode. */
069        standard
070    }
071
072    /** The localization mode parameter name. */
073    public static final String PARAM_LOCALIZATION_MODE = "localizationMode";
074
075    /** Parameter name for the main locale. */
076    public static final String PARAM_MAIN_LOCALE = "locale.main";
077
078    /** Parameter name for the secondary locales. */
079    public static final String PARAM_SECONDARY_LOCALES = "locale.secondary";
080
081    /** Log instance. */
082    private static final Log LOG = CmsLog.getLog(CmsSite.class);
083
084    /** The serial version id. */
085    private static final long serialVersionUID = 815429861399510277L;
086    /** The aliases for this site, a vector of CmsSiteMatcher Objects. */
087    private List<CmsSiteMatcher> m_aliases = new ArrayList<CmsSiteMatcher>();
088
089    /** The URI to use as error page for this site. */
090    private String m_errorPage;
091
092    /** If exclusive, and set to true will generate a 404 error, if set to false will redirect to secure url. */
093    private boolean m_exclusiveError;
094
095    /** If set to true, secure resources will only be available using the configured secure url. */
096    private boolean m_exclusiveUrl;
097
098    /**Indicates is this site was published once to the online repo. */
099    private boolean m_isOnlineUpdated;
100
101    /** The localization mode. */
102    private LocalizationMode m_localizationMode;
103
104    /** The site parameters. */
105    private SortedMap<String, String> m_parameters;
106
107    /** This value defines a relative sorting order. */
108    private float m_position;
109
110    /** The Url of the secure server. */
111    private CmsSiteMatcher m_secureServer;
112
113    /** The site matcher that describes the site. */
114    private CmsSiteMatcher m_siteMatcher;
115
116    /** Root directory of this site in the OpenCms VFS. */
117    private String m_siteRoot;
118
119    /** UUID of this site's root directory in the OpenCms VFS. */
120    private CmsUUID m_siteRootUUID;
121
122    /**The SSL Mode of the site. */
123    private CmsSSLMode m_sslMode = CmsSSLMode.SECURE_SERVER;
124
125    /** Display title of this site. */
126    private String m_title;
127
128    /** True if permanent redirects should be used when redirecting to the secure URL of this site. */
129    private boolean m_usesPermanentRedirects;
130
131    /** Indicates whether this site should be considered when writing the web server configuration. */
132    private boolean m_webserver = true;
133
134    /**
135     * Constructs a new site object without title and id information,
136     * this is to be used for lookup purposes only.<p>
137     *
138     * @param siteRoot root directory of this site in the OpenCms VFS
139     * @param siteMatcher the site matcher for this site
140     */
141    public CmsSite(String siteRoot, CmsSiteMatcher siteMatcher) {
142
143        this(siteRoot, CmsUUID.getNullUUID(), siteRoot, siteMatcher, "");
144    }
145
146    /**
147     * Constructs a new site object with a default (wildcard) a site matcher,
148     * this is to be used for display purposes only.<p>
149     *
150     * @param siteRoot root directory of this site in the OpenCms VFS
151     * @param siteRootUUID UUID of this site's root directory in the OpenCms VFS
152     * @param title display name of this site
153     */
154    public CmsSite(String siteRoot, CmsUUID siteRootUUID, String title) {
155
156        this(siteRoot, siteRootUUID, title, CmsSiteMatcher.DEFAULT_MATCHER, "");
157    }
158
159    /**
160     * Constructs a new site object.<p>
161     *
162     * @param siteRoot root directory of this site in the OpenCms VFS
163     * @param siteRootUUID UUID of this site's root directory in the OpenCms VFS
164     * @param title display name of this site
165     * @param siteMatcher the site matcher for this site
166     * @param position the sorting position
167     */
168    public CmsSite(String siteRoot, CmsUUID siteRootUUID, String title, CmsSiteMatcher siteMatcher, String position) {
169
170        setSiteRoot(siteRoot);
171        setSiteRootUUID(siteRootUUID);
172        setTitle(title);
173        setSiteMatcher(siteMatcher);
174        // init the position value
175        m_position = Float.MAX_VALUE;
176        try {
177            if (position != null) {
178                m_position = Float.parseFloat(position);
179            }
180        } catch (Throwable e) {
181            // m_position will have Float.MAX_VALUE, so this site will appear last
182        }
183    }
184
185    /**
186     * Constructs a new site object.<p>
187     *
188     * @param siteRoot root directory of this site in the OpenCms VFS
189     * @param siteRootUUID UUID of this site's root directory in the OpenCms VFS
190     * @param title display name of this site
191     * @param siteMatcher the site matcher for this site
192     * @param position the sorting position
193     * @param errorPage the optional error page for this site
194     * @param secureSite the secure site
195     * @param exclusiveUrl the exclusive flag
196     * @param exclusiveError the exclusive error flag
197     * @param webserver indicates whether to write the web server configuration for this site or not
198     * @param aliases the aliases
199     */
200    public CmsSite(
201        String siteRoot,
202        CmsUUID siteRootUUID,
203        String title,
204        CmsSiteMatcher siteMatcher,
205        String position,
206        String errorPage,
207        CmsSiteMatcher secureSite,
208        boolean exclusiveUrl,
209        boolean exclusiveError,
210        boolean webserver,
211        List<CmsSiteMatcher> aliases) {
212
213        setSiteRoot(siteRoot);
214        setSiteRootUUID(siteRootUUID);
215        setTitle(title);
216        setSiteMatcher(siteMatcher);
217        // init the position value
218        m_position = Float.MAX_VALUE;
219        try {
220            m_position = Float.parseFloat(position);
221        } catch (Throwable e) {
222            // m_position will have Float.MAX_VALUE, so this site will appear last
223        }
224        setErrorPage(errorPage);
225        setSecureServer(secureSite);
226        setExclusiveUrl(exclusiveUrl);
227        setExclusiveError(exclusiveError);
228        setWebserver(webserver);
229        setAliases(aliases);
230    }
231
232    /**
233     * Constructs a new site object without title and id information,
234     * with a site matcher generated from the provided URL.<p>
235     *
236     * This is to be used for test purposes only.<p>
237     *
238     * @param siteRoot root directory of this site in the OpenCms VFS
239     * @param siteURL the URL to create the site matcher for this site from
240     */
241    public CmsSite(String siteRoot, String siteURL) {
242
243        this(siteRoot, new CmsSiteMatcher(siteURL));
244    }
245
246    /**
247     * Returns a clone of this Objects instance.<p>
248     *
249     * @return a clone of this instance
250     */
251    @Override
252    public CmsSite clone() {
253
254        CmsSite res = new CmsSite(
255            getSiteRoot(),
256            (CmsUUID)getSiteRootUUID().clone(),
257            getTitle(),
258            (CmsSiteMatcher)getSiteMatcher().clone(),
259            String.valueOf(getPosition()),
260            getErrorPage(),
261            getSecureServer(),
262            isExclusiveUrl(),
263            isExclusiveError(),
264            isWebserver(),
265            getAliases());
266        res.setParameters(getParameters());
267        res.setSSLMode(getSSLMode());
268        return res;
269    }
270
271    /**
272     * @see java.lang.Comparable#compareTo(java.lang.Object)
273     */
274    public int compareTo(CmsSite that) {
275
276        if (that == this) {
277            return 0;
278        }
279        float thatPos = that.getPosition();
280        // please note: can't just subtract and cast to int here because of float precision loss
281        if (m_position == thatPos) {
282            if (m_position == Float.MAX_VALUE) {
283                // if they both do not have any position, sort by title
284                return m_title.compareTo((that).getTitle());
285            }
286            return 0;
287        }
288        return (m_position < thatPos) ? -1 : 1;
289    }
290
291    /**
292     * @see java.lang.Object#equals(java.lang.Object)
293     */
294    @Override
295    public boolean equals(Object obj) {
296
297        if (obj == this) {
298            return true;
299        }
300        if (obj instanceof CmsSite) {
301            return (m_siteMatcher != null) && m_siteMatcher.equals(((CmsSite)obj).m_siteMatcher);
302        }
303        return false;
304    }
305
306    /**
307     * Returns the aliases for this site.<p>
308     *
309     * @return a ArrayList with the aliases
310     */
311    public List<CmsSiteMatcher> getAliases() {
312
313        return m_aliases;
314    }
315
316    /**
317     * Gets all site matchers which should be used for matching the site.<p>
318     *
319     * @return all site matchers to be used for matching the site
320     */
321    public List<CmsSiteMatcher> getAllMatchers() {
322
323        List<CmsSiteMatcher> result = Lists.newArrayList();
324        switch (getSSLMode()) {
325            case LETS_ENCRYPT:
326            case MANUAL_EP_TERMINATION:
327                List<CmsSiteMatcher> baseMatchers = Lists.newArrayList();
328                baseMatchers.add(m_siteMatcher);
329                for (CmsSiteMatcher alias : m_aliases) {
330                    baseMatchers.add(alias);
331                }
332                // For each matcher, compute both a https and http variant.
333                // Store them in a map, so we don't get duplicates if the variants have both
334                // been manually defined
335                Map<String, CmsSiteMatcher> matchersByUrl = Maps.newHashMap();
336                for (CmsSiteMatcher matcher : baseMatchers) {
337                    CmsSiteMatcher httpMatcher = matcher.forDifferentScheme("http");
338                    CmsSiteMatcher httpsMatcher = matcher.forDifferentScheme("https");
339                    for (CmsSiteMatcher current : new CmsSiteMatcher[] {httpMatcher, httpsMatcher}) {
340                        matchersByUrl.put(current.getUrl(), current);
341                    }
342                }
343                return Lists.newArrayList(matchersByUrl.values());
344
345            case NO:
346            case SECURE_SERVER:
347            case MANUAL:
348            default:
349                result = Lists.newArrayList();
350                result.add(m_siteMatcher);
351                for (CmsSiteMatcher alias : m_aliases) {
352                    result.add(alias);
353                }
354                if (m_secureServer != null) {
355                    result.add(m_secureServer);
356                }
357                return result;
358
359        }
360
361    }
362
363    /**
364     * Returns the errorPage.<p>
365     *
366     * @return the errorPage
367     */
368    public String getErrorPage() {
369
370        return m_errorPage;
371    }
372
373    /**
374     * Returns the localization mode.<p>
375     *
376     * @return the localization mode
377     */
378    public LocalizationMode getLocalizationMode() {
379
380        if (m_localizationMode == null) {
381            try {
382                m_localizationMode = LocalizationMode.valueOf(m_parameters.get(PARAM_LOCALIZATION_MODE));
383            } catch (Exception e) {
384                m_localizationMode = LocalizationMode.standard;
385            }
386        }
387        return m_localizationMode;
388    }
389
390    /**
391     * Gets the main translation locale for this site.<p>
392     *
393     * @param defaultValue the value to return as a default when no main translation locale is set
394     * @return the main translation locale
395     */
396    public Locale getMainTranslationLocale(Locale defaultValue) {
397
398        Map<String, String> params = getParameters();
399        String value = params.get(PARAM_MAIN_LOCALE);
400        if (!CmsStringUtil.isEmpty(value)) {
401            return CmsLocaleManager.getLocale(value);
402        } else {
403            return defaultValue;
404        }
405    }
406
407    /**
408     * Returns the parameters.<p>
409     *
410     * @return the parameters
411     */
412    public SortedMap<String, String> getParameters() {
413
414        return m_parameters;
415    }
416
417    /**
418     * Returns the sorting position.<p>
419     *
420     * @return the sorting position
421     */
422    public float getPosition() {
423
424        return m_position;
425    }
426
427    /**
428     * Gets the list of secondary translation locales.<p>
429     *
430     * @return the list of secondary translation locales
431     */
432    public List<Locale> getSecondaryTranslationLocales() {
433
434        List<Locale> result = Lists.newArrayList();
435        Map<String, String> params = getParameters();
436        String value = params.get(PARAM_SECONDARY_LOCALES);
437        if (!CmsStringUtil.isEmpty(value)) {
438            String[] tokens = value.trim().split(" *, *");
439            for (String token : tokens) {
440                Locale locale = CmsLocaleManager.getLocale(token);
441                if (!result.contains(locale)) {
442                    result.add(locale);
443                }
444            }
445        }
446        return result;
447    }
448
449    /**
450     * Returns the secureServer.<p>
451     *
452     * @return the secureServer
453     */
454    public CmsSiteMatcher getSecureServer() {
455
456        return m_secureServer;
457    }
458
459    /**
460     * Returns the secure server url of this site root.<p>
461     *
462     * @return the secure server url
463     */
464    public String getSecureUrl() {
465
466        if (m_secureServer != null) {
467            return m_secureServer.getUrl();
468        } else {
469            LOG.warn(Messages.get().getBundle().key(Messages.ERR_SECURESERVER_MISSING_1, toString()));
470            return getUrl();
471        }
472    }
473
474    /**
475     * Returns the server prefix for the given resource in this site, used to distinguish between
476     * secure (https) and non-secure (http) sites.<p>
477     *
478     * This is required since a resource may have an individual "secure" setting using the property
479     * {@link org.opencms.file.CmsPropertyDefinition#PROPERTY_SECURE}, which means this resource
480     * must be delivered only using a secure protocol.<p>
481     *
482     * The result will look like <code>http://site.enterprise.com:8080/</code> or <code>https://site.enterprise.com/</code>.<p>
483     *
484     * @param cms the current users OpenCms context
485     * @param resource the resource to use
486     *
487     * @return the server prefix for the given resource in this site
488     *
489     * @see #getServerPrefix(CmsObject, String)
490     */
491    public String getServerPrefix(CmsObject cms, CmsResource resource) {
492
493        return getServerPrefix(cms, resource.getRootPath());
494    }
495
496    /**
497     * Returns the server prefix for the given resource in this site, used to distinguish between
498     * secure (https) and non-secure (http) sites.<p>
499     *
500     * This is required since a resource may have an individual "secure" setting using the property
501     * {@link org.opencms.file.CmsPropertyDefinition#PROPERTY_SECURE}, which means this resource
502     * must be delivered only using a secure protocol.<p>
503     *
504     * The result will look like <code>http://site.enterprise.com:8080/</code> or <code>https://site.enterprise.com/</code>.<p>
505     *
506     * @param cms the current users OpenCms context
507     * @param resourceName the resource name
508     *
509     * @return the server prefix for the given resource in this site
510     *
511     * @see #getSecureUrl()
512     * @see #getUrl()
513     */
514    public String getServerPrefix(CmsObject cms, String resourceName) {
515
516        if (resourceName.startsWith(cms.getRequestContext().getSiteRoot())) {
517            // make sure this can also be used with a resource root path
518            resourceName = resourceName.substring(cms.getRequestContext().getSiteRoot().length());
519        }
520        boolean secure = OpenCms.getStaticExportManager().isSecureLink(
521            cms,
522            resourceName,
523            cms.getRequestContext().isSecureRequest());
524
525        return (secure ? getSecureUrl() : getUrl());
526    }
527
528    /**
529     * Returns the site matcher that describes the URL of this site.<p>
530     *
531     * @return the site matcher that describes the URL of this site
532     */
533    public CmsSiteMatcher getSiteMatcher() {
534
535        return m_siteMatcher;
536    }
537
538    /**
539     * Returns the site path for the given root path in case the root path
540     * actually starts with this site root, or <code>null</code> in case
541     * the root path does not.<p>
542     *
543     * @param rootPath the root path to get the site path for
544     *
545     * @return the site path for the given root path in case the root path
546     *      actually starts with this site root, or <code>null</code> in case
547     *      the root path does not
548     */
549    public String getSitePath(String rootPath) {
550
551        String result = null;
552        if (CmsStringUtil.isNotEmpty(rootPath)) {
553            if (rootPath.startsWith(m_siteRoot)) {
554                result = rootPath.substring(m_siteRoot.length());
555            }
556        }
557        return result;
558    }
559
560    /**
561     * Returns the path of this site's root directory in the OpenCms VFS without tailing slash.<p>
562     * <ul><li><code>e.g. /sites/default</code></li></ul>
563     *
564     * @return the path of this site's root directory in the OpenCms VFS without tailing slash
565     */
566    public String getSiteRoot() {
567
568        return m_siteRoot;
569    }
570
571    /**
572     * Returns the UUID of this site's root directory in the OpenCms VFS.<p>
573     *
574     * @return the UUID of this site's root directory in the OpenCms VFS
575     */
576    public CmsUUID getSiteRootUUID() {
577
578        return m_siteRootUUID;
579    }
580
581    /**
582     * Gets the SSLMode of the site.<p>
583     *
584     * @return CmsSSLMode
585     */
586    public CmsSSLMode getSSLMode() {
587
588        return m_sslMode;
589    }
590
591    /**
592     * Returns the display title of this site.<p>
593     *
594     * @return the display title of this site
595     */
596    public String getTitle() {
597
598        return m_title;
599    }
600
601    /**
602     * Returns the server url of this site root.<p>
603     *
604     * @return the server url
605     */
606    public String getUrl() {
607
608        return m_siteMatcher.getUrl();
609    }
610
611    /**
612     * @see java.lang.Object#hashCode()
613     */
614    @Override
615    public int hashCode() {
616
617        return m_siteRootUUID.hashCode();
618    }
619
620    /**
621     * Returns true, if the site has a secure server.<p>
622     *
623     * @return true, if the site has a secure server
624     */
625    public boolean hasSecureServer() {
626
627        return m_secureServer != null;
628    }
629
630    /**
631     * Returns the exclusive error flag.<p>
632     *
633     * @return <code>true</code> will generate a 404 error,
634     *      or <code>false</code> will redirect to secure url.
635     */
636    public boolean isExclusiveError() {
637
638        return m_exclusiveError;
639    }
640
641    /**
642     * Returns the exclusive protocol flag.<p>
643     *
644     * @return <code>true</code> secure resources will only be available using the configured secure url,
645     *      or <code>false</code> if the uri (protocol + servername) does not really matter.
646     */
647    public boolean isExclusiveUrl() {
648
649        return m_exclusiveUrl;
650    }
651
652    /**
653     * Checks if the site it in the online project.<p>
654     * @return true if it is in online project
655     */
656    public boolean isOnlineUpdated() {
657
658        return m_isOnlineUpdated;
659    }
660
661    /**
662     * Returns a flag indicating if the site is the shared site.
663     *
664     * @return <code>true</code> if the site is the shared site,
665     *      or <code>false</code> if it is not the shared site.
666     */
667    public boolean isSharedSite() {
668
669        return OpenCms.getSiteManager().getSharedFolder().equals(m_siteRoot + "/");
670    }
671
672    /**
673     * Returns the web server.<p>
674     *
675     * @return the web server
676     */
677    public boolean isWebserver() {
678
679        return m_webserver;
680    }
681
682    /**
683     * Sets the errorPage.<p>
684     *
685     * @param errorPage the errorPage to set
686     */
687    public void setErrorPage(String errorPage) {
688
689        m_errorPage = errorPage;
690    }
691
692    /**
693     * Sets the exclusive error flag.<p>
694     *
695     * @param error the exclusive error flag
696     */
697    public void setExclusiveError(boolean error) {
698
699        m_exclusiveError = error;
700    }
701
702    /**
703     * Sets the exclusive protocol flag.<p>
704     *
705     * @param exclusive the exclusive protocol flag
706     */
707    public void setExclusiveUrl(boolean exclusive) {
708
709        m_exclusiveUrl = exclusive;
710    }
711
712    /**
713     * Sets the online status.
714     *
715     * @param isOnline true -> site has online version
716     */
717    public void sethasOnlineUpdated(boolean isOnline) {
718
719        m_isOnlineUpdated = isOnline;
720
721    }
722
723    /**
724     * Sets the parameters.<p>
725     *
726     * @param parameters the parameters to set
727     */
728    public void setParameters(SortedMap<String, String> parameters) {
729
730        m_parameters = new TreeMap<String, String>(parameters);
731    }
732
733    /**
734     * Sets the server URL prefix to which this site is mapped.<p>
735     *
736     * @param siteRoot the server URL prefix to which this site is mapped
737     */
738    public void setSiteRoot(String siteRoot) {
739
740        // site roots must never end with a "/"
741        if (siteRoot.endsWith("/")) {
742            m_siteRoot = siteRoot.substring(0, siteRoot.length() - 1);
743        } else {
744            m_siteRoot = siteRoot;
745        }
746    }
747
748    /**
749     * Sets the SSLMode of the site.<p>
750     *
751     * @param mode the CmsSSLMode
752     */
753    public void setSSLMode(CmsSSLMode mode) {
754
755        m_sslMode = mode;
756    }
757
758    /**
759     * Enables use of permanent redirects instead of temporary redirects to the secure site.<p>
760     *
761     * @param usePermanentRedirects true if permanent redirects should be used
762     */
763    public void setUsePermanentRedirects(boolean usePermanentRedirects) {
764
765        m_usesPermanentRedirects = usePermanentRedirects;
766    }
767
768    /**
769     * Sets the web server.<p>
770     *
771     * @param webserver the web server to set
772     */
773    public void setWebserver(boolean webserver) {
774
775        m_webserver = webserver;
776    }
777
778    /**
779     * @see java.lang.Object#toString()
780     */
781    @Override
782    public String toString() {
783
784        StringBuffer result = new StringBuffer(128);
785        result.append("server: ");
786        result.append(m_siteMatcher != null ? m_siteMatcher.toString() : "null");
787        // some extra effort to make debugging easier
788        if (m_siteRoot != null) {
789            result.append(" siteRoot: ");
790            result.append(m_siteRoot);
791        } else {
792            result.append(" (no siteRoot)");
793        }
794        if (m_title != null) {
795            result.append(" title: ");
796            result.append(m_title);
797        } else {
798            result.append(" (no title)");
799        }
800        return result.toString();
801    }
802
803    /**
804     * Returns true if permanent redirects should be used for redirecting to the secure URL for this site.<p>
805     *
806     * @return true if permanent redirects should be used
807     */
808    public boolean usesPermanentRedirects() {
809
810        return m_usesPermanentRedirects;
811    }
812
813    /**
814     * Adds an alias for the site.<p>
815     *
816     * @param aliasServer the sitematcher for the alias
817     */
818    protected void addAlias(CmsSiteMatcher aliasServer) {
819
820        m_aliases.add(aliasServer);
821    }
822
823    /**
824     * Returns the site matcher for the secure site, or null if no secure site is defined.<p>
825     *
826     * @return the site matcher for the secure site
827     */
828    protected CmsSiteMatcher getSecureServerMatcher() {
829
830        return m_secureServer;
831    }
832
833    /**
834     * Sets the aliases for the site.<p>
835     *
836     * @param aliases the aliases for the site
837     */
838    protected void setAliases(List<CmsSiteMatcher> aliases) {
839
840        m_aliases = aliases;
841    }
842
843    /**
844     * Sets the display title of this site.<p>
845     *
846     * @param position the display title of this site
847     */
848    protected void setPosition(float position) {
849
850        m_position = position;
851    }
852
853    /**
854     * Sets the secure server.<p>
855     *
856     * @param secureServer the sitematcher of the secure server
857     */
858    protected void setSecureServer(CmsSiteMatcher secureServer) {
859
860        m_secureServer = secureServer;
861    }
862
863    /**
864     * Sets the site matcher that describes the URL of this site.<p>
865     *
866     * @param siteMatcher the site matcher that describes the URL of this site
867     */
868    protected void setSiteMatcher(CmsSiteMatcher siteMatcher) {
869
870        m_siteMatcher = siteMatcher;
871    }
872
873    /**
874     * Sets the UUID of this site's root directory in the OpenCms VFS.<p>
875     *
876     * @param siteRootUUID the UUID of this site's root directory in the OpenCms VFS
877     */
878    protected void setSiteRootUUID(CmsUUID siteRootUUID) {
879
880        m_siteRootUUID = siteRootUUID;
881    }
882
883    /**
884     * Sets the display title of this site.<p>
885     *
886     * @param name the display title of this site
887     */
888    protected void setTitle(String name) {
889
890        m_title = name;
891    }
892
893}