001/**
002 *
003 * Copyright the original author or authors
004 *
005 * Licensed under the Apache License, Version 2.0 (the "License");
006 * you may not use this file except in compliance with the License.
007 * You may obtain a copy of the License at
008 *
009 *     http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017package org.jivesoftware.smackx.pubsub;
018
019import java.net.URL;
020
021import org.jivesoftware.smackx.xdata.Form;
022
023/**
024 * This enumeration represents all the fields of a node configuration form.  This enumeration
025 * is not required when using the {@link ConfigureForm} to configure nodes, but may be helpful
026 * for generic UI's using only a {@link Form} for configuration.
027 *
028 * @author Robin Collier
029 */
030public enum ConfigureNodeFields {
031    /**
032     * Determines who may subscribe and retrieve items.
033     *
034     * <p><b>Value: {@link AccessModel}</b></p>
035     */
036    access_model,
037
038    /**
039     * The URL of an XSL transformation which can be applied to
040     * payloads in order to generate an appropriate message
041     * body element.
042     *
043     * <p><b>Value: {@link URL}</b></p>
044     */
045    body_xslt,
046
047    /**
048     * The collection with which a node is affiliated.
049     *
050     * <p><b>Value: String</b></p>
051     */
052    collection,
053
054    /**
055     * The URL of an XSL transformation which can be applied to
056     * payload format in order to generate a valid Data Forms result
057     * that the client could display using a generic Data Forms
058     * rendering engine body element.
059     *
060     * <p><b>Value: {@link URL}</b></p>
061     */
062    dataform_xslt,
063
064    /**
065     * Whether to deliver payloads with event notifications.
066     *
067     * <p><b>Value: boolean</b></p>
068     */
069    deliver_payloads,
070
071    /**
072     * Whether owners or publisher should receive replies to items.
073     *
074     * <p><b>Value: {@link ItemReply}</b></p>
075     */
076    itemreply,
077
078    /**
079     * Who may associate leaf nodes with a collection.
080     *
081     * <p><b>Value: {@link ChildrenAssociationPolicy}</b></p>
082     */
083    children_association_policy,
084
085    /**
086     * The list of JIDs that may associate leaf nodes with a
087     * collection.
088     *
089     * <p><b>Value: List of JIDs as Strings</b></p>
090     */
091    children_association_whitelist,
092
093    /**
094     * The child nodes (leaf or collection) associated with a collection.
095     *
096     * <p><b>Value: List of Strings</b></p>
097     */
098    children,
099
100    /**
101     * The maximum number of child nodes that can be associated with a
102     * collection.
103     *
104     * <p><b>Value: int</b></p>
105     */
106    children_max,
107
108    /**
109     * The maximum number of items to persist.
110     *
111     * <p><b>Value: int</b></p>
112     */
113    max_items,
114
115    /**
116     * The maximum payload size in bytes.
117     *
118     * <p><b>Value: int</b></p>
119     */
120    max_payload_size,
121
122    /**
123     * Whether the node is a leaf (default) or collection.
124     *
125     * <p><b>Value: {@link NodeType}</b></p>
126     */
127    node_type,
128
129    /**
130     * Whether to notify subscribers when the node configuration changes.
131     *
132     * <p><b>Value: boolean</b></p>
133     */
134    notify_config,
135
136    /**
137     * Whether to notify subscribers when the node is deleted.
138     *
139     * <p><b>Value: boolean</b></p>
140     */
141    notify_delete,
142
143    /**
144     * Whether to notify subscribers when items are removed from the node.
145     *
146     * <p><b>Value: boolean</b></p>
147     */
148    notify_retract,
149
150    /**
151     * The type of notification that the nodes sends.
152     *
153     * <p><b>Value:  {@link NotificationType}</b></p>
154     */
155    notification_type,
156
157    /**
158     * Whether to persist items to storage.  This is required to have. multiple
159     * items in the node.
160     *
161     * <p><b>Value: boolean</b></p>
162     */
163    persist_items,
164
165    /**
166     * Whether to deliver notifications to available users only.
167     *
168     * <p><b>Value: boolean</b></p>
169     */
170    presence_based_delivery,
171
172    /**
173     * Defines who can publish to the node.
174     *
175     * <p><b>Value: {@link PublishModel}</b></p>
176     */
177    publish_model,
178
179    /**
180     * The specific multi-user chat rooms to specify for replyroom.
181     *
182     * <p><b>Value: List of JIDs as Strings</b></p>
183     */
184    replyroom,
185
186    /**
187     * The specific JID(s) to specify for replyto.
188     *
189     * <p><b>Value: List of JIDs as Strings</b></p>
190     */
191    replyto,
192
193    /**
194     * The roster group(s) allowed to subscribe and retrieve items.
195     *
196     * <p><b>Value: List of strings</b></p>
197     */
198    roster_groups_allowed,
199
200    /**
201     * Whether to allow subscriptions.
202     *
203     * <p><b>Value: boolean</b></p>
204     */
205    subscribe,
206
207    /**
208     * A friendly name for the node.
209     *
210     * <p><b>Value: String</b></p>
211     */
212    title,
213
214    /**
215     * The type of node data, usually specified by the namespace
216     * of the payload(if any);MAY be a list-single rather than a
217     * text single.
218     *
219     * <p><b>Value: String</b></p>
220     */
221    type;
222
223    public String getFieldName() {
224        return "pubsub#" + toString();
225    }
226}