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        /**
033         * Determines who may subscribe and retrieve items
034         * 
035         * <p><b>Value: {@link AccessModel}</b></p>
036         */
037        access_model,
038
039        /**
040         * The URL of an XSL transformation which can be applied to 
041         * payloads in order to generate an appropriate message
042         * body element
043         * 
044         * <p><b>Value: {@link URL}</b></p>
045         */
046        body_xslt,
047        
048        /**
049         * The collection with which a node is affiliated
050         * 
051         * <p><b>Value: String</b></p>
052         */
053        collection,
054
055        /**
056         * The URL of an XSL transformation which can be applied to 
057         * payload format in order to generate a valid Data Forms result 
058         * that the client could display using a generic Data Forms 
059         * rendering engine body element.
060         * 
061         * <p><b>Value: {@link URL}</b></p>
062         */
063        dataform_xslt,
064
065        /**
066         * Whether to deliver payloads with event notifications
067         *
068         * <p><b>Value: boolean</b></p>
069         */
070        deliver_payloads,
071        
072        /**
073         * Whether owners or publisher should receive replies to items
074         *
075         * <p><b>Value: {@link ItemReply}</b></p>
076         */
077        itemreply,
078        
079        /**
080         * Who may associate leaf nodes with a collection
081         * 
082         * <p><b>Value: {@link ChildrenAssociationPolicy}</b></p>
083         */
084        children_association_policy,
085        
086        /**
087         * The list of JIDs that may associate leaf nodes with a 
088         * collection
089         * 
090         * <p><b>Value: List of JIDs as Strings</b></p>
091         */
092        children_association_whitelist,
093        
094        /**
095         * The child nodes (leaf or collection) associated with a collection
096         * 
097         * <p><b>Value: List of Strings</b></p>
098         */
099        children,
100        
101        /**
102         * The maximum number of child nodes that can be associated with a 
103         * collection
104         * 
105         * <p><b>Value: int</b></p>
106         */
107        children_max,
108        
109        /**
110         * The maximum number of items to persist
111         * 
112         * <p><b>Value: int</b></p>
113         */
114        max_items,
115        
116        /**
117         * The maximum payload size in bytes
118         * 
119         * <p><b>Value: int</b></p>
120         */
121        max_payload_size,
122        
123        /**
124         * Whether the node is a leaf (default) or collection
125         * 
126         * <p><b>Value: {@link NodeType}</b></p>
127         */
128        node_type,
129        
130        /**
131         * Whether to notify subscribers when the node configuration changes
132         * 
133         * <p><b>Value: boolean</b></p>
134         */
135        notify_config,
136        
137        /**
138         * Whether to notify subscribers when the node is deleted
139         * 
140         * <p><b>Value: boolean</b></p>
141         */
142        notify_delete,
143
144        /**
145         * Whether to notify subscribers when items are removed from the node
146         * 
147         * <p><b>Value: boolean</b></p>
148         */
149        notify_retract,
150        
151        /**
152         * Whether to persist items to storage.  This is required to have multiple 
153         * items in the node. 
154         * 
155         * <p><b>Value: boolean</b></p>
156         */
157        persist_items,
158        
159        /**
160         * Whether to deliver notifications to available users only
161         * 
162         * <p><b>Value: boolean</b></p>
163         */
164        presence_based_delivery,
165
166        /**
167         * Defines who can publish to the node
168         * 
169         * <p><b>Value: {@link PublishModel}</b></p>
170         */
171        publish_model,
172        
173        /**
174         * The specific multi-user chat rooms to specify for replyroom
175         * 
176         * <p><b>Value: List of JIDs as Strings</b></p>
177         */
178        replyroom,
179        
180        /**
181         * The specific JID(s) to specify for replyto
182         * 
183         * <p><b>Value: List of JIDs as Strings</b></p>
184         */
185        replyto,
186        
187        /**
188         * The roster group(s) allowed to subscribe and retrieve items
189         * 
190         * <p><b>Value: List of strings</b></p>
191         */
192        roster_groups_allowed,
193        
194        /**
195         * Whether to allow subscriptions
196         * 
197         * <p><b>Value: boolean</b></p>
198         */
199        subscribe,
200        
201        /**
202         * A friendly name for the node
203         * 
204         * <p><b>Value: String</b></p>
205         */
206        title,
207        
208        /**
209         * The type of node data, ussually specified by the namespace 
210         * of the payload(if any);MAY be a list-single rather than a 
211         * text single
212         * 
213         * <p><b>Value: String</b></p>
214         */
215        type;
216        
217        public String getFieldName()
218        {
219                return "pubsub#" + toString();
220        }
221}