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

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


     * @return true if it doesn't exist on server
     */
    protected boolean checkIfComponentExistsOnServer(IProgressMonitor monitor, final Component component)
            throws ForceConnectionException, ForceRemoteException, InterruptedException, FactoryException,
            InsufficientPermissionsException {
        final FileMetadataExt listMetadataRetrieveResult = fireListMetadataQuery(monitor, component);
        boolean notFoundOnServer = true;
        if (listMetadataRetrieveResult.hasFileProperties()) {
            final FileProperties[] fileProps = listMetadataRetrieveResult.getFileProperties();
            for (FileProperties fp : fileProps) {
                if (fp.getFullName().equalsIgnoreCase(component.getName())) {
                    notFoundOnServer=false;
                    break;
                }
View Full Code Here


    }

    protected FileMetadataExt fireListMetadataQuery(IProgressMonitor monitor, final Component component)
            throws ForceConnectionException, ForceRemoteException, InterruptedException, FactoryException,
            InsufficientPermissionsException {
        final FileMetadataExt listMetadataRetrieveResult =
                ContainerDelegate.getInstance().getServiceLocator().getMetadataService().listMetadata(
                    ContainerDelegate.getInstance().getFactoryLocator().getConnectionFactory().getConnection(getComponentWizardModel().getProject()), component, monitor);
        return listMetadataRetrieveResult;
    }
View Full Code Here

                    ContainerDelegate.getInstance().getFactoryLocator().getComponentFactory()
                    .getComponentByComponentType(key);
            if (component != null && component.isWithinFolder()) {
                ListMetadataQuery folderQuery = new ListMetadataQuery();
                folderQuery.setType(component.getFolderNameIfFolderTypeMdComponent());
                FileMetadataExt ext =
                        ContainerDelegate.getInstance().getServiceLocator().getMetadataService().listMetadata(
                            connection, new ListMetadataQuery[] { folderQuery }, new NullProgressMonitor());

                if (ext != null && Utils.isNotEmpty(ext.getFileProperties())) {
                    for (FileProperties file : Utils
                            .removePackagedFiles(ext.getFileProperties(), organizationNamespace)) {
                        Node members =
                                cache.createElementNS(Constants.PACKAGE_MANIFEST_NAMESPACE_URI,
                                    Constants.PACKAGE_MANIFEST_TYPE_MEMBERS);
                        type.appendChild(members);
                        members.setTextContent(file.getFullName());
                    }
                }
            }

            List<FileProperties> files = ext.getFilePropertiesMap(typeList).get(key);
            if (Utils.isEmpty(files)) {
                continue;
            }

            Collections.sort(files, new Comparator<FileProperties>() {
View Full Code Here

                    monitor.beginTask("Fetching component metadata...", Utils.isNotEmpty(listMetadataQueries)
                        ? listMetadataQueries.length + 1 : IProgressMonitor.UNKNOWN);
                    monitor.worked(1);

                    // perform list metadata request w/ queries
                    FileMetadataExt tmpFileMetadataExt =
                            ContainerDelegate.getInstance().getServiceLocator().getMetadataService().listMetadata(
                                getConnection(), listMetadataQueries, monitor);

                    // query describe metadata for organization namespace -
                    // don't get from ForceProject due to project might not be
                    // created yet.
                    MetadataStubExt metadataStubExt =
                            ContainerDelegate.getInstance().getFactoryLocator().getMetadataFactory()
                            .getMetadataStubExt(getConnection());
                    DescribeMetadataResultExt describeMetadataResultExt =
                            ContainerDelegate.getInstance().getServiceLocator().getMetadataService()
                            .getDescribeMetadata(metadataStubExt, new NullProgressMonitor());
                    String organizationNamespace = describeMetadataResultExt.getOrganizationNamespace();

                    // use client provided file properties or augment with fill list
                    // filter out packaged fileproperties from returned
                    // fileproperties (pme should not show packaged content)
                    FileProperties[] removedPackagedFileProps =
                            Utils.removePackagedFiles(tmpFileMetadataExt.getFileProperties(), organizationNamespace);

                    if (null == ext) {
                        ext = tmpFileMetadataExt;
                        ext.setFileProperties(removedPackagedFileProps);
                    } else if (ext.getFileProperties() == null) {
View Full Code Here

            return;
        }

        // enable summary content widget and generate content
        String summary = Messages.getString("ProjectCreateWizard.ProjectContent.ContentSummary.NoContent.message");
        FileMetadataExt fileMetadata = getProjectModel().getPackageManifestModel().getFileMetadatExt();

        StyleRange[] ranges = null;

        ProjectContentSummaryAssembler summaryAssembler = getProjectController().getProjectContentSummaryAssembler();
View Full Code Here

        }

        // aggregate all listMetadata call into one call - reduce traffic.
        if (queryList.size() > 0) {
            ListMetadataQuery[] queryArray = queryList.toArray(new ListMetadataQuery[queryList.size()]);
            FileMetadataExt fileMetadataExt =
                    getMetadataService().listMetadata(connection, queryArray, true, new NullProgressMonitor());
            if (fileMetadataExt.getFilePropertiesCount() > 0) {
                for (FileProperties fileProperties : fileMetadataExt.getFileProperties()) {
                    filePathList.add(fileProperties.getFileName());
                }
            }

        }
View Full Code Here

     * @throws RemoteException
     */
    public FileMetadataExt listMetadata(Connection connection, ListMetadataQuery[] query, boolean filter,
            IProgressMonitor monitor) throws ForceConnectionException, ForceRemoteException, InterruptedException,
            FactoryException {
        FileMetadataExt fileMetadataExt = listMetadata(connection, query, monitor);
        if (filter) {
            fileMetadataExt = filterStandardObjectsFromFileProperties(fileMetadataExt);
        }
        return fileMetadataExt;
    }
View Full Code Here

        return listMetadata(connection, true, monitor);
    }

    public FileMetadataExt listMetadata(Connection connection, boolean filter, IProgressMonitor monitor)
            throws ForceConnectionException, ForceRemoteException, InterruptedException, FactoryException {
        FileMetadataExt fileMetadataExt = new FileMetadataExt();

        String[] componentTypes = getEnabledComponentTypes(connection, filter);
        if (Utils.isNotEmpty(componentTypes)) {
            if (logger.isDebugEnabled()) {
                StringBuffer strBuff = new StringBuffer("Retrieved all components for component types [");
                strBuff.append(componentTypes.length).append("] for connection [").append(connection.getLogDisplay())
                        .append("]:");
                for (String componentType : componentTypes) {
                    strBuff.append("\n  ").append(componentType);
                }
                logger.debug(strBuff.toString());
            }
            ListMetadataQuery[] listMetadataQueryArray = getListMetadataQueryArray(connection, componentTypes, monitor);
            fileMetadataExt = listMetadata(connection, listMetadataQueryArray, monitor);
        }

        if (logger.isDebugEnabled()) {
            logger.debug(fileMetadataExt.toString());
        }

        return fileMetadataExt;
    }
View Full Code Here

    }

    public FileMetadataExt listMetadata(Connection connection, String[] componentTypes, String[] filterComponentTypes,
            IProgressMonitor monitor) throws ForceConnectionException, ForceRemoteException, InterruptedException,
            FactoryException {
        FileMetadataExt fileMetadataExt = new FileMetadataExt();

        if (Utils.isNotEmpty(componentTypes)) {
            ListMetadataQuery[] listMetadataQueryArray = getListMetadataQueryArray(connection, componentTypes, monitor);
            fileMetadataExt = listMetadata(connection, listMetadataQueryArray, monitor);
        }

        if (Utils.isNotEmpty(filterComponentTypes)) {
            if (logger.isDebugEnabled()) {
                logger.debug("Pre-filter FileProperties:\n" + fileMetadataExt.toString());
            }
            fileMetadataExt = filterComponentTypesFromFileProperties(fileMetadataExt, filterComponentTypes);
        }

        if (logger.isDebugEnabled()) {
            logger.debug(fileMetadataExt.toString());
        }

        return fileMetadataExt;
    }
View Full Code Here

        }

        query.setType(type);
        query.setFolder(folder);

        FileMetadataExt fileMetadataExt = listMetadata(connection, new ListMetadataQuery[] { query }, monitor);
        if (logger.isDebugEnabled()) {
            logger.debug(fileMetadataExt.toString());
        }

        return fileMetadataExt;
    }
View Full Code Here

TOP

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

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.