Package com.salesforce.ide.core.model

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


        if (logger.isDebugEnabled()) {
            logger.debug("Creating " + components.get(0).getFullDisplayName());
        }

        // prepare container to perform save and deploy ops
        ProjectPackageList projectPackageList = ContainerDelegate.getInstance().getServiceLocator().getProjectService().getProjectPackageListInstance();
        projectPackageList.setProject(getComponentWizardModel().getProject());
        projectPackageList.addComponents(components, false);

        // perform pre-save actions
        preSaveProcess(getComponentWizardModel(), monitor);

        // save to f/s - enables offline work
        monitorSubTask(monitor, "Saving " + getComponentWizardModel().getDisplayName() + " to project...");
        projectPackageList.saveResources(new String[] { getComponentWizardModel().getComponent().getComponentType() },
            monitor);
        monitorWorkCheck(monitor);

        // commit to server
        monitorSubTask(monitor, "Saving " + getComponentWizardModel().getDisplayName() + " to server...");
View Full Code Here


        if (logger.isDebugEnabled()) {
            logger.debug("Creating " + components.get(0).getFullDisplayName());
        }

        // prepare container to perform save and deploy ops
        ProjectPackageList projectPackageList =
                ContainerDelegate.getInstance().getServiceLocator().getProjectService().getProjectPackageListInstance();
        projectPackageList.setProject(getComponentWizardModel().getProject());
        projectPackageList.addComponents(components, false);
        allPackages.setProject(getComponentWizardModel().getProject());
        allPackages.addComponents(components, false);

        // perform pre-save actions
        preSaveProcess(getComponentWizardModel(), monitor);

        // save to f/s - enables offline work
        monitorSubTask(monitor, "Saving " + getComponentWizardModel().getDisplayName() + " to project...");
        projectPackageList.saveResources(new String[] { getComponentWizardModel().getComponent().getComponentType() },
            monitor);
        monitorWorkCheck(monitor);

        // commit to server
        monitorSubTask(monitor, "Saving " + getComponentWizardModel().getDisplayName() + " to server...");
View Full Code Here

        Component defaultLayout = getDefaultLayout(layout);
        defaultLayout.setPackageName(layout.getPackageName());

        ComponentList components = ContainerDelegate.getInstance().getFactoryLocator().getComponentFactory().getComponentListInstance();
        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 +
            // layout.getName()
            layout.intiNewBody(body);
        }
View Full Code Here

        if (logger.isDebugEnabled()) {
            logger.debug("Creating " + components.get(0).getFullDisplayName());
        }

        // prepare container to perform save and deploy ops
        ProjectPackageList projectPackageList = ContainerDelegate.getInstance().getServiceLocator().getProjectService().getProjectPackageListInstance();
        projectPackageList.setProject(getComponentWizardModel().getProject());
        projectPackageList.addComponents(components, false);

        // save to f/s - enables offline work
        monitorSubTask(monitor, "Saving " + getComponentWizardModel().getDisplayName() + " to project...");
        projectPackageList.saveResources(new String[] { getComponentWizardModel().getComponent().getComponentType() },
            monitor);
        monitorWorkCheck(monitor);

        // retrieve from server
        RetrieveResultExt retrieveResultExt = null;
View Full Code Here

    // M E T H O D S

    // lookup method injection by container
    @Override
    public ProjectPackageList getProjectPackageListInstance() {
        return new ProjectPackageList();
    }
View Full Code Here

    public ProjectPackageList getProjectPackageListInstance() {
        return new ProjectPackageList();
    }

    public ProjectPackageList getProjectPackageListInstance(String[] packageNames) {
        ProjectPackageList projectPackageList = getProjectPackageListInstance();
        if (Utils.isNotEmpty(packageNames)) {
            projectPackageList.addAll(packageNames);
        } else {
            projectPackageList.addAll(new String[] { Constants.DEFAULT_PACKAGED_NAME });
        }
        return projectPackageList;
    }
View Full Code Here

    public ProjectPackage getProjectPackageInstance() {
        return new ProjectPackage();
    }

    public ProjectPackageList getProjectPackageListInstance(IProject project) throws FactoryException {
        ProjectPackageList projectPackageList = getProjectPackageListInstance();
        projectPackageList.setProject(project);
        ProjectPackage projectPackage = getProjectPackageFactory().getProjectPackage(project);
        projectPackageList.add(projectPackage);
        return projectPackageList;
    }
