Package de.innovationgate.wgpublisher.design

Examples of de.innovationgate.wgpublisher.design.WGADesignConfigurationException


            _core = core;
            _name = name;
            _locInfo = locInfo;
            String dirPath = determinePath(core, options);
            if (dirPath == null) {
                throw new WGADesignConfigurationException("No option " + DesignSource.OPTION_PATH + " provided");
            }
           
            _dir = VFS.getManager().resolveFile(_core.getConfigFile().getParentFile(), dirPath);
            if (!_dir.exists()) {
                _dir.createFolder();
            }
           
            if (!_dir.getType().equals(FileType.FOLDER)) {
                throw new WGADesignConfigurationException("Design source directory '" + _dir.getURL().toString() + "' does not exist or is no directory");
            }
           
            _additionalDirs = WGUtils.extractMapByPrefix(options, OPTIONPREFIX_ADDITIONALDIR);
           
           
           
           
        }
        catch (FileSystemException e) {
            throw new WGADesignConfigurationException("Exception building file system design source", e);
        }

    }
View Full Code Here


                db.setAllowDesignModification(false);
            }
           
        }
        catch (Exception e) {
            throw new WGADesignConfigurationException("Exception applying design to web application " + db.getDbReference(), e);
        }
       
    }
View Full Code Here

            String location = getDesignLocation(design);
            FileSystemDesignProvider designProvider = new FileSystemDesignProvider(design.createDesignReference(), _core, db, location, options);
            return designProvider;
        }
        catch (Exception e) {
            throw new WGADesignConfigurationException("Exception creating design provider", e);
        }
    }
View Full Code Here

        String location;
        if (design.getName().startsWith(DESIGNNAMEPREFIX_ADDITIONALDIR)) {
            String addName = design.getName().substring(DESIGNNAMEPREFIX_ADDITIONALDIR.length());
            location = _additionalDirs.get(addName);
            if (location == null) {
                throw new WGADesignConfigurationException("Additional directory of name " + addName + " + is not defined");
            }
        } else if (design.getName().startsWith(DESIGNNAMEPREFIX_ARCHIVE)) {           
          FileObject designDir = WGUtils.resolveDirLink(_dir.getChild(design.getName().substring(DESIGNNAMEPREFIX_ARCHIVE.length()) + "." + ARCHIVED_DESIGN_EXTENSION));
            if (designDir == null) {
                throw new WGADesignConfigurationException("Archived design '" + _dir.resolveFile(design.getName()).getURL().toString() + " not found");
            }
            location = "zip:" + designDir.getURL().toString();
        } else {
            FileObject designDir = WGUtils.resolveDirLink(_dir.getChild(design.getName()));
            if (designDir == null) {
                throw new WGADesignConfigurationException("Design directory '" + _dir.resolveFile(design.getName()).getURL().toString() + " not found");
            }               
            location = designDir.getURL().toString();               
        }
        return location;
    }
View Full Code Here

           
            db.setDesignProvider(designProvider);
            db.setAllowDesignModification(false);
        }
        catch (Exception e) {
            throw new WGADesignConfigurationException("Exception applying design to web application " + db.getDbReference(), e);
        }

    }
View Full Code Here

        }
        catch (WGADesignConfigurationException e) {
            throw e;
        }
        catch (Exception e) {
            throw new WGADesignConfigurationException("Exception creating design provider", e);
        }
       
       
    }
View Full Code Here

    }

    private WGAPlugin getPlugin(WGADesign design) throws WGADesignConfigurationException {
        WGAPlugin plugin = _core.getPluginSet().getPluginsByInstallationKey().get(design.getName());
        if (plugin == null) {
            throw new WGADesignConfigurationException("Cannot find plugin with installation key " + design.getName());
        }
        return plugin;
    }
View Full Code Here

            DBDesignProvider designProvider = createDesignProvider(design, db, options);
            db.setDesignProvider(designProvider);
            db.setAllowDesignModification(false);
        }
        catch (Exception e) {
            throw new WGADesignConfigurationException("Exception applying design to web application " + db.getDbReference(), e);
        }
       
       
    }
View Full Code Here

        WGDatabase sourcedb = _core.getContentdbs().get(design.getName());
       
        // Can only validate database if already connected - If null the db may get connected later
        if (sourcedb != null) {
            if (sourcedb.getDesignProvider() != null) {
                throw new WGADesignConfigurationException("Database " + design.getName() + " itself uses a design provider and cannot be used as design source");
            }
            if (!sourcedb.getRoles().contains(WGDatabase.ROLE_DESIGN)) {
                throw new WGADesignConfigurationException("Database " + design.getName() + " contains no design and cannot be used as design source");
            }
        }
       
        _core.getLog().info("Web application " + db.getDbReference() + " uses design of database " + design.getName());
        DBDesignProvider designProvider = new DBDesignProvider(design.createDesignReference(), _core, db, design.getName(), options);
View Full Code Here

TOP

Related Classes of de.innovationgate.wgpublisher.design.WGADesignConfigurationException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.