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.sitemap.shared;
029
030import org.opencms.gwt.shared.property.CmsClientProperty;
031import org.opencms.util.CmsUUID;
032
033import java.util.Map;
034
035/**
036 * The interface to the sitemap controller.<p>
037 *
038 * This interface allows classes which are shared between client and server to access client-only functionality without
039 * statically depending on client-only code.<p>
040 *
041 * @since 8.0.0
042 */
043public interface I_CmsSitemapController {
044
045    /**
046     * Gets the property map for the given id.<p>
047     *
048     * @param id a structure id
049     *
050     * @return the property map for that structure id
051     */
052    Map<String, CmsClientProperty> getPropertiesForId(CmsUUID id);
053
054    /**
055     * Registers the given entry within the data model.<p>
056     *
057     * @param entry the entry to register
058     */
059    void registerEntry(CmsClientSitemapEntry entry);
060
061    /**
062     * Registers the change of the sitepath with the given controller.<p>
063     *
064     * @param entry the sitemap entry
065     * @param oldPath the old path
066     */
067    void registerPathChange(CmsClientSitemapEntry entry, String oldPath);
068
069    /**
070     * This method is used to establish a unique property map object for each id, but replaces the contents of the
071     * map object with new values for each call.<p>
072     *
073     * The first call to the method with a given id will just return the map passed in. The n-th call to the method
074     * with a given id will return the map object passed in with the first method call for that id, but with its contents
075     * replaced by the contents of the map passed in with the n-th call for that id.<p>
076     *
077     * The purpose of this is to avoid multiple redundant copies of the same logical map of properties being stored
078     * in multiple places.<p>
079     *
080     * @param id the map identifying the resource to which the properties belong
081     * @param properties the new properties for the given id
082     *
083     * @return the original properties object for the given id, but with its contents replaced
084     */
085    Map<String, CmsClientProperty> replaceProperties(CmsUUID id, Map<String, CmsClientProperty> properties);
086
087}