View Full Code Here

            FileMetadataExt fileMetadataHandler) throws FactoryException, InterruptedException, IOException {
        if (fileMetadataHandler == null) {
            throw new IllegalArgumentException("Project and/or FileMetadataExt cannot be null");
        }

        ProjectPackageList projectPackageList = getProjectPackageListInstance();
        projectPackageList.setProject(project);
        projectPackageList.generateComponents(zipFile, fileMetadataHandler);
        return projectPackageList;
    }
View Full Code Here

            throws ForceConnectionException, ForceRemoteException {
        if (connection == null || Utils.isEmpty(soqls)) {
            throw new IllegalArgumentException("Connection and/or sosql name cannot be null");
        }

        ProjectPackageList projectPackageList = getProjectPackageListInstance();
        for (String soql : soqls) {
            QueryResult result = connection.query(soql);
            if (Utils.isNotEmpty(result)) {
                SObject[] sobjects = result.getRecords();
                if (Utils.isNotEmpty(sobjects)) {
                    for (SObject sobject : sobjects) {
                        ProjectPackage projectPackage = getProjectPackageInstance();
                        projectPackage.setOrgId(connection.getOrgId());
                        projectPackage.parseInput(sobject);
                        projectPackageList.add(projectPackage);
                    }
                }
                if (logger.isDebugEnabled()) {
                    logger.debug(projectPackageList.isEmpty() ? "No project packages assembled" : projectPackageList
                            .toString());
                }
            } else {
                if (logger.isInfoEnabled()) {
                    logger.info("Got [0] packages for " + connection.getLogDisplay());
View Full Code Here

        }

        // get local and remote components
        monitorCheckSubTask(monitor, "Gathering project contents");
        List<String> componentTypes = upgradeableComponentList.getComponentTypes();       
    ProjectPackageList localProjectPackageList = ContainerDelegate.getInstance().getServiceLocator().getProjectService().getComponentsForComponentTypes(
                project, componentTypes.toArray(new String[componentTypes.size()]));
        monitorWork(monitor);

        if (Utils.isEmpty(localProjectPackageList.getAllComponents(false))) {
            if (logger.isInfoEnabled()) {
                logger.info("Project is empty - nothing to upgrade");
            }
            return;
        }

        monitorCheckSubTask(monitor, "Retrieving remote content for upgrade analysis");
        ProjectPackageList remoteProjectPackageList = getRemoteProjectPackageList(localProjectPackageList,
                new SubProgressMonitor(monitor, IProgressMonitor.UNKNOWN));
        monitorWork(monitor);

        if (Utils.isEmpty(localProjectPackageList)) {
            if (logger.isInfoEnabled()) {
                logger.info("Remote content empty - nothing to upgrade");
            }
            return;
        }

        // store to-be-upgrade components
        Map<String, List<UpgradeConflict>> upgradeConflicts = new HashMap<String, List<UpgradeConflict>>();

        monitorCheckSubTask(monitor, "Inspecting project contents for upgradeability");
        SubProgressMonitor subMonitor = new SubProgressMonitor(monitor, IProgressMonitor.UNKNOWN);
        // upgrade inspection
        // upgradeability is determine by a straight diff of local vs. remote
        ComponentList localComponentList = localProjectPackageList.getAllComponents();
        for (Component localComponent : localComponentList) {
            if (!isIncludedComponent(localComponent) || isExcludedFileExtension(localComponent)
                    || localComponent.isPackageManifest()) {
                if (logger.isDebugEnabled()) {
                    logger.debug("Excluding " + localComponent.getFullDisplayName() + " from upgrade consideration");
                }
                continue;
            }

            // upgrade analysis is a two phase process. if the first phase check, a xml validation against
            // current schema, passes, the second phase checks the local and remote checksum to determine difference.

            // if exist and has changed, store to be exposed in ui and later saved to project
            Component remoteComponent = remoteProjectPackageList.getComponentByFilePath(localComponent
                    .getMetadataFilePath());

            // phase 1 - validate xml against current schema
            MetadataValidationEventCollector metadataValidationEventCollector = new MetadataValidationEventCollector();
            MetadataExt metadataExt = null;
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.