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
026import dk.netarkivet.archive.Constants;
027import dk.netarkivet.archive.arcrepository.bitpreservation.ActiveBitPreservationFactory;
028import dk.netarkivet.common.webinterface.SiteSection;
029
030/**
031 * Site section that creates the menu for bit preservation.
032 */
033public class BitPreservationSiteSection extends SiteSection {
034    /**
035     * The number of pages visible in the menu. The visible pages: filestatus, batchoverview
036     */
037    private static final int PAGES_VISIBLE_IN_MENU = 2;
038
039    /**
040     * Create a new bit preservation SiteSection object.
041     */
042    public BitPreservationSiteSection() {
043        super("mainname;bitpreservation", "Bitpreservation", PAGES_VISIBLE_IN_MENU, new String[][] {
044                {"filestatus", "pagetitle;filestatus"},
045                {"batchoverview", "pagetitle;batchjob.overview"},
046                // Pages below is not visible in the menu
047                {"batchjob", "pagetitle;batchjob"}, {"batchjob-retrieve", "pagetitle;batchjob.retrieve.resultfile"},
048                {"batchjob-execute", "pagetitle;batchjob.execute"},
049                {"filestatus-checksum", "pagetitle;filestatus.checksum.errors"},
050                {"filestatus-missing", "pagetitle;filestatus.files.missing"},
051                {"filestatus-update", "pagetitle;filestatus.update"}}, "BitPreservation", Constants.TRANSLATIONS_BUNDLE);
052    }
053
054    /**
055     * Initialize ActiveBitPreservation singleton. Should speed up the 1st rendering of the JSP pages.
056     */
057    public void initialize() {
058        ActiveBitPreservationFactory.getInstance();
059    }
060
061    /** No cleanup necessary in this site section. */
062    public void close() {
063    }
064}