Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* This library is part of OpenCms -
* the Open Source Content Management System
*
* Copyright (c) Alkacon Software GmbH & Co. KG (http://www.alkacon.com)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* For further information about Alkacon Software, please see the
* company website: http://www.alkacon.com
*
* For further information about OpenCms, please see the
* project website: http://www.opencms.org
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package org.opencms.ade.configuration.formatters;
import org.opencms.ade.configuration.CmsConfigurationReader;
import org.opencms.ade.configuration.I_CmsGlobalConfigurationCache;
import org.opencms.db.CmsPublishedResource;
import org.opencms.file.CmsFile;
import org.opencms.file.CmsObject;
import org.opencms.file.CmsResource;
import org.opencms.file.CmsResourceFilter;
import org.opencms.file.types.CmsResourceTypeFunctionConfig;
import org.opencms.file.types.I_CmsResourceType;
import org.opencms.loader.CmsResourceManager;
import org.opencms.main.CmsException;
import org.opencms.main.CmsLog;
import org.opencms.main.OpenCms;
import org.opencms.util.CmsUUID;
import org.opencms.util.CmsWaitHandle;
import org.opencms.xml.containerpage.I_CmsFormatterBean;
import org.opencms.xml.content.CmsXmlContent;
import org.opencms.xml.content.CmsXmlContentFactory;
import org.opencms.xml.content.CmsXmlContentProperty;
import org.opencms.xml.content.CmsXmlContentRootLocation;
import org.opencms.xml.content.I_CmsXmlContentValueLocation;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.TimeUnit;
import org.apache.commons.logging.Log;
import com.google.common.collect.Maps;
/**
* A cache object which holds a collection of formatter configuration beans read from the VFS.
*
* This class does not immediately update the cached formatter collection when changes in the VFS occur, but instead
* schedules an update action with a slight delay, so that if many formatters are changed in a short time, only one update
* operation is needed.
*
* Two instances of this cache are needed, one for the Online project and one for Offline projects.
**/
public class CmsFormatterConfigurationCache implements I_CmsGlobalConfigurationCache {
/** A UUID which is used to mark the configuration cache for complete reloading. */
public static final CmsUUID RELOAD_MARKER = CmsUUID.getNullUUID();
/** The resource type for macro formatters. */
public static final String TYPE_FLEX_FORMATTER = "flex_formatter";
/** The resource type for formatter configurations. */
public static final String TYPE_FORMATTER_CONFIG = "formatter_config";
/** The resource type for macro formatters. */
public static final String TYPE_MACRO_FORMATTER = "macro_formatter";
/** Type name for setting configurations. */
public static final String TYPE_SETTINGS_CONFIG = "settings_config";
/** The delay to use for updating the formatter cache, in seconds. */
protected static int UPDATE_DELAY_MILLIS = 500;
/** The logger for this class. */
private static final Log LOG = CmsLog.getLog(CmsFormatterConfigurationCache.class);
/** The future for the scheduled task. */
private volatile ScheduledFuture m_taskFuture;
/** The work queue to keep track of what needs to be done during the next cache update. */
private LinkedBlockingQueue