Shuyi Chen | d7955ce | 2013-05-22 14:51:55 -0700 | [diff] [blame] | 1 | /**
|
| 2 | * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License");
|
| 3 | * you may not use this file except in compliance with the License.
|
| 4 | * You may obtain a copy of the License at
|
| 5 | *
|
| 6 | * http://www.apache.org/licenses/LICENSE-2.0
|
| 7 | *
|
| 8 | * Unless required by applicable law or agreed to in writing, software
|
| 9 | * distributed under the License is distributed on an "AS IS" BASIS,
|
| 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 11 | * See the License for the specific language governing permissions and
|
| 12 | * limitations under the License.
|
| 13 | */
|
| 14 | package org.jivesoftware.smackx.pubsub;
|
| 15 |
|
| 16 | import java.net.URL;
|
| 17 |
|
| 18 | import org.jivesoftware.smackx.Form;
|
| 19 |
|
| 20 | /**
|
| 21 | * This enumeration represents all the fields of a node configuration form. This enumeration
|
| 22 | * is not required when using the {@link ConfigureForm} to configure nodes, but may be helpful
|
| 23 | * for generic UI's using only a {@link Form} for configuration.
|
| 24 | *
|
| 25 | * @author Robin Collier
|
| 26 | */
|
| 27 | public enum ConfigureNodeFields
|
| 28 | {
|
| 29 | /**
|
| 30 | * Determines who may subscribe and retrieve items
|
| 31 | *
|
| 32 | * <p><b>Value: {@link AccessModel}</b></p>
|
| 33 | */
|
| 34 | access_model,
|
| 35 |
|
| 36 | /**
|
| 37 | * The URL of an XSL transformation which can be applied to
|
| 38 | * payloads in order to generate an appropriate message
|
| 39 | * body element
|
| 40 | *
|
| 41 | * <p><b>Value: {@link URL}</b></p>
|
| 42 | */
|
| 43 | body_xslt,
|
| 44 |
|
| 45 | /**
|
| 46 | * The collection with which a node is affiliated
|
| 47 | *
|
| 48 | * <p><b>Value: String</b></p>
|
| 49 | */
|
| 50 | collection,
|
| 51 |
|
| 52 | /**
|
| 53 | * The URL of an XSL transformation which can be applied to
|
| 54 | * payload format in order to generate a valid Data Forms result
|
| 55 | * that the client could display using a generic Data Forms
|
| 56 | * rendering engine body element.
|
| 57 | *
|
| 58 | * <p><b>Value: {@link URL}</b></p>
|
| 59 | */
|
| 60 | dataform_xslt,
|
| 61 |
|
| 62 | /**
|
| 63 | * Whether to deliver payloads with event notifications
|
| 64 | *
|
| 65 | * <p><b>Value: boolean</b></p>
|
| 66 | */
|
| 67 | deliver_payloads,
|
| 68 |
|
| 69 | /**
|
| 70 | * Whether owners or publisher should receive replies to items
|
| 71 | *
|
| 72 | * <p><b>Value: {@link ItemReply}</b></p>
|
| 73 | */
|
| 74 | itemreply,
|
| 75 |
|
| 76 | /**
|
| 77 | * Who may associate leaf nodes with a collection
|
| 78 | *
|
| 79 | * <p><b>Value: {@link ChildrenAssociationPolicy}</b></p>
|
| 80 | */
|
| 81 | children_association_policy,
|
| 82 |
|
| 83 | /**
|
| 84 | * The list of JIDs that may associate leaf nodes with a
|
| 85 | * collection
|
| 86 | *
|
| 87 | * <p><b>Value: List of JIDs as Strings</b></p>
|
| 88 | */
|
| 89 | children_association_whitelist,
|
| 90 |
|
| 91 | /**
|
| 92 | * The child nodes (leaf or collection) associated with a collection
|
| 93 | *
|
| 94 | * <p><b>Value: List of Strings</b></p>
|
| 95 | */
|
| 96 | children,
|
| 97 |
|
| 98 | /**
|
| 99 | * The maximum number of child nodes that can be associated with a
|
| 100 | * collection
|
| 101 | *
|
| 102 | * <p><b>Value: int</b></p>
|
| 103 | */
|
| 104 | children_max,
|
| 105 |
|
| 106 | /**
|
| 107 | * The maximum number of items to persist
|
| 108 | *
|
| 109 | * <p><b>Value: int</b></p>
|
| 110 | */
|
| 111 | max_items,
|
| 112 |
|
| 113 | /**
|
| 114 | * The maximum payload size in bytes
|
| 115 | *
|
| 116 | * <p><b>Value: int</b></p>
|
| 117 | */
|
| 118 | max_payload_size,
|
| 119 |
|
| 120 | /**
|
| 121 | * Whether the node is a leaf (default) or collection
|
| 122 | *
|
| 123 | * <p><b>Value: {@link NodeType}</b></p>
|
| 124 | */
|
| 125 | node_type,
|
| 126 |
|
| 127 | /**
|
| 128 | * Whether to notify subscribers when the node configuration changes
|
| 129 | *
|
| 130 | * <p><b>Value: boolean</b></p>
|
| 131 | */
|
| 132 | notify_config,
|
| 133 |
|
| 134 | /**
|
| 135 | * Whether to notify subscribers when the node is deleted
|
| 136 | *
|
| 137 | * <p><b>Value: boolean</b></p>
|
| 138 | */
|
| 139 | notify_delete,
|
| 140 |
|
| 141 | /**
|
| 142 | * Whether to notify subscribers when items are removed from the node
|
| 143 | *
|
| 144 | * <p><b>Value: boolean</b></p>
|
| 145 | */
|
| 146 | notify_retract,
|
| 147 |
|
| 148 | /**
|
| 149 | * Whether to persist items to storage. This is required to have multiple
|
| 150 | * items in the node.
|
| 151 | *
|
| 152 | * <p><b>Value: boolean</b></p>
|
| 153 | */
|
| 154 | persist_items,
|
| 155 |
|
| 156 | /**
|
| 157 | * Whether to deliver notifications to available users only
|
| 158 | *
|
| 159 | * <p><b>Value: boolean</b></p>
|
| 160 | */
|
| 161 | presence_based_delivery,
|
| 162 |
|
| 163 | /**
|
| 164 | * Defines who can publish to the node
|
| 165 | *
|
| 166 | * <p><b>Value: {@link PublishModel}</b></p>
|
| 167 | */
|
| 168 | publish_model,
|
| 169 |
|
| 170 | /**
|
| 171 | * The specific multi-user chat rooms to specify for replyroom
|
| 172 | *
|
| 173 | * <p><b>Value: List of JIDs as Strings</b></p>
|
| 174 | */
|
| 175 | replyroom,
|
| 176 |
|
| 177 | /**
|
| 178 | * The specific JID(s) to specify for replyto
|
| 179 | *
|
| 180 | * <p><b>Value: List of JIDs as Strings</b></p>
|
| 181 | */
|
| 182 | replyto,
|
| 183 |
|
| 184 | /**
|
| 185 | * The roster group(s) allowed to subscribe and retrieve items
|
| 186 | *
|
| 187 | * <p><b>Value: List of strings</b></p>
|
| 188 | */
|
| 189 | roster_groups_allowed,
|
| 190 |
|
| 191 | /**
|
| 192 | * Whether to allow subscriptions
|
| 193 | *
|
| 194 | * <p><b>Value: boolean</b></p>
|
| 195 | */
|
| 196 | subscribe,
|
| 197 |
|
| 198 | /**
|
| 199 | * A friendly name for the node
|
| 200 | *
|
| 201 | * <p><b>Value: String</b></p>
|
| 202 | */
|
| 203 | title,
|
| 204 |
|
| 205 | /**
|
| 206 | * The type of node data, ussually specified by the namespace
|
| 207 | * of the payload(if any);MAY be a list-single rather than a
|
| 208 | * text single
|
| 209 | *
|
| 210 | * <p><b>Value: String</b></p>
|
| 211 | */
|
| 212 | type;
|
| 213 |
|
| 214 | public String getFieldName()
|
| 215 | {
|
| 216 | return "pubsub#" + toString();
|
| 217 | }
|
| 218 | }
|