001: /*
002: * Copyright 2007 Hippo.
003: *
004: * Licensed under the Apache License, Version 2.0 (the "License");
005: * you may not use this file except in compliance with the License.
006: * You may obtain a copy of the License at
007: *
008: * http://www.apache.org/licenses/LICENSE-2.0
009: *
010: * Unless required by applicable law or agreed to in writing, software
011: * distributed under the License is distributed on an "AS IS" BASIS,
012: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013: * See the License for the specific language governing permissions and
014: * limitations under the License.
015: */
016: package nl.hippo.cms.searchandreplace;
017:
018: /**
019: * <p>
020: * This class defines the codes of the errors that can occur during the
021: * replacement of text in a document.
022: * </p>
023: */
024: public class SearchAndReplaceErrorCodes {
025: /**
026: * <p>
027: * To determine if the document is writable the privileges of the user
028: * must be known. This code indicates these privileges could not be
029: * retrieved.
030: * </p>
031: */
032: public static final int MISSING_CURRENT_USER_PRIVILEGE_SET_CODE = 1;
033:
034: /**
035: * <p>
036: * The code used to indicate the user does not have sufficient
037: * privileges to write the document (i.e. the user does not have
038: * <code>DAV:write</code>).
039: * </p>
040: */
041: public static final int UNAUTHORIZED_CODE = 2;
042:
043: /**
044: * <p>
045: * To determine if the document is unlocked the lock information must be
046: * known. This code indicates this information could not be retrieved.
047: * </p>
048: */
049: public static final int MISSING_LOCK_DISCOVERY_CODE = 3;
050:
051: /**
052: * <p>
053: * This code is used to indicate that the document is currently locked
054: * so cannot be written to.
055: * </p>
056: */
057: public static final int LOCKED_CODE = 4;
058:
059: /**
060: * <p>
061: * This code indicates that the document does not exist (anymore).
062: * </p>
063: */
064: public static final int DOCUMENT_NOT_FOUND_CODE = 5;
065:
066: /**
067: * <p>
068: * To be able to determine if a document can be processed, some
069: * information about the document must be retrieved. This code indicates
070: * that the user is not allowed to retrieve this information.
071: * </p>
072: */
073: public static final int FORBIDDEN_CODE = 6;
074:
075: /**
076: * <p>
077: * To be able to determine if a document can be processed, some
078: * information about the document must be retrieved. This code is used
079: * if an unexpected HTTP status code was returned by the server while
080: * retrieving this information.
081: * </p>
082: */
083: public static final int UNEXPECTED_HTTP_STATUS_CODE = 7;
084:
085: /**
086: * <p>
087: * This code is used if an error occurs while reading the document.
088: * </p>
089: */
090: public static final int UNABLE_TO_READ_CODE = 8;
091:
092: /**
093: * <p>
094: * This code indicates the result of the replacement could not be
095: * written back to the document, even though the document was writable
096: * and unlocked before the replacement started.
097: * </p>
098: */
099: public static final int UNABLE_TO_WRITE_CODE = 9;
100:
101: /**
102: * <p>
103: * This code is used if an I/O error occurs while communicating with the
104: * WebDAV repository.
105: * </p>
106: */
107: public static final int IO_EXCEPTION_CODE = 10;
108:
109: /**
110: * <p>
111: * If a problem occurs while parsing or processing XML of the document,
112: * this error code is used.
113: * </p>
114: */
115: public static final int JDOM_EXCEPTION_CODE = 11;
116:
117: /**
118: * <p>
119: * If the document cannot be processed but it is unclear why not, this
120: * error code is used.
121: * </p>
122: */
123: public static final int UNKNOWN_ERROR_CODE = -1;
124:
125: /**
126: * <p>
127: * The only and inaccessible constructor to prevent instantiation.
128: * </p>
129: */
130: private SearchAndReplaceErrorCodes() {
131: super();
132: }
133: }
|