/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ro.nextreports.server.domain; import java.util.ArrayList; import java.util.List; import org.jcrom.JcrFile; import org.jcrom.annotations.JcrFileNode; import org.jcrom.annotations.JcrFileNode.LoadType; /** * @author Decebal Suiu */ public class JasperContent extends EntityFragment { private static final long serialVersionUID = 1L; @JcrFileNode(loadType = LoadType.BYTES) private List<JcrFile> jasperFiles; @JcrFileNode(loadType = LoadType.BYTES) private List<JcrFile> imageFiles; @JcrFileNode(loadType = LoadType.BYTES) private JcrFile parametersFile; public JasperContent() { super(); } public JasperContent(String name, String path) { super(name, path); } public List<JcrFile> getJasperFiles() { return jasperFiles; } public void setJasperFiles(List<JcrFile> jasperFiles) { this.jasperFiles = jasperFiles; } public List<JcrFile> getImageFiles() { return imageFiles; } public void setImageFiles(List<JcrFile> imageFiles) { this.imageFiles = imageFiles; } public JcrFile getParametersFile() { return parametersFile; } public void setParametersFile(JcrFile parametersFile) { this.parametersFile = parametersFile; } public JcrFile getMaster() { if ((jasperFiles == null) || (jasperFiles.size() == 0)) { return null; } return jasperFiles.get(0); } public List<JcrFile> getSubreports() { List<JcrFile> subreports = new ArrayList<JcrFile>(jasperFiles); subreports.remove(0); return subreports; } }