Package de.innovationgate.webgate.api

Examples of de.innovationgate.webgate.api.WGIllegalStateException


     */
    public boolean attachFile(File file) throws WGAPIException {

        if ((_entity instanceof Content || _entity instanceof FileContainer) == false) {
          // B0000471E
          throw new WGIllegalStateException("Method attachFile() is not supported on '" + _entity.getClass().getName() + "'.");
        }
       
        if (_parent.useOptimizedFileHandling()) {
          attachFileOptimizedImpl(file);
        } else {         
View Full Code Here


  }

  public void renameFile(String oldFileName, String newFileName) throws WGAPIException {
   
        if ((_entity instanceof Content || _entity instanceof FileContainer) == false) {
          throw new WGIllegalStateException("Method renameFile() is not supported on '" + _entity.getClass().getName() + "'.");
        }
   
    if (!_parent.useOptimizedFileHandling()) {
      throw new WGNotSupportedException("renameFile() is not supported on this document implementation.");
    } else {
View Full Code Here

    }
  }

  public WGFileMetaData getFileMetaData(String filename) throws WGAPIException {
    if ((_entity instanceof Content || _entity instanceof FileContainer) == false) {
      throw new WGIllegalStateException("Method getFileMetaData() is not supported on '" + _entity.getClass().getName() + "'.");
        }
    if (_parent.useOptimizedFileHandling()) {
      Entity metaEntity = retrieveFileMetaEntity(filename);
      if (metaEntity != null) {
         
          WGFileMetaData metaData = null;
        if (metaEntity instanceof ContentFileMeta) {
          ContentFileMeta meta = (ContentFileMeta) metaEntity;
          metaData = new WGFileMetaData();
          meta.fill(metaData);         
        }
       
        else if (metaEntity instanceof ContainerFileMeta) {
          ContainerFileMeta meta = (ContainerFileMeta) metaEntity;
          metaData = new WGFileMetaData();
          meta.fill(metaData);
        }
       
        if (metaData != null) {
            if (_parent._ddlVersion >= WGDatabase.CSVERSION_WGA5) {
                metaData.setExtensionDataHandler(new FileExtDataHandler(_parent, metaEntity));
            }
            return metaData;
        }
        else {
          throw new WGIllegalArgumentException("Unsupported entity type '" + metaEntity.getClass().getName() + "'.");
        }
      }
     
      else {
        // file not found
        return null;
      }
    } else {
      throw new WGIllegalStateException("Method getFileMetaData() is not supported in the default file handling mode. You have to enable 'optimizedFileHandling'");
    }
  }
View Full Code Here

    }
   
    public void save(File file) throws IOException, WGIllegalStateException, NoSuchAlgorithmException {
       
        if (_workspaceSet) {
            throw new WGIllegalStateException("You cannot save a workspace plugin set");
        }
       
        // Write first to ByteArrayOutputStream and create hash to see if it changed
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        MD5HashingOutputStream hashOut = new MD5HashingOutputStream(out);
View Full Code Here

  public void seturlparameterifempty(String name, String value) throws WGIllegalStateException {
    if (getrequest() instanceof WGAFilter.GETRequestWrapper) {
      GETRequestWrapper wrapper = (WGAFilter.GETRequestWrapper) getrequest();             
      wrapper.setParameterIfEmpty(name, value);                   
    } else {
      throw new WGIllegalStateException("method setUrlParameterIfEmtpy() is only supported on GET requests.");
    }
  }
View Full Code Here

  public void seturlparameterifempty(String name, List values) throws WGIllegalStateException {
    if (getrequest() instanceof WGAFilter.GETRequestWrapper) {
      GETRequestWrapper wrapper = (WGAFilter.GETRequestWrapper) getrequest();
      wrapper.setParameterIfEmpty(name, (String[]) values.toArray(new String[values.size()]))
    } else {
      throw new WGIllegalStateException("method setUrlParameterIfEmtpy() is only supported on GET requests.");
    }
  }
View Full Code Here

    public void setvar(String name, Object value) throws WGAPIException {
        if (!isroot()) {
            tag.tmlContext.setvar(getVarPrefix() + name, value);
        }
        else {
            throw new WGIllegalStateException("Portlet var not allowed on root scope");
        }   
    }
View Full Code Here

    public void setsessionvar(String name, Object value, boolean allowSerialization) throws WGAPIException {
        if (!isroot()) {
            tag.tmlContext.setSessionVar(getVarPrefix() + name, value, allowSerialization, true);
        }
        else {
            throw new WGIllegalStateException("Portlet session vars not allowed on root portlet");
        }
    }
View Full Code Here

     * @param context
     * @throws WGAPIException
     */
    public void setcontext(TMLContext context) throws WGAPIException {
      if (tag == null) {
        throw new WGIllegalStateException("Portlet context is not supported on none webtml environments.");
      } else if (! (tag instanceof Root.Status)) {
        throw new WGIllegalStateException("Portlet context cannot be set outside actions.");
      }
      if (context != null) {
        getSessionContext().setContextPath(context.getpath());
      } else {
        getSessionContext().setContextPath(null);
View Full Code Here

               
    if (targetContext != null) {
      return storeincontent(targetContext.content());
    }
    else {
      throw new WGIllegalStateException("Unable to store form, because it's target content could not be retrieved: " + documentPath);
    }
  }
View Full Code Here

TOP

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

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.