001: /*
002: * This file is part of PFIXCORE.
003: *
004: * PFIXCORE is free software; you can redistribute it and/or modify
005: * it under the terms of the GNU Lesser General Public License as published by
006: * the Free Software Foundation; either version 2 of the License, or
007: * (at your option) any later version.
008: *
009: * PFIXCORE is distributed in the hope that it will be useful,
010: * but WITHOUT ANY WARRANTY; without even the implied warranty of
011: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
012: * GNU Lesser General Public License for more details.
013: *
014: * You should have received a copy of the GNU Lesser General Public License
015: * along with PFIXCORE; if not, write to the Free Software
016: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
017: */
018:
019: package de.schlund.pfixcore.editor2.core.spring.internal;
020:
021: import java.util.ArrayList;
022: import java.util.Collection;
023:
024: import org.apache.log4j.Logger;
025:
026: import de.schlund.pfixcore.editor2.core.dom.Image;
027: import de.schlund.pfixcore.editor2.core.dom.IncludePart;
028: import de.schlund.pfixcore.editor2.core.dom.IncludePartThemeVariant;
029: import de.schlund.pfixcore.editor2.core.dom.Page;
030: import de.schlund.pfixcore.editor2.core.dom.Project;
031: import de.schlund.pfixcore.editor2.core.dom.Target;
032: import de.schlund.pfixcore.editor2.core.dom.Theme;
033: import de.schlund.pfixcore.editor2.core.exception.EditorParsingException;
034: import de.schlund.pfixcore.editor2.core.exception.EditorSecurityException;
035: import de.schlund.pfixcore.editor2.core.spring.BackupService;
036: import de.schlund.pfixcore.editor2.core.spring.ConfigurationService;
037: import de.schlund.pfixcore.editor2.core.spring.FileSystemService;
038: import de.schlund.pfixcore.editor2.core.spring.PathResolverService;
039: import de.schlund.pfixcore.editor2.core.spring.SecurityManagerService;
040:
041: /**
042: * Implementation of IncludePartThemeVariant for DynIncludes
043: *
044: * @author Sebastian Marsching <sebastian.marsching@1und1.de>
045: */
046: public class DynIncludePartThemeVariantImpl extends
047: CommonIncludePartThemeVariantImpl {
048:
049: private SecurityManagerService securitymanager;
050:
051: public DynIncludePartThemeVariantImpl(
052: ConfigurationService configuration, BackupService backup,
053: FileSystemService filesystem,
054: PathResolverService pathresolver,
055: SecurityManagerService securitymanager, Theme theme,
056: IncludePart part) {
057: super (filesystem, pathresolver, configuration, backup, theme,
058: part);
059: this .securitymanager = securitymanager;
060: }
061:
062: protected void securityCheckCreateIncludePartThemeVariant()
063: throws EditorSecurityException {
064: this .securitymanager.checkEditDynInclude();
065: }
066:
067: protected void securityCheckEditIncludePartThemeVariant()
068: throws EditorSecurityException {
069: this .securitymanager.checkEditDynInclude();
070: }
071:
072: public Collection<IncludePartThemeVariant> getIncludeDependencies(
073: boolean recursive) throws EditorParsingException {
074: return new ArrayList<IncludePartThemeVariant>();
075: }
076:
077: public Collection<Image> getImageDependencies(boolean recursive)
078: throws EditorParsingException {
079: return new ArrayList<Image>();
080: }
081:
082: public Collection<IncludePartThemeVariant> getIncludeDependencies(
083: Target target, boolean recursive)
084: throws EditorParsingException {
085: return new ArrayList<IncludePartThemeVariant>();
086: }
087:
088: public Collection<Image> getImageDependencies(Target target,
089: boolean recursive) throws EditorParsingException {
090: return new ArrayList<Image>();
091: }
092:
093: public Collection<Page> getAffectedPages() {
094: return new ArrayList<Page>();
095: }
096:
097: public Collection<Project> getAffectedProjects() {
098: return new ArrayList<Project>();
099: }
100:
101: protected void writeChangeLog() {
102: Logger.getLogger("LOGGER_EDITOR").warn(
103: "DYNTXT: "
104: + this .securitymanager.getPrincipal().getName()
105: + ": " + this.toString());
106: }
107:
108: }
|