| /* |
| * Copyright 2005 The Apache Software Foundation. |
| * |
| * Licensed under the Apache License, Version 2.0 (the "License"); |
| * you may not use this file except in compliance with the License. |
| * You may obtain a copy of the License at |
| * |
| * http://www.apache.org/licenses/LICENSE-2.0 |
| * |
| * Unless required by applicable law or agreed to in writing, software |
| * distributed under the License is distributed on an "AS IS" BASIS, |
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| * See the License for the specific language governing permissions and |
| * limitations under the License. |
| */ |
| package org.apache.jackrabbit.webdav.version; |
| |
| import org.apache.jackrabbit.webdav.property.DavPropertyName; |
| import org.apache.jackrabbit.webdav.DavConstants; |
| import org.apache.jackrabbit.webdav.xml.Namespace; |
| |
| /** |
| * <code>DeltaVConstants</code> defines the following headers and properties |
| * required for any resource that is complient to |
| * <a href="http://www.ietf.org/rfc/rfc3253.txt">RFC 3253</a>:<br><br> |
| * |
| * Headers: |
| * <pre> |
| * Label |
| * </pre> |
| * |
| * Properties: |
| * <pre> |
| * DAV:comment |
| * DAV:creator-displayname |
| * DAV:supported-method-set |
| * DAV:supported-live-property-set |
| * DAV:supported-report-set |
| * DAV:workspace |
| * </pre> |
| */ |
| public interface DeltaVConstants { |
| |
| /** |
| * The DAV: namespace. |
| */ |
| public static final Namespace NAMESPACE = DavConstants.NAMESPACE; |
| |
| /** |
| * For certain METHODS, if the request-URL identifies a version-controlled |
| * resource, a label can be specified in a LabelInfo request header to cause the |
| * method to be applied to the version selected by that label.<br> |
| * LabelInfo header MUST have no effect on a request whose request-URL does not |
| * identify a version-controlled resource. In particular, it MUST have no |
| * effect on a request whose request-URL identifies a version or a version |
| * history. |
| */ |
| public static final String HEADER_LABEL = "Label"; |
| |
| /** |
| * Location header as defined by |
| * <a href="http://www.ietf.org/rfc/rfc2616.txt">RFC 2616</a>. In the versioning |
| * context it is used to indicate the location of the new version created by a |
| * successful checkin in the response.<br><br> |
| * From RFC 2616:<br> |
| * The Location response-header field is used to redirect the recipient to a |
| * location other than the Request-URI for completion of the request or |
| * identification of a new resource.<br> |
| * For 201 (Created) responses, the Location is that of the new resource |
| * which was created by the request. |
| */ |
| public static final String HEADER_LOCATION = "Location"; |
| |
| /** |
| * The "DAV:comment" property is used to track a brief comment about a resource that is |
| * suitable for presentation to a user. The DAV:comment of a version can be |
| * used to indicate why that version was created. |
| */ |
| public static final DavPropertyName COMMENT = DavPropertyName.create("comment", NAMESPACE); |
| |
| /** |
| * The "DAV:creator-displayname" property contains a description of the creator of |
| * the resource that is suitable for presentation to a user. The |
| * DAV:creator-displayname of a version can be used to indicate who created |
| * that version. |
| */ |
| public static final DavPropertyName CREATOR_DISPLAYNAME = DavPropertyName.create("creator-displayname", NAMESPACE); |
| |
| /** |
| * Required protected live property for any resources being complient with |
| * RFC 3253. Clients should classify a resource by examing the values of the |
| * DAV:supported-method-set and DAV:supported-live-property-set |
| * properties of that resource.<br> |
| * Property structure: |
| * <pre> |
| * <!ELEMENT supported-method-set (supported-method*)> |
| * <!ELEMENT supported-method ANY> |
| * <!ATTLIST supported-method name NMTOKEN #REQUIRED> |
| * name value: a method name |
| * </pre> |
| * |
| * @see #SUPPORTED_LIVE_PROPERTY_SET |
| */ |
| public static final DavPropertyName SUPPORTED_METHOD_SET = DavPropertyName.create("supported-method-set", NAMESPACE); |
| |
| /** |
| * Required protected live property for any resources being complient with |
| * RFC 3253. Clients should classify a resource by examing the values of the |
| * DAV:supported-method-set and DAV:supported-live-property-set |
| * properties of that resource.<br> |
| * Property structure: |
| * <pre> |
| * <!ELEMENT supported-live-property-set (supported-live-property*)> |
| * <!ELEMENT supported-live-property name> |
| * <!ELEMENT prop ANY> |
| * ANY value: a property element type |
| * </pre> |
| * |
| * @see #SUPPORTED_METHOD_SET |
| */ |
| public static final DavPropertyName SUPPORTED_LIVE_PROPERTY_SET = DavPropertyName.create("supported-live-property-set", NAMESPACE); |
| |
| /** |
| * Protected "supported-report-set" property identifies the reports that are |
| * supported by the resource. |
| * |
| * @see #SUPPORTED_REPORT_SET |
| */ |
| public static final DavPropertyName SUPPORTED_REPORT_SET = DavPropertyName.create("supported-report-set", NAMESPACE); |
| |
| /** |
| * Protected "workspace" property indicating the workspace of a resource. |
| * |
| * @see #WORKSPACE |
| */ |
| public static final DavPropertyName WORKSPACE = DavPropertyName.create("workspace", NAMESPACE); |
| |
| |
| //-------------------------------------------------------------------------- |
| /** |
| * Xml elements |
| */ |
| public static final String XML_ACTIVITY = "activity"; |
| public static final String XML_BASELINE = "baseline"; |
| |
| public static final String XML_SUPPORTED_METHOD = "supported-method"; |
| public static final String XML_VERSION_HISTORY = "version-history"; |
| public static final String XML_VERSION = "version"; |
| public static final String XML_WORKSPACE = "workspace"; |
| |
| // options |
| /** |
| * If the OPTIONS request contains a body, i must start with an DAV:options |
| * element. |
| * |
| * @see OptionsInfo |
| * @see #XML_VH_COLLECTION_SET |
| * @see #XML_WSP_COLLECTION_SET |
| * @see #XML_ACTIVITY_COLLECTION_SET |
| */ |
| public static final String XML_OPTIONS = "options"; |
| |
| /** |
| * If an XML response body for a successful request is included, it must be |
| * a DAV:options-response XML element. |
| * |
| * @see OptionsResponse |
| */ |
| public static final String XML_OPTIONS_RESPONSE = "options-response"; |
| |
| /** |
| * A DAV:version-history-collection-set element may be included in the OPTIONS |
| * request body to identify collections that may contain version history |
| * resources.<br> |
| * The response body for a successful request must in consequence contain a |
| * DAV:version-history-collection-set element identifying collections that |
| * may contain version histories. An identified collection may be the root |
| * collection of a tree of collections, all of which may contain version |
| * histories. |
| * |
| * <pre> |
| * <!ELEMENT version-history-collection-set (href*)> |
| * </pre> |
| */ |
| public static final String XML_VH_COLLECTION_SET = "version-history-collection-set"; |
| |
| /** |
| * A DAV:workspace-collection-set element may be included in the OPTIONS request |
| * body to identify collections that may contain workspace resources.<br> |
| * The response body for a successful request must contain a |
| * DAV:workspace-collection-set element identifying collections that may |
| * contain workspaces. An identified collection may be the root collection |
| * of a tree of collections, all of which may contain workspaces. |
| * |
| * <pre> |
| * <!ELEMENT workspace-collection-set (href*)> |
| * </pre> |
| */ |
| public static final String XML_WSP_COLLECTION_SET = "workspace-collection-set"; |
| |
| /** |
| * A DAV:workspace-collection-set element may be included in the OPTIONS request |
| * body to identify collections that may contain activity resources.<br> |
| * The response body for a successful request must contain a |
| * DAV:workspace-collection-set element identifying collections that may |
| * contain activity resources. An identified collection may be the root collection |
| * of a tree of collections, all of which may contain activity resources. |
| * |
| * <pre> |
| * <!ELEMENT activity-collection-set (href*)> |
| * </pre> |
| */ |
| public static final String XML_ACTIVITY_COLLECTION_SET = "activity-collection-set"; |
| |
| /** |
| * Name of Xml element contained in the {@link #SUPPORTED_REPORT_SET} property. |
| * |
| * @see #SUPPORTED_REPORT_SET |
| * @see org.apache.jackrabbit.webdav.version.report.SupportedReportSetProperty |
| */ |
| public static final String XML_SUPPORTED_REPORT = "supported-report"; |
| |
| /** |
| * Name of Xml child elements of {@link #XML_SUPPORTED_REPORT}. |
| * |
| * @see org.apache.jackrabbit.webdav.version.report.SupportedReportSetProperty |
| */ |
| public static final String XML_REPORT = "report"; |
| |
| /** |
| * Top element for the 'DAV:version-tree' report |
| */ |
| public static final String XML_VERSION_TREE = "version-tree"; |
| |
| /** |
| * Top element for the 'DAV:expand-property' report |
| */ |
| public static final String XML_EXPAND_PROPERTY = "expand-property"; |
| |
| /** |
| * 'DAV:property' element to be used inside the 'DAV:expand-property' element. |
| * |
| * @see #XML_EXPAND_PROPERTY |
| */ |
| public static final String XML_PROPERTY = "property"; |
| |
| /** |
| * 'DAV:name' attribute for the property element |
| * |
| * @see #XML_PROPERTY |
| */ |
| public static final String ATTR_NAME = "name"; |
| |
| /** |
| * 'DAV:namespace' attribute for the property element |
| * |
| * @see #XML_PROPERTY |
| */ |
| public static final String ATTR_NAMESPACE = "namespace"; |
| |
| /** |
| * Top element for the 'DAV:locate-by-history' report |
| */ |
| public static final String XML_LOCATE_BY_HISTORY = "locate-by-history"; |
| |
| /** |
| * 'DAV:version-history-set' to be used inside the 'DAV:locate-by-history' |
| * element |
| * |
| * @see #XML_LOCATE_BY_HISTORY |
| */ |
| public static final String XML_VERSION_HISTORY_SET = "version-history-set"; |
| |
| |
| /** |
| * Xml element representing the mandatory root element of a LABEL request |
| * body. |
| * |
| * @see #XML_LABEL_NAME |
| * @see #XML_LABEL_ADD |
| * @see #XML_LABEL_REMOVE |
| * @see #XML_LABEL_SET |
| * @see LabelInfo |
| */ |
| public static final String XML_LABEL = "label"; |
| public static final String XML_LABEL_NAME = "label-name"; |
| public static final String XML_LABEL_ADD = "add"; |
| public static final String XML_LABEL_REMOVE = "remove"; |
| public static final String XML_LABEL_SET = "set"; |
| |
| /** |
| * Xml element defining the top element in the UPDATE request body. RFC 3253 |
| * defines the following structure for the 'update' element. |
| * <pre> |
| * <!ELEMENT update ANY> |
| * ANY value: A sequence of elements with at most one DAV:version element |
| * and at most one DAV:prop element. |
| * <!ELEMENT version (href)> |
| * prop: see RFC 2518, Section 12.11 |
| * </pre> |
| */ |
| public static final String XML_UPDATE = "update"; |
| |
| // auto-version |
| public static final String XML_CHECKOUT_CHECKIN = "checkin-checkout"; |
| public static final String XML_CHECKOUT_UNLOCK_CHECKIN = "checkout-unlocked-checkin"; |
| public static final String XML_CHECKOUT = "checkout"; |
| public static final String XML_LOCKED_CHECKIN = "locked-checkout"; |
| |
| // merge |
| public static final String XML_MERGE = "merge"; |
| public static final String XML_N0_AUTO_MERGE = "no-auto-merge"; |
| public static final String XML_N0_CHECKOUT = "no-checkout"; |
| } |