Package com.salesforce.ide.core.remote.metadata

Examples of com.salesforce.ide.core.remote.metadata.RetrieveResultExt


        components.add(defaultLayout);
        ProjectPackageList projectPackageList = ContainerDelegate.getInstance().getServiceLocator().getProjectService().getProjectPackageListInstance();
        projectPackageList.setProject(layoutWizardModel.getProject());
        projectPackageList.addComponents(components, false);

        RetrieveResultExt retrieveResultHandler;
        try {
            monitorWorkCheck(monitor, "Retrieving default layout '" + defaultLayout.getName()
                    + "' to project as template...");
            retrieveResultHandler = ContainerDelegate.getInstance().getServiceLocator().getPackageRetrieveService().retrieveSelective(projectPackageList, monitor);
        } catch (Exception e) {
            logger.error("Exception happened when trying to retrieve default layout component", e);
            throw new InvocationTargetException(e);
        }

        monitor.worked(1);

        projectPackageList.generateComponents(retrieveResultHandler.getZipFile(), retrieveResultHandler
                .getFileMetadataHandler(), monitor);

        String body = projectPackageList.getComponentByFilePath(defaultLayout.getMetadataFilePath()).getBody();
        if (body != null) {
            // TODO: add notification window: The template from default layout is not found, apply blank template to +
View Full Code Here


        projectPackageList.saveResources(new String[] { getComponentWizardModel().getComponent().getComponentType() },
            monitor);
        monitorWorkCheck(monitor);

        // retrieve from server
        RetrieveResultExt retrieveResultExt = null;
        try {
            retrieveResultExt =
                    ContainerDelegate.getInstance().getServiceLocator().getPackageRetrieveService().retrieveSelective(projectPackageList, true, monitor);
        } catch (Exception e) {
            logger.error("Unable to retrieve " + getComponentWizardModel().getDisplayName(), e);
            throw new InvocationTargetException(e);
        } finally {
            monitorWorkCheck(monitor);
        }

        // save to project
        monitorSubTask(monitor, "Saving " + getComponentWizardModel().getDisplayName() + " container to project...");
        try {
            ContainerDelegate.getInstance().getServiceLocator().getProjectService().handleRetrieveResult(retrieveResultExt, true, monitor);
            monitorWorkCheck(monitor, "Saving " + getComponentWizardModel().getDisplayName()
                    + " container to project...");
        } catch (Exception e) {
            logger.error("Unable to save " + getComponentWizardModel().getDisplayName(), e);
            throw new InvocationTargetException(e);
        } finally {
            monitorWork(monitor);
        }

        List<IResource> resources = retrieveResultExt.getProjectPackageList().getAllComponentResources(false);
        if (Utils.isNotEmpty(resources)) {
            getComponent().setFileResource((IFile) resources.get(0));
        }
    }
View Full Code Here

        ContainerDelegate.getInstance().getFactoryLocator().getToolingFactory().removeToolingStubExt(forceProject);
        forceProject.setEndpointApiVersion(installedIdeVersion);
        Connection connection = ContainerDelegate.getInstance().getFactoryLocator().getConnectionFactory().getConnection(forceProject);

        // perform retrieve
        RetrieveResultExt retrieveResultHandler = null;
        try {
            retrieveResultHandler = ContainerDelegate.getInstance().getServiceLocator().getPackageRetrieveService().retrieveSelective(connection,
                    localProjectPackageList, true, packageManifest, monitor);
        } catch (ServiceTimeoutException ex) {
            //FIXME: Best way to handle?
        }

        if (retrieveResultHandler == null) {
            logger.warn("Unable to get remote content - retrieve result is null");
            return remoteProjectPackageList;
        }

        monitorWork(monitor);

        remoteProjectPackageList = ContainerDelegate.getInstance().getServiceLocator().getProjectService().getProjectPackageFactory().getProjectPackageListInstance();
        remoteProjectPackageList.setProject(model.getProject());
        remoteProjectPackageList.generateComponents(retrieveResultHandler.getZipFile(), retrieveResultHandler
                .getFileMetadataHandler(), monitor);

        return remoteProjectPackageList;
    }
View Full Code Here

        // doesn't prompt with 'unable to write'
        IFolder referencePkgFolder = ContainerDelegate.getInstance().getServiceLocator().getProjectService().getReferencedPackagesFolder(project);
        Utils.adjustResourceReadOnly(referencePkgFolder, false, true);

        monitorCheck(monitor);
        RetrieveResultExt retrieveResultHandler = null;
        try {
            retrieveResultHandler = ContainerDelegate.getInstance().getServiceLocator().getPackageRetrieveService().retrieveManagedInstalledPackages(
                    project, monitor);
        } catch (ServiceTimeoutException ex) {
            retrieveResultHandler = ContainerDelegate.getInstance().getServiceLocator().getPackageRetrieveService().handleRetrieveServiceTimeoutException(
                    ex, "upgrade resource(s)", monitor);
            if (retrieveResultHandler != null) {
                Connection connection = ContainerDelegate.getInstance().getFactoryLocator().getConnectionFactory().getConnection(project);
                ProjectPackageList projectPackageList = ContainerDelegate.getInstance().getServiceLocator().getProjectService().getProjectPackageFactory().getManagedInstalledProjectPackages(
                        connection);
                if (projectPackageList != null) {
                    projectPackageList.setProject(project);
                }
                retrieveResultHandler.setProjectPackageList(projectPackageList);
            }
        }

        if (retrieveResultHandler == null) {
            logger.warn("Unable to refresh installed packages - retrieve result is null");
            return false;
        }

        if (retrieveResultHandler.getZipFileCount() == 0) { return true; }

        if (Utils.isNotEmpty(retrieveResultHandler.getProjectPackageList())) {
            retrieveResultHandler.getProjectPackageList().setProject(project);
        }

        monitorCheck(monitor);
        return ContainerDelegate.getInstance().getServiceLocator().getProjectService().handleRetrieveResult(retrieveResultHandler.getProjectPackageList(),
                retrieveResultHandler, true, null, monitor);
    }
View Full Code Here

            return true;
        }

        monitorCheck(monitor);
        monitor.subTask("Retrieving remote compontents...");
        RetrieveResultExt retrieveResultExt =
                getPackageRetrieveService().retrieveSelective(localProjectPackageList, true, monitor);

        monitorWork(monitor);

        if (retrieveResultExt == null) {
View Full Code Here

        localProjectPackageList.setProject(folder.getProject());

        monitorCheck(monitor);
        monitor.subTask("Retrieving remote contents...");
        RetrieveResultExt retrieveResultExt =
                getPackageRetrieveService().retrieveSelective(localProjectPackageList, true, monitor);

        if (retrieveResultExt == null) {
            logger.warn("Unable to check in sync for folder '" + folder.getName() + "' - retrieve result is null");
            return false;
View Full Code Here

        localProjectPackageList = getProjectPackageListInstance();
        localProjectPackageList.setProject(file.getProject());
        localProjectPackageList.addComponent(component, true);

        monitorWorkCheck(monitor, "Retrieving remote contents...");
        RetrieveResultExt retrieveResultExt =
                getPackageRetrieveService().retrieveSelective(localProjectPackageList, true, monitor);

        if (retrieveResultExt == null) {
            logger.warn("Unable to check in sync for file '" + file.getName() + "' - retrieve result is null");
            return false;
View Full Code Here

        } else if (forceProject != null) {
            connection = factoryLocator.getConnectionFactory().getConnection(forceProject);
        }

        // go get selective components and create components from remote retrieve
        RetrieveResultExt retrieveResultHandler =
                serviceLocator.getPackageRetrieveService().retrieveSelective(connection, projectPackageList, true,
                    monitor);

        if (retrieveResultHandler == null) {
            logger.warn("Unable to perform conflict check - retrieve handler null for " + connection.getLogDisplay()
                + " and project package " + projectPackageList);
            return;
        }

        // REVIEWME: do we conclude w/o component conflict check?
        if (retrieveResultHandler.hasMessages()) {
            StringBuffer strBuff = new StringBuffer("Retrieve result contains problem messages:");
            String[] messages = retrieveResultHandler.getMessageHandler().getDisplayMessages();
            int msgCnt = 0;
            for (String message : messages) {
                strBuff.append("\n (").append(++msgCnt).append(") ").append(message);
            }
            logger.warn(strBuff.toString());
        }

        if (retrieveResultHandler.getZipFileCount() != projectPackageList.getComponentCount(false)) {
            logger.warn("Remote retrieve result count [" + retrieveResultHandler.getZipFileCount()
                + "] does not equal request count [" + projectPackageList.getComponentCount(false) + "].");
        }

        ProjectPackageList remoteProjectPackageList =
                factoryLocator.getProjectPackageFactory().getProjectPackageListInstance(project,
                    retrieveResultHandler.getZipFile(), retrieveResultHandler.getFileMetadataHandler());

        // for each component in each package in build payload, check for conflict
        for (ProjectPackage projectPackage : projectPackageList) {
            ComponentList componentList = projectPackage.getComponentList();
            if (componentList != null && componentList.isNotEmpty()) {
View Full Code Here

        }

        String packageName = getProjectService().getPackageName(project);

        // perform retrieve
        RetrieveResultExt retrieveResultHandler = null;
        try {
            retrieveResultHandler =
                    getServiceLocator().getPackageRetrieveService().retrievePackage(project, packageName, monitor);
        } catch (ServiceTimeoutException ex) {
            retrieveResultHandler =
View Full Code Here

                    pkgNames.add(folder.getName());
                }
            }

            if (Utils.isNotEmpty(pkgNames)) {
                RetrieveResultExt retrieveResultHandler = null;
                try {
                    retrieveResultHandler =
                        getServiceLocator().getPackageRetrieveService().retrieveInstalledPackages(project,
                                pkgNames.toArray(new String[pkgNames.size()]), monitor);
                    retrieveResultHandler.getProjectPackageList().setProject(project);
                } catch (ServiceTimeoutException ex) {
                    retrieveResultHandler =
                        getServiceLocator().getPackageRetrieveService().handleRetrieveServiceTimeoutException(ex,
                                OPERATION, monitor);
                    if (retrieveResultHandler != null) {
                        ProjectPackageList projectPackageList =
                                getProjectPackageFactory().getProjectPackageListInstance(
                                    pkgNames.toArray(new String[pkgNames.size()]));
                        if (projectPackageList != null) {
                            projectPackageList.setProject(project);
                        }
                        retrieveResultHandler.setProjectPackageList(projectPackageList);
                    }
                }

                if (retrieveResultHandler == null
                        || !getProjectService().handleRetrieveResult(retrieveResultHandler, true, monitor)) {
View Full Code Here

TOP

Related Classes of com.salesforce.ide.core.remote.metadata.RetrieveResultExt

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.