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.publish.shared;
029
030import org.opencms.util.CmsUUID;
031
032import java.util.List;
033
034import com.google.common.collect.Lists;
035import com.google.gwt.user.client.rpc.IsSerializable;
036
037/**
038 * Contains the data on which a workflow action should act (usually, a list of resources).<p>
039 */
040public class CmsWorkflowActionParams implements IsSerializable {
041
042    /** The list of structure ids of resources to publish .*/
043    private List<CmsUUID> m_publishIds = Lists.newArrayList();
044
045    /** The list of structure ids of resources to remove. */
046    private List<CmsUUID> m_removeIds = Lists.newArrayList();
047
048    /** The publish list token. */
049    private CmsPublishListToken m_token;
050
051    /**
052     * Creates a new instance based on a publish list token.<p>
053     *
054     * @param token the publish list token
055     */
056    public CmsWorkflowActionParams(CmsPublishListToken token) {
057
058        m_token = token;
059    }
060
061    /**
062     * Creates a new instance based on lists of resources.<p>
063     *
064     * @param publishIds the list of structure ids of resources to publish
065     * @param removeIds the list of structure ids of resources to remove
066     */
067    public CmsWorkflowActionParams(List<CmsUUID> publishIds, List<CmsUUID> removeIds) {
068
069        m_publishIds = publishIds;
070        m_removeIds = removeIds;
071    }
072
073    /**
074     * Default constructor for serialization.<p>
075     */
076    protected CmsWorkflowActionParams() {
077
078        // do nothing
079    }
080
081    /**
082     * Returns the publishIds.<p>
083     *
084     * @return the publishIds
085     */
086    public List<CmsUUID> getPublishIds() {
087
088        return m_publishIds;
089    }
090
091    /**
092     * Returns the removeIds.<p>
093     *
094     * @return the removeIds
095     */
096    public List<CmsUUID> getRemoveIds() {
097
098        return m_removeIds;
099    }
100
101    /**
102     * Gets the publish list token,  if it is set, else returns null.<p>
103     *
104     * The publish list token is a bean which can be used to reconstruct a publish list on the server side.
105     * It is used instead of sending the list of resources when that list is deemed to long to be displayed.<p>
106     *
107     * @return the publish list token
108     */
109    public CmsPublishListToken getToken() {
110
111        return m_token;
112    }
113
114}