Package de.innovationgate.webgate.api

Examples of de.innovationgate.webgate.api.WGCreationException


                    copy.setExtensionData(cloneExtensionData(original.getExtensionData(), copy));
                }
               
            }
            else {
                throw new WGCreationException("Copying of document type " + WGDocument.doctypeNumberToName(originalCore.getType()) + " is not supported in this database");
            }

            return entityCopy;

        }
        catch (Exception e) {
            throw new WGCreationException("Error creating entity copy", e);
        }
    }
View Full Code Here


   * @see de.innovationgate.webgate.api.WGDatabaseCore#createStructEntry(de.innovationgate.webgate.api.WGDocument, de.innovationgate.webgate.api.WGContentType)
   */
  public WGDocumentCore createStructEntry(Object key, WGDocument reference, WGContentType contentType) throws WGAPIException {
   
    if (reference instanceof WGStructEntry) {
      throw new WGCreationException("Creation of child content not possible in this implementation");
    }
   
    BeanFolder folder = (BeanFolder) reference.getCore();
    return new WrappedKey(this, new BeanKey(folder.getName(), key), null, false);
       
View Full Code Here

        _overlay.closeSession();
        _original.closeSession();
    }

    public WGDocumentCore createDesignDocument(int type, String name, String mediaKey) throws WGAuthorisationException, WGCreationException {
        throw new WGCreationException("This design cannot create design documents");
    }
View Full Code Here

            switch (type) {
               
                case WGDocument.TYPE_TML:{
                    FileObject newTml = getTmlFolder().resolveFile(mediaKey.toLowerCase() + "/" + name.replace(":", "/") + ".tml");
                    if (newTml.exists()) {
                        throw new WGCreationException("Document already exists: " + (new WGDocumentKey(type, name, mediaKey)).toString());
                    }
                    newTml.createFile();
                    break;
                }
                   
                   
                case WGDocument.TYPE_CSSJS: {
                    String suffix = DesignDirectory.getScriptInformation(mediaKey).getSuffix();
                    FileObject newScript = getScriptTypeFolder(mediaKey).resolveFile(mediaKey.toLowerCase() + "/" + name.replace(":", "/") + suffix);
                    if (newScript.exists()) {
                        throw new WGCreationException("Document already exists: " + (new WGDocumentKey(type, name, mediaKey)).toString());
                    }
                    newScript.createFile();
                    break;
                }
                   
                   
                case WGDocument.TYPE_FILECONTAINER: {
                    FileObject newFC = getFilesFolder().resolveFile(name.replace(":", "/"));
                    if (newFC.exists()) {
                        throw new WGCreationException("Document already exists: " + (new WGDocumentKey(type, name, mediaKey)).toString());
                    }
                    newFC.createFolder();
                    break;
                }
               
               
            }
           
            return getDesignObject(type, name, mediaKey);
        }
        catch (Exception e) {
            throw new WGCreationException("Exception creating design document " + (new WGDocumentKey(type, name, mediaKey)).toString(), e);
        }
       
    }
View Full Code Here

    public String getName() {
        return "DB design provider, providing design of database '" + _designDBKey + "'";
    }

    public WGDocumentCore createDesignDocument(int type, String name, String mediaKey) throws WGCreationException {
        throw new WGCreationException("This database uses the design of database '" + _designDBKey + "'");
    }
View Full Code Here

    catch (WGAuthorisationException e) {
      return WGDatabase.ACCESSLEVEL_NOTLOGGEDIN;
    }
   
    catch (IllegalArgumentException e) {
      throw new WGCreationException("Cannot instatiate bean bc. of illegal argument");
    }
    catch (InstantiationException e) {
      throw new WGCreationException("Cannot instatiate bean bc. it is an interface or an abstract class");
    }
    catch (IllegalAccessException e) {
      throw new WGCreationException("Cannot instatiate bean bc. cannot access the constructor");
    }
    catch (InvocationTargetException e) {
      if (e.getTargetException() instanceof WGAuthorisationException) {
        return WGDatabase.ACCESSLEVEL_NOTLOGGEDIN;
      }
      else {
        WGFactory.getLogger().error("Error instantiating bean by bean adapter", e.getTargetException());
        throw new WGCreationException("Cannot instatiate bean bc. of exception in constructor: "+  e.getTargetException().getClass().getName() + " - " + e.getTargetException().getMessage());
      }
    }
   
    return WGDatabase.ACCESSLEVEL_MANAGER;
  }
View Full Code Here

TOP

Related Classes of de.innovationgate.webgate.api.WGCreationException

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.