Package org.eclipse.core.resources

Examples of org.eclipse.core.resources.IFolder


                            resourcesChanged.add(file);
                        } else if (file.getFileExtension().equals("xml") && WGADesignStructureHelper.isMetadataFolder(file.getParent())) {
                            resourcesChanged.addAll(Arrays.asList(file.getParent().getParent().members(IResource.FILE)));
                        }
                    } else if (delta.getResource() instanceof IFolder) {
                        IFolder folder = (IFolder) delta.getResource();
                        if (WGADesignStructureHelper.isMetadataFolder(folder)) {
                            resourcesChanged.addAll(Arrays.asList(folder.getParent().members(IResource.FILE)));
                        }
                    }
                    return true;
                }
            });
View Full Code Here


  }
 
  private void refreshSystemFileContainer(int depth) {
    if (_designContainer != null) {
      WGADesignStructureHelper helper = new WGADesignStructureHelper(_designContainer);
      IFolder systemContainer = helper.getFileContainer("system");
      if (systemContainer != null) {
        try {
          systemContainer.refreshLocal(depth, new NullProgressMonitor());
        } catch (CoreException e) {
        }
      }
    }
  }
View Full Code Here

      // compute design folder name
      String[] pathElements = state.getPath().split("/");
      if (pathElements != null && pathElements.length > 0) {
        String designFolderName = pathElements[0];
        // check if this design is internal or external
        IFolder designFolder = _runtime.getDesignRoot().getFolder(new Path(designFolderName));
        if (WGADesignStructureHelper.isDirlinkFolder(designFolder)) {
          // this is an external design
          IContainer linkTarget = WGADesignStructureHelper.resolveDirLink(designFolder.getFile(WGUtils.DIRLINK_FILE));
          path = linkTarget.getFullPath().append(new Path(state.getPath()).removeFirstSegments(1));
        } else {
          path = _runtime.getDesignRoot().getFullPath().append(new Path(state.getPath()));   
        }
      } else {
View Full Code Here

  public boolean performFinish() {
    WGARuntime runtime = _page.getRuntime();   
    if(runtime != null){
      try {
        IFolder folder = runtime.getDesignRoot().getFolder(new Path(_page.getDesignName()));
        if (!folder.exists()) {
          folder.create(false, true, new NullProgressMonitor());
          DesignTemplate template = _page.getTemplate();
          WGADesignFactory.createDesign(folder, folder.getName(), template);
         
          if (!_page.isCreateContentStore()) {
            _page.getRuntime().register(folder, false, null, null, null, template.getProperties());
          } else {
            _page.getRuntime().register(folder, true, _page.getDatabaseKey(), _page.getDatabaseTitle(), _page.getDomain(), template.getProperties());
View Full Code Here

    _designRoot = FileUtils.createFolder(_project, "designs");
    _developerPluginsRoot = FileUtils.createFolder(_project, "plugins");
    _wgaBase = FileUtils.createFolder(_project, "wga");
    _wgaData = FileUtils.createFolder(_wgaBase, "wgadata");

    IFolder plugins = FileUtils.createFolder(_wgaData, "plugins");
    IFolder pluginDBs = FileUtils.createFolder(plugins, PLUGIN_DBS_FOLDERNAME);
    pluginDBs.setDerived(true);
    IFolder pluginWorkspace = FileUtils.createFolder(plugins, PLUGIN_WORKSPACE_FOLDERNAME);
    pluginWorkspace.setDerived(true);

    _hsqlRoot = _wgaData.getFolder(new Path(DBS_FOLDERNAME));
    IFolder oldHSQLRoot = _wgaData.getFolder(new Path("dbs"));
    if (oldHSQLRoot.exists()) {
      try {
        oldHSQLRoot.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
        oldHSQLRoot.move(new Path(DBS_FOLDERNAME), false, new NullProgressMonitor());
      } catch (CoreException e) {
        WGADesignerPlugin.getDefault().logError("Unable to migrate existing dbs folder.", e);
      }
    }
    if (!_hsqlRoot.exists()) {
      _hsqlRoot.create(false, true, new NullProgressMonitor());
    }
    _hsqlRoot.setDerived(true);

    _luceneRoot = _wgaData.getFolder(new Path(LUCENE_FOLDERNAME));
    IFolder oldLuceneRoot = _wgaData.getFolder(new Path("lucene"));
    if (oldLuceneRoot.exists()) {
      try {
        oldLuceneRoot.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
        oldLuceneRoot.move(new Path(LUCENE_FOLDERNAME), false, new NullProgressMonitor());
      } catch (CoreException e) {
        WGADesignerPlugin.getDefault().logError("Unable to migrate existing lucene folder.", e);
      }
    }
    if (!_luceneRoot.exists()) {
View Full Code Here

                Plugin.getDefault().logError("Unable to create folder : " + _wgaData.toString(), e);
            }
    }
   

    IFolder plugins = _wgaData.getFolder(new Path("plugins"));
    if (plugins.exists()) {
      IFolder pluginDBs = plugins.getFolder(PLUGIN_DBS_FOLDERNAME);
      if (pluginDBs.exists()) {
        try {
          pluginDBs.setDerived(true);
        } catch (CoreException e1) {
          WGADesignerPlugin.getDefault().logError("Unable to set derived flag on folder '" + pluginDBs.getLocation() + "'.", e1);
        }
      }
      IFolder pluginWorkspace = plugins.getFolder(PLUGIN_WORKSPACE_FOLDERNAME);
      if (pluginWorkspace.exists()) {
        try {
          pluginWorkspace.setDerived(true);
        } catch (CoreException e1) {
          WGADesignerPlugin.getDefault().logError("Unable to set derived flag on folder '" + pluginWorkspace.getLocation() + "'.", e1);
        }
      }
    }

    _workflowRoot = _wgaData.getFolder(new Path("workflows"));
    _designRoot = _project.getFolder("designs");

    _hsqlRoot = _wgaData.getFolder(new Path(DBS_FOLDERNAME));
    IFolder oldHSQLRoot = _wgaData.getFolder(new Path("dbs"));
    if (oldHSQLRoot.exists() && !_hsqlRoot.exists()) {
      try {
        oldHSQLRoot.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
        oldHSQLRoot.move(new Path(DBS_FOLDERNAME), false, new NullProgressMonitor());
      } catch (CoreException e) {
        WGADesignerPlugin.getDefault().logError("Unable to migrate existing dbs folder.", e);
      }
    }
    try {
        if(!_hsqlRoot.exists()){
            FileUtils.createFolder(_wgaData, DBS_FOLDERNAME);
        }
      _hsqlRoot.setDerived(true);
    } catch (CoreException e1) {
      WGADesignerPlugin.getDefault().logError("Unable to set derived flag on folder '" + _hsqlRoot.getLocation() + "'.", e1);
    }

    _luceneRoot = _wgaData.getFolder(new Path(LUCENE_FOLDERNAME));
    IFolder oldLuceneRoot = _wgaData.getFolder(new Path("lucene"));
    if (oldLuceneRoot.exists() && !_luceneRoot.exists()) {
      try {
        oldLuceneRoot.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
        oldLuceneRoot.move(new Path(LUCENE_FOLDERNAME), false, new NullProgressMonitor());
      } catch (CoreException e) {
        WGADesignerPlugin.getDefault().logError("Unable to migrate existing lucene folder.", e);
      }
    }
    try {
View Full Code Here

    Iterator<ContentStore> itCS = retrieveWGAConfig(false).getContentStores().iterator();
    while (itCS.hasNext()) {
      ContentStore currentContentStore = itCS.next();
      Design currentDesign = currentContentStore.getDesign();
      if (currentDesign != null && currentDesign.getSource() != null && currentContentStore.isEnabled() && currentDesign.getSource().equals(Constants.DESIGNCOL_FILESYSTEM)) {
        IFolder designFolder = getDesignRoot().getFolder(new Path(currentDesign.getName()));
        if (WGADesignStructureHelper.isDirlinkFolder(designFolder)) {
          contentDesign.put(currentContentStore.getKey(), (WGADesignStructureHelper.dirLinkFolderToContainer(designFolder)));
        } else {
          contentDesign.put(currentContentStore.getKey(), designFolder);
        }
View Full Code Here

    return getDesignsAsFolder(true);
  }

  public IFolder[] getDesignsAsFolder(boolean resolveDirlinks) {
    List<IFolder> folders = new ArrayList<IFolder>();
    IFolder designroot = (IFolder) getDesignRoot();
    try {
      IResource resources[] = designroot.members(IFolder.FOLDER);
      for (int i = 0; i < resources.length; i++) {

        if (resources[i] instanceof IFolder) {
          IFolder current = (IFolder) resources[i];

          if (WGADesignStructureHelper.isDirlinkFolder(current) && resolveDirlinks) {
            current = (IFolder) WGADesignStructureHelper.dirLinkFolderToContainer(current);
          }
          folders.add(current);
View Full Code Here

//    return getDesignsAsFolder(true);
//  }

  public IFolder[] getPluginsAsFolder(boolean resolveDirlinks) {
    List<IFolder> folders = new ArrayList<IFolder>();
    IFolder pluginroot = (IFolder) getPluginRoot();
    try {
      IResource resources[] = pluginroot.members(IFolder.FOLDER);
      for (int i = 0; i < resources.length; i++) {

        if (resources[i] instanceof IFolder) {
          IFolder current = (IFolder) resources[i];

          if (WGADesignStructureHelper.isDirlinkFolder(current) && resolveDirlinks) {
            current = (IFolder) WGADesignStructureHelper.dirLinkFolderToContainer(current);
          }
          folders.add(current);
View Full Code Here

  public boolean hasDesign(String designName) {
    if (designName == null || designName.equals(""))
      return false;

    IFolder folders[] = getDesignsAsFolder();
    for (int i = 0; i < folders.length; i++) {
      String existingDesignName = WGADesignStructureHelper.getDesignNameByFolder(folders[i]);
      if (existingDesignName != null && existingDesignName.equals(designName)) {
        return true;
      }
View Full Code Here

TOP

Related Classes of org.eclipse.core.resources.IFolder

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.