001/*
002 * (C) Copyright 2012 Nuxeo SA (http://nuxeo.com/) and others.
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 * Contributors:
017 *     Thomas Roger
018 */
019package org.nuxeo.ecm.platform.pictures.tiles;
020
021import java.io.Serializable;
022
023import org.jboss.seam.ScopeType;
024import org.jboss.seam.annotations.Install;
025import org.jboss.seam.annotations.Name;
026import org.jboss.seam.annotations.Scope;
027import org.nuxeo.ecm.platform.pictures.tiles.service.PictureTilingComponent;
028
029/**
030 * Seam bean for
031 *
032 * @author <a href="mailto:troger@nuxeo.com">Thomas Roger</a>
033 * @since 5.7
034 */
035@Scope(ScopeType.CONVERSATION)
036@Name("imagingTilingActions")
037@Install(precedence = Install.FRAMEWORK)
038public class ImagingTilingActions implements Serializable {
039
040    private static final long serialVersionUID = 1L;
041
042    public static final String WIDTH_THRESHOLD_PARAM = "WidthThreshold";
043
044    public static final String DEFAULT_WIDTH_THRESHOLD = "1200";
045
046    public static final String HEIGHT_THRESHOLD_PARAM = "HeightThreshold";
047
048    public static final String DEFAULT_HEIGHT_THRESHOLD = "1200";
049
050    public int getTilingWidthThreshold() {
051        return Integer.valueOf(PictureTilingComponent.getEnvValue(WIDTH_THRESHOLD_PARAM, DEFAULT_WIDTH_THRESHOLD));
052    }
053
054    public int getTilingHeightThreshold() {
055        return Integer.valueOf(PictureTilingComponent.getEnvValue(HEIGHT_THRESHOLD_PARAM, DEFAULT_HEIGHT_THRESHOLD));
056    }
057
058}