Package com.salesforce.ide.core.model

Examples of com.salesforce.ide.core.model.ProjectPackageList


    public IDeployResultExt runTests(IResource projectResource, IProgressMonitor monitor)
            throws ForceConnectionException, FactoryException, CoreException, InterruptedException, RemoteException,
            ServiceException, ForceRemoteException {
        Connection connection = getConnectionFactory().getConnection(projectResource.getProject());
        String[] testClazz = testCases(projectResource);
        ProjectPackageList projectPackageList =
                getProjectPackageFactory().loadProjectPackageList(projectResource, monitor);
        LogInfo[] logInfos =
                getLoggingService().getAllLogInfo(projectPackageList.getProject(),
                    LoggingInfo.SupportedFeatureEnum.RunTest);
        return runTests(connection, projectPackageList, testClazz, logInfos, monitor);
    }
View Full Code Here


    }

    protected void testDeploy(IProgressMonitor monitor) throws OperationCanceledException, InterruptedException,
            ServiceException, ForceRemoteException {
        DeployResultExt deployResultExt = null;
        ProjectPackageList projectPackageList = refactorModel.getProjectPackageList();

        monitorCheck(monitor);

        try {
            try {
                deployResultExt = ContainerDelegate.getInstance().getServiceLocator().getPackageDeployService().deployDelete(projectPackageList, true, monitor);
            } catch (ServiceTimeoutException ex) {
                deployResultExt =
                        ContainerDelegate.getInstance().getServiceLocator().getPackageDeployService().handleDeployServiceTimeoutException(ex, "test deploy",
                            monitor);
            }

            if (!deployResultExt.isSuccess()) {
                deployResultExt.getMessageHandler().sort(DeployMessageExt.SORT_RESULT);
                DeployMessage[] deployMessages = deployResultExt.getMessageHandler().getMessages();
                for (DeployMessage deployMessage : deployMessages) {
                    if (!deployMessage.isSuccess()) {
                        logger.warn("Component '" + deployMessage.getFullName() + "' failed test delete: '"
                                + deployMessage.getProblem() + "'. will be deleted locally only.");

                        projectPackageList.removeComponentByFilePath(deployMessage.getFileName(), true, true);
                        monitorCheck(monitor);
                        MessageDialogRunnable messageDialogRunnable =
                                new MessageDialogRunnable("Remote Delete Error", null, UIMessages.getString(
                                    "Refactor.Delete.Complete.CannotDelete.message", new String[] {
                                            deployMessage.getFileName(), deployMessage.getProblem() }),
View Full Code Here

            InterruptedException {
        // REVIEWME: what to do w/ ResourceChangeChecker and/or ValidateEditChecker
        monitorCheck(monitor);

        RefactoringStatus refactoringStatus = new RefactoringStatus();
        ProjectPackageList projectPackageList = refactorModel.getProjectPackageList();
        if (projectPackageList == null) {
            logger.error("Project package list not prepared for delete candidates");
            refactoringStatus.addEntry(createFatalRefactoringStatusEntry(Constants.PLUGIN_NAME
                    + " does not support deleting resource(s)"));
            return refactoringStatus;
View Full Code Here

            entries.add(createWarningRefactoringStatusEntry("Unable to test deploy for project '"
                    + refactorModel.getProject().getName() + "' - project is not online enabled"));
            return entries;
        }

        ProjectPackageList projectPackageList = refactorModel.getProjectPackageList();
        if (Utils.isEmpty(projectPackageList)) {
            logger.error("Unable to perform server delete - project package list is null");
            entries.add(createFatalRefactoringStatusEntry("Cannot perform delete - project package list is null"));
            return entries;
        }

        if (logger.isDebugEnabled()) {
            logger.debug("Deleting the following from server (excluding package.xml(s)):\n"
                    + projectPackageList.getAllComponents().toStringLite());
        }

        monitorCheck(monitor);

        // ensure that each project package has a delete manifest
        for (ProjectPackage projectPackage : projectPackageList) {
            if (projectPackage.getDeleteManifest() == null) {
                try {
                    ContainerDelegate.getInstance().getServiceLocator().getProjectService().getPackageManifestFactory().attachDeleteManifest(projectPackage, true);
                } catch (Exception e) {
                    logger.error("Unable to perform delete - destructive manifest is missing or cannot be "
                            + "generated for package '" + projectPackage.getName() + "'", e);
                    entries
                            .add(createFatalRefactoringStatusEntry("Unable to perform delete - destructive manifest is missing or cannot be "
                                    + "generated for package '" + projectPackage.getName() + "': " + e.getMessage()));
                    return entries;
                }

                // and if it's STILL null, abort
                if (projectPackage.getDeleteManifest() == null) {
                    logger.error("Unable to perform delete - destructive manifest is missing or cannot be "
                            + "generated for package '" + projectPackage.getName() + "'");
                    entries
                            .add(createFatalRefactoringStatusEntry("Unable to perform delete - destructive manifest is missing or cannot be "
                                    + "generated for package '" + projectPackage.getName() + "'"));
                    return entries;
                }
            }
        }

        // test delete, if we have any issues deleting, prompt the user to see if she wants to continue with only deleting locally
        testDeploy(monitor);

        boolean continueDelete = projectPackageList.hasComponents(false);
        if (!continueDelete) {
            logger.warn("No delete components found.- discontinuing remote delete");
            return entries;
        }

        // perform sdelete!!
        monitorCheck(monitor);
        DeployResultExt deployResultExt = null;
        try {
            deployResultExt = ContainerDelegate.getInstance().getServiceLocator().getPackageDeployService().deployDelete(projectPackageList, false, monitor);
            // as part of delete deploy, ide request with auto update package and retrieve for getting updated package.xml
            ContainerDelegate.getInstance().getServiceLocator().getProjectService().handleRetrieveResult(projectPackageList, deployResultExt.getRetrieveResultHandler(), true, monitor);

        } catch (ServiceTimeoutException ex) {
            deployResultExt =
                    ContainerDelegate.getInstance().getServiceLocator().getPackageDeployService().handleDeployServiceTimeoutException(ex, "remote delete", monitor);
        } catch (CoreException e) {
            logger.error("Unable to handle retrieve result from delete deploy ", e);
            throw new InvocationTargetException(e);
        } catch (IOException e) {
            logger.error("Unable to handle retrieve result from delete deploy ", e);
            throw new InvocationTargetException(e);
        }

        if (!deployResultExt.isSuccess()) {
            deployResultExt.getMessageHandler().sort(DeployMessageExt.SORT_RESULT);
            DeployMessage[] messages = deployResultExt.getMessageHandler().getMessages();
            StringBuffer strBuff = new StringBuffer();
            strBuff.append("Remote delete failed with the following message. Will only delete locally.");
            for (DeployMessage deployMessage : messages) {
                strBuff.append("\n  ").append(deployMessage.getFullName()).append(": ").append(
                    deployMessage.getProblem());
            }
            logger.error(strBuff.toString());
            entries.add(createWarningRefactoringStatusEntry(strBuff.toString()));
        } else {
            entries.add(createInfoRefactoringStatusEntry("Resources successfully deleted on server"));

            try {
                postDeleteProcess(projectPackageList, monitor);
            } catch (InvocationTargetException e) {
                logger.warn("Unable to update cache with with deleted component(s)", e);
            }

            clearCaches(projectPackageList);
        }

        // set to skip builder since new component is validated/compiled during deploy()
        try {
            ContainerDelegate.getInstance().getServiceLocator().getProjectService().flagSkipBuilder(projectPackageList.getProject());
        } catch (CoreException e) {
            String logMessage = Utils.generateCoreExceptionLog(e);
            logger.warn("Unable to set builder skip flag: " + logMessage, e);
        }
View Full Code Here

        // generate and save default pacakge manifest
        savePackageManifest(monitor);

        monitorCheck(monitor);
        IProject theproject = getProjectModel().getProject();
        ProjectPackageList projectPackageList =
                ContainerDelegate.getInstance().getServiceLocator().getProjectService().getProjectPackageFactory()
                        .getProjectPackageListInstance(theproject);
        RetrieveResultExt retrieveResultHandler = null;
        switch (getProjectModel().getContentSelection()) {
        case ALL_CONTENT:
View Full Code Here

                        .getPackageRetrieveService()
                        .getRetrieveResult((RetrieveResultExt) ex.getMetadataResultExt(), ex.getAsyncResult(),
                            ex.getMetadataStubExt(), monitor);

        if (retrieveResultHandler != null) {
            ProjectPackageList projectPackageList =
                    ContainerDelegate.getInstance().getServiceLocator().getProjectService().getProjectPackageFactory()
                            .getProjectPackageListInstance(getProjectModel().getProject());
            retrieveResultHandler.setProjectPackageList(projectPackageList);
        }
View Full Code Here

                logger.warn("Failed to retrieve: '" + retrieveMessage.getFileName() + "': "
                        + retrieveMessage.getProblem());
            }
        }

        final ProjectPackageList projectPackageList = retrieveResultHandler.getProjectPackageList();
        if (Utils.isEmpty(projectPackageList)) {
            if (logger.isDebugEnabled()) {
                logger.debug("No results to handle - project package list is empty");
            }
            return;
        }

        monitorCheckSubTask(monitor, Messages.getString("Components.Generating"));
        projectPackageList.setProject(getProjectModel().getProject());
        projectPackageList.generateComponents(retrieveResultHandler.getZipFile(),
            retrieveResultHandler.getFileMetadataHandler());

        monitorCheckSubTask(monitor, Messages.getString("Components.Saving"));
        WorkspaceJob job =
                new ForceProjectRefreshJob.ForceProjectRefreshProject(projectPackageList,
                        projectPackageList.getProject());
        job.setRule(projectPackageList.getProject());
        job.schedule();

        monitorCheck(monitor);
    }
View Full Code Here

                            .getConnection(getProjectModel().getForceProject());
            connection.setTimeoutMillis(Constants.INTERNAL_TIMEOUT_MILLIS);
            getProjectModel().setConnection(connection);

            monitorCheck(monitor);
            ProjectPackageList projectPackageList =
                    ContainerDelegate.getInstance().getServiceLocator().getProjectService().getProjectPackageFactory()
                            .getDevelopmentAndUnmanagedInstalledProjectPackages(connection);
            String[] packageNameArray = projectPackageList.getPackageNames();
            if (Utils.isNotEmpty(packageNameArray)) {
                packageNames.addAll(Arrays.asList(packageNameArray));
            }
        } catch (InterruptedException e) {
            throw e;
View Full Code Here

            if (logger.isInfoEnabled()) {
                logger.info("Save payload is null or empty.  Nothing to save.");
            }
            return;
        }
        ProjectPackageList loadedProjectPackageList = savePayload.getLoadedProjectPackageList();
        final PackageDeployService packageDeployService =
                ContainerDelegate.getInstance().getServiceLocator().getPackageDeployService();
        final DeployOptions deployOptions = makeDeployOptions(packageDeployService);

        DeployResultExt deployResultHandler =
View Full Code Here

    protected boolean initialize(IResource resource, IProgressMonitor monitor) throws FactoryException, CoreException,
            InterruptedException {
        // change elements will equate to a root resource copy and a project package list containing
        // all affected elements
        refactorController.getRefactorModel().setProject(resource.getProject());
        ProjectPackageList projectPackageList = refactorController.loadProjectPackageList(resource, monitor);
        if (projectPackageList != null) {
            refactorController.getRefactorModel().addChangeResource(resource);
            refactorController.getRefactorModel().setProjectPackageList(projectPackageList);
            if (logger.isDebugEnabled()) {
                logger.debug("Added project package list for resource '" + resource.getFullPath().toPortableString()
View Full Code Here

TOP

Related Classes of com.salesforce.ide.core.model.ProjectPackageList

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.