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.api.PictureTilingService; 028import org.nuxeo.ecm.platform.pictures.tiles.service.PictureTilingComponent; 029import org.nuxeo.runtime.api.Framework; 030 031/** 032 * Seam bean for 033 * 034 * @author <a href="mailto:[email protected]">Thomas Roger</a> 035 * @since 5.7 036 */ 037@Scope(ScopeType.CONVERSATION) 038@Name("imagingTilingActions") 039@Install(precedence = Install.FRAMEWORK) 040public class ImagingTilingActions implements Serializable { 041 042 private static final long serialVersionUID = 1L; 043 044 public static final String WIDTH_THRESHOLD_PARAM = "WidthThreshold"; 045 046 public static final String DEFAULT_WIDTH_THRESHOLD = "1200"; 047 048 public static final String HEIGHT_THRESHOLD_PARAM = "HeightThreshold"; 049 050 public static final String DEFAULT_HEIGHT_THRESHOLD = "1200"; 051 052 public int getTilingWidthThreshold() { 053 PictureTilingComponent ptc = (PictureTilingComponent) Framework.getService(PictureTilingService.class); 054 return Integer.valueOf(ptc.getEnvValue(WIDTH_THRESHOLD_PARAM, DEFAULT_WIDTH_THRESHOLD)); 055 } 056 057 public int getTilingHeightThreshold() { 058 PictureTilingComponent ptc = (PictureTilingComponent) Framework.getService(PictureTilingService.class); 059 return Integer.valueOf(ptc.getEnvValue(HEIGHT_THRESHOLD_PARAM, DEFAULT_HEIGHT_THRESHOLD)); 060 } 061 062}