ConfigureNodeFields.java

  1. /**
  2.  *
  3.  * Copyright the original author or authors
  4.  *
  5.  * Licensed under the Apache License, Version 2.0 (the "License");
  6.  * you may not use this file except in compliance with the License.
  7.  * You may obtain a copy of the License at
  8.  *
  9.  *     http://www.apache.org/licenses/LICENSE-2.0
  10.  *
  11.  * Unless required by applicable law or agreed to in writing, software
  12.  * distributed under the License is distributed on an "AS IS" BASIS,
  13.  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14.  * See the License for the specific language governing permissions and
  15.  * limitations under the License.
  16.  */
  17. package org.jivesoftware.smackx.pubsub;

  18. import java.net.URL;

  19. import org.jivesoftware.smackx.xdata.Form;

  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.      * The URL of an XSL transformation which can be applied to
  37.      * payloads in order to generate an appropriate message
  38.      * body element
  39.      *
  40.      * <p><b>Value: {@link URL}</b></p>
  41.      */
  42.     body_xslt,
  43.    
  44.     /**
  45.      * The collection with which a node is affiliated
  46.      *
  47.      * <p><b>Value: String</b></p>
  48.      */
  49.     collection,

  50.     /**
  51.      * The URL of an XSL transformation which can be applied to
  52.      * payload format in order to generate a valid Data Forms result
  53.      * that the client could display using a generic Data Forms
  54.      * rendering engine body element.
  55.      *
  56.      * <p><b>Value: {@link URL}</b></p>
  57.      */
  58.     dataform_xslt,

  59.     /**
  60.      * Whether to deliver payloads with event notifications
  61.      *
  62.      * <p><b>Value: boolean</b></p>
  63.      */
  64.     deliver_payloads,
  65.    
  66.     /**
  67.      * Whether owners or publisher should receive replies to items
  68.      *
  69.      * <p><b>Value: {@link ItemReply}</b></p>
  70.      */
  71.     itemreply,
  72.    
  73.     /**
  74.      * Who may associate leaf nodes with a collection
  75.      *
  76.      * <p><b>Value: {@link ChildrenAssociationPolicy}</b></p>
  77.      */
  78.     children_association_policy,
  79.    
  80.     /**
  81.      * The list of JIDs that may associate leaf nodes with a
  82.      * collection
  83.      *
  84.      * <p><b>Value: List of JIDs as Strings</b></p>
  85.      */
  86.     children_association_whitelist,
  87.    
  88.     /**
  89.      * The child nodes (leaf or collection) associated with a collection
  90.      *
  91.      * <p><b>Value: List of Strings</b></p>
  92.      */
  93.     children,
  94.    
  95.     /**
  96.      * The maximum number of child nodes that can be associated with a
  97.      * collection
  98.      *
  99.      * <p><b>Value: int</b></p>
  100.      */
  101.     children_max,
  102.    
  103.     /**
  104.      * The maximum number of items to persist
  105.      *
  106.      * <p><b>Value: int</b></p>
  107.      */
  108.     max_items,
  109.    
  110.     /**
  111.      * The maximum payload size in bytes
  112.      *
  113.      * <p><b>Value: int</b></p>
  114.      */
  115.     max_payload_size,
  116.    
  117.     /**
  118.      * Whether the node is a leaf (default) or collection
  119.      *
  120.      * <p><b>Value: {@link NodeType}</b></p>
  121.      */
  122.     node_type,
  123.    
  124.     /**
  125.      * Whether to notify subscribers when the node configuration changes
  126.      *
  127.      * <p><b>Value: boolean</b></p>
  128.      */
  129.     notify_config,
  130.    
  131.     /**
  132.      * Whether to notify subscribers when the node is deleted
  133.      *
  134.      * <p><b>Value: boolean</b></p>
  135.      */
  136.     notify_delete,

  137.     /**
  138.      * Whether to notify subscribers when items are removed from the node
  139.      *
  140.      * <p><b>Value: boolean</b></p>
  141.      */
  142.     notify_retract,
  143.    
  144.     /**
  145.      * Whether to persist items to storage.  This is required to have multiple
  146.      * items in the node.
  147.      *
  148.      * <p><b>Value: boolean</b></p>
  149.      */
  150.     persist_items,
  151.    
  152.     /**
  153.      * Whether to deliver notifications to available users only
  154.      *
  155.      * <p><b>Value: boolean</b></p>
  156.      */
  157.     presence_based_delivery,

  158.     /**
  159.      * Defines who can publish to the node
  160.      *
  161.      * <p><b>Value: {@link PublishModel}</b></p>
  162.      */
  163.     publish_model,
  164.    
  165.     /**
  166.      * The specific multi-user chat rooms to specify for replyroom
  167.      *
  168.      * <p><b>Value: List of JIDs as Strings</b></p>
  169.      */
  170.     replyroom,
  171.    
  172.     /**
  173.      * The specific JID(s) to specify for replyto
  174.      *
  175.      * <p><b>Value: List of JIDs as Strings</b></p>
  176.      */
  177.     replyto,
  178.    
  179.     /**
  180.      * The roster group(s) allowed to subscribe and retrieve items
  181.      *
  182.      * <p><b>Value: List of strings</b></p>
  183.      */
  184.     roster_groups_allowed,
  185.    
  186.     /**
  187.      * Whether to allow subscriptions
  188.      *
  189.      * <p><b>Value: boolean</b></p>
  190.      */
  191.     subscribe,
  192.    
  193.     /**
  194.      * A friendly name for the node
  195.      *
  196.      * <p><b>Value: String</b></p>
  197.      */
  198.     title,
  199.    
  200.     /**
  201.      * The type of node data, ussually specified by the namespace
  202.      * of the payload(if any);MAY be a list-single rather than a
  203.      * text single
  204.      *
  205.      * <p><b>Value: String</b></p>
  206.      */
  207.     type;
  208.    
  209.     public String getFieldName()
  210.     {
  211.         return "pubsub#" + toString();
  212.     }
  213. }