001/*
002 * JGrapes Event Driven Framework
003 * Copyright (C) 2017-2018 Michael N. Lipp
004 * 
005 * This program is free software; you can redistribute it and/or modify it 
006 * under the terms of the GNU Affero General Public License as published by 
007 * the Free Software Foundation; either version 3 of the License, or 
008 * (at your option) any later version.
009 * 
010 * This program is distributed in the hope that it will be useful, but 
011 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
012 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License 
013 * for more details.
014 * 
015 * You should have received a copy of the GNU Affero General Public License along 
016 * with this program; if not, see <http://www.gnu.org/licenses/>.
017 */
018
019package org.jgrapes.portal.base.events;
020
021import java.util.List;
022
023import org.jdrupes.json.JsonObject;
024import org.jgrapes.core.Event;
025
026/**
027 * Notifies the server about a change of the portal layout. This event
028 * is sent by the browser when the layout changes due to user interaction
029 * (e.g. moving the preview representations) or due to notifications
030 * from the server (e.g. {@link RenderPortlet}).
031 * 
032 * The server should persist the layout and pass it back to the browser
033 * in response to {@link PortalReady} (see this event's description
034 * for details). 
035 */
036public class PortalLayoutChanged extends Event<Void> {
037
038    private final List<String> previewLayout;
039    private final List<String> tabsLayout;
040    private final JsonObject xtraInfo;
041
042    /**
043     * @param previewLayout
044     * @param tabsLayout
045     */
046    public PortalLayoutChanged(List<String> previewLayout,
047            List<String> tabsLayout, JsonObject xtraInfo) {
048        this.previewLayout = previewLayout;
049        this.tabsLayout = tabsLayout;
050        this.xtraInfo = xtraInfo;
051    }
052
053    /**
054     * @return the previewLayout
055     */
056    public List<String> previewLayout() {
057        return previewLayout;
058    }
059
060    /**
061     * @return the tabsLayout
062     */
063    public List<String> tabsLayout() {
064        return tabsLayout;
065    }
066
067    /**
068     * The extra information.
069     *
070     * @return the value
071     */
072    public JsonObject xtraInfo() {
073        return xtraInfo;
074    }
075
076}