001/* 002 * #%L 003 * Netarchivesuite - archive 004 * %% 005 * Copyright (C) 2005 - 2014 The Royal Danish Library, the Danish State and University Library, 006 * the National Library of France and the Austrian National Library. 007 * %% 008 * This program is free software: you can redistribute it and/or modify 009 * it under the terms of the GNU Lesser General Public License as 010 * published by the Free Software Foundation, either version 2.1 of the 011 * License, or (at your option) any later version. 012 * 013 * This program is distributed in the hope that it will be useful, 014 * but WITHOUT ANY WARRANTY; without even the implied warranty of 015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 016 * GNU General Lesser Public License for more details. 017 * 018 * You should have received a copy of the GNU General Lesser Public 019 * License along with this program. If not, see 020 * <http://www.gnu.org/licenses/lgpl-2.1.html>. 021 * #L% 022 */ 023 024package dk.netarkivet.archive.webinterface; 025 026/** 027 * Constants for the bitarchive webinterface. 028 */ 029public class Constants { 030 /** Parameter name for the bitarchive to perform operation on. */ 031 public static final String BITARCHIVE_NAME_PARAM = "bitarchive"; 032 /** 033 * Option for the UPDATE_TYPE_PARAM parameter for the action of running a batch job for missing files. 034 */ 035 public static final String FIND_MISSING_FILES_OPTION = "findmissingfiles"; 036 /** 037 * Option for the UPDATE_TYPE_PARAM parameter for the action of running a checksum batch job. 038 */ 039 public static final String CHECKSUM_OPTION = "checksum"; 040 /** 041 * Parameter used by the BitpreserveFileState.processChecksumRequest called from 042 * Bitpreservation-filestatus-checksum.jsp. 043 */ 044 public static final String CHECKSUM_PARAM = "checksum"; 045 046 /** Parameter name for the file to perform checksum operations on. */ 047 public static final String FILENAME_PARAM = "file"; 048 /** Parameter name for request to fix checksum in admin data. */ 049 public static final String FIX_ADMIN_CHECKSUM_PARAM = "fixadminchecksum"; 050 /** 051 * Parameter name for credentials for removing a file with wrong checksum. 052 */ 053 public static final String CREDENTIALS_PARAM = "credentials"; 054 /** Parameter name to select the type of update required. */ 055 public static final String UPDATE_TYPE_PARAM = "type"; 056 /** 057 * BitPreservation main Java server page that contains status information about the bitarchives. 058 */ 059 public static final String FILESTATUS_PAGE = "Bitpreservation-filestatus.jsp"; 060 /** 061 * BitPreservation page that checks if any files are missing in one of the bitarchives. 062 */ 063 public static final String FILESTATUS_MISSING_PAGE = "Bitpreservation-filestatus-missing.jsp"; 064 /** BitPreservation page that checks files in archive for wrong checksum. */ 065 public static final String FILESTATUS_CHECKSUM_PAGE = "Bitpreservation-filestatus-checksum.jsp"; 066 /** 067 * BitPreservation page that initiates update of the filestatus information. 068 */ 069 public static final String FILESTATUS_UPDATE_PAGE = "Bitpreservation-filestatus-update.jsp"; 070 071 /** Maximum number of files to toggle on one go. */ 072 public static final int MAX_TOGGLE_AMOUNT = 100; 073 074 /** Parameter for adding missing files. */ 075 public static final String ADD_COMMAND = "add"; 076 /** Parameter for getting info for missing files. */ 077 public static final String GET_INFO_COMMAND = "getInfo"; 078 /** String to separate filename from checksum. */ 079 public static final String STRING_FILENAME_SEPARATOR = "##"; 080 081 /** The extension for the output files. */ 082 public static final String OUTPUT_FILE_EXTENSION = ".out"; 083 /** The extension for the error files. */ 084 public static final String ERROR_FILE_EXTENSION = ".err"; 085 /** 086 * The separator between the name and the timestamp for result files of batchjobs. 087 */ 088 public static final String NAME_TIMSTAMP_SEPARATOR = "-"; 089 090 /** The url for the batchjob page. */ 091 public static final String URL_BATCHJOB = "/BitPreservation/Bitpreservation-batchjob.jsp"; 092 /** The url for retrieval of batchjob result files. */ 093 public static final String URL_RETRIEVE_RESULT_FILES = "/BitPreservation/Bitpreservation-batchjob-retrieve-resultfile.jsp"; 094 /** The url for the execution of the batchjobs. */ 095 public static final String URL_BATCHJOB_EXECUTE = "/BitPreservation/Bitpreservation-batchjob-execute.jsp"; 096 097 /** The context parameter 'filetype'. */ 098 public static final String FILETYPE_PARAMETER = "filetype"; 099 /** The context parameter 'jobId'. */ 100 public static final String JOB_ID_PARAMETER = "jobId"; 101 /** The context parameter 'batchjob'. */ 102 public static final String BATCHJOB_PARAMETER = "batchjob"; 103 /** The context parameter 'replica'. */ 104 public static final String REPLICA_PARAMETER = "replica"; 105 106 /** The regular expression for all files. */ 107 public static final String REGEX_ALL = ".*"; 108 /** The regular expression for metadata files. */ 109 public static final String REGEX_METADATA = "metadata.*"; 110 /** 111 * The regular expression for content files. This ensures that there is 2 dots in the filename, which is only the 112 * case for the content-files (due to the harvester machine name). Alternatively the following has been suggested: 113 * .*(?<!metadata-[0-9]+).arc 114 */ 115 public static final String REGEX_CONTENT = "(.*[.]){2}.*"; 116 /** The size of the <input> HTML code. */ 117 public static final int HTML_INPUT_SIZE = 50; 118 119}