001/*
002 * (C) Copyright 2006-2007 Nuxeo SAS (http://nuxeo.com/) and contributors.
003 *
004 * All rights reserved. This program and the accompanying materials
005 * are made available under the terms of the GNU Lesser General Public License
006 * (LGPL) version 2.1 which accompanies this distribution, and is available at
007 * http://www.gnu.org/licenses/lgpl.html
008 *
009 * This library is distributed in the hope that it will be useful,
010 * but WITHOUT ANY WARRANTY; without even the implied warranty of
011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
012 * Lesser General Public License for more details.
013 *
014 * Contributors:
015 *     Nuxeo - initial API and implementation
016 *
017 * $Id$
018 */
019
020package org.nuxeo.ecm.webapp.helpers;
021
022import org.nuxeo.runtime.api.Framework;
023
024/**
025 * Seam event identifiers.
026 * <p>
027 * This should stay with nuxeo, since it is related to the nuxeo infrastructure. All code that depends on nuxeo
028 * infrastructure will need to depend on nuxeo anyways. NXCommon is not a good place to move this because it is used
029 * from nxruntime. It is not a good idea to add web client dependencies there.
030 *
031 * @author <a href="mailto:rcaraghin@nuxeo.com">Razvan Caraghin</a>
032 */
033public final class EventNames {
034    /**
035     * This is fired when the user selection changes. This should be listened by componens that want to do some work
036     * when the user selection changes, regardles of the type of selected document.
037     */
038    public static final String USER_ALL_DOCUMENT_TYPES_SELECTION_CHANGED = "userAllDocumentTypesSelectionChanged";
039
040    /**
041     * Fired when the selected domain changes. Should be listened by components interested specifically in domain
042     * selection change.
043     */
044    public static final String DOMAIN_SELECTION_CHANGED = "domainSelectionChanged";
045
046    /**
047     * Fired when content root selection is changed (like workspaces root, section root).
048     */
049    public static final String CONTENT_ROOT_SELECTION_CHANGED = "contentRootSelectionChanged";
050
051    /**
052     * Fired when a workspace root or section root selection changes.
053     *
054     * @deprecated content root children should be managed as regular documents
055     */
056    @Deprecated
057    public static final String CONTENT_ROOT_CHILD_SELECTION_CHANGED = "contentRootChildSelectionChanged";
058
059    /**
060     * Fired when a document selection changes ( file, folder etc not workspace or above ).
061     */
062    public static final String DOCUMENT_SELECTION_CHANGED = "documentSelectionChanged";
063
064    /**
065     * Fired when a folderish document selection changes.
066     */
067    public static final String FOLDERISHDOCUMENT_SELECTION_CHANGED = "folderishDocumentSelectionChanged";
068
069    /**
070     * Fired when a location selection changes.
071     */
072    public static final String LOCATION_SELECTION_CHANGED = "locationSelectionChanged";
073
074    /**
075     * Fired after navigating to a document, the document is passed as argument.
076     *
077     * @since 5.4.2
078     */
079    public static final String NAVIGATE_TO_DOCUMENT = "navigateToDocument";
080
081    /**
082     * Should be raised before an edited document is saved.
083     *
084     * @since 5.4.2
085     */
086    public static final String BEFORE_DOCUMENT_CHANGED = "beforeDocumentChanged";
087
088    /**
089     * Fired after a document is locked, the document is passed as argument.
090     *
091     * @since 5.4.2
092     */
093    public static final String DOCUMENT_LOCKED = "documentLocked";
094
095    /**
096     * Fired after a document is unlocked, the document is passed as argument.
097     *
098     * @since 5.4.2
099     */
100    public static final String DOCUMENT_UNLOCKED = "documentUnlocked";
101
102    /**
103     * Should be raised when a document is edited.
104     */
105    public static final String DOCUMENT_CHANGED = "documentChanged";
106
107    /**
108     * Should be raised when a stateful QueryModel is edited.
109     */
110    public static final String QUERY_MODEL_CHANGED = "queryModelChanged";
111
112    /**
113     * Should be raised when the children of the current document are modified.
114     */
115    public static final String DOCUMENT_CHILDREN_CHANGED = "documentChildrenChanged";
116
117    /**
118     * Should be raised when the user goes Home. This is useful to allow any components to revert to their uninitialized
119     * state if needed.
120     * <p>
121     * Ex: The tree and breadcrumb should not display anything because home is view_servers and they display what's
122     * inside a domain.
123     */
124    public static final String GO_HOME = "goHome";
125
126    /**
127     * Will be raised when a changeable document is created (but not saved).
128     */
129    public static final String NEW_DOCUMENT_CREATED = "changeableDocumentCreated";
130
131    /**
132     * Will be raised when a document is submitted for publication.
133     */
134    public static final String DOCUMENT_SUBMITED_FOR_PUBLICATION = "documentSubmitedForPublication";
135
136    /**
137     * This is raised when a proxy is created and need a moderation
138     */
139    public static final String PROXY_PUSLISHING_PENDING = "proxyPublishingPending";
140
141    public static final String DOCUMENT_UNPUBLISHED = "documentUnPublished";
142
143    /**
144     * This is raised when a proxy has been published.
145     */
146    public static final String PROXY_PUBLISHED = "proxyPublished";
147
148    /**
149     * This is raised when a document is published
150     */
151    public static final String DOCUMENT_PUBLISHED = "documentPublished";
152
153    /**
154     * This is raised when a document publication is rejected
155     */
156    public static final String DOCUMENT_PUBLICATION_REJECTED = "documentPublicationRejected";
157
158    /**
159     * This is raised when a document publication is rejected
160     */
161    public static final String DOCUMENT_PUBLICATION_APPROVED = "documentPublicationApproved";
162
163    /**
164     * Event raised when security is changed
165     */
166    public static final String DOCUMENT_SECURITY_CHANGED = "documentSecurityChanged";
167
168    /**
169     * Event raised when a search is performed
170     */
171    public static final String SEARCH_PERFORMED = "searchPerformed";
172
173    /**
174     * Event raised when user go to his personal workspace
175     */
176    public static final String GO_PERSONAL_WORKSPACE = "personnalWorkspace";
177
178    /**
179     * Event raised when the local configuration of a document has changed
180     */
181    public static final String LOCAL_CONFIGURATION_CHANGED = "localConfigurationChanged";
182
183    /**
184     * Event raised when the content of a directory has changed
185     *
186     * @since 5.5
187     */
188    public static final String DIRECTORY_CHANGED = "directoryChanged";
189
190    public static final String USER_SESSION_STARTED = "org.nuxeo.ecm.web.userSessionStarted";
191
192    /**
193     * Flush event sent to the Seam layer, only when using the dev mode, and useful for components to reset their cache
194     * smoothly: Seam components should not be destroyed completely.
195     *
196     * @since 5.6
197     * @see Framework#isDevModeSet()
198     */
199    public static final String FLUSH_EVENT = "flush";
200
201    // Constant utility class.
202    private EventNames() {
203    }
204
205}