Package org.apache.tuscany.sca.implementation.data.collection

Examples of org.apache.tuscany.sca.implementation.data.collection.Item


     *
     * @param vm
     * @return
     */
    private static Item item(SCANodeVM vm) {
        Item item = new Item();
        String key = vm.getNodeName();
        item.setTitle(title(key));
        item.setLink("/node-image/" + vm.getNodeName());
        item.setContents("<span id=\"log\" style=\"white-space: nowrap; font-size: small\">" + vm.getLog().toString() + "</span>");
        return item;
    }
View Full Code Here


     *
     * @param fileName
     * @return
     */
    private static Item item(String fileName) {
        Item item = new Item();
        item.setTitle(fileName);
        item.setLink("/files/" + fileName);
        return item;
    }
View Full Code Here

        // Get the list of contributions in the workspace
        Entry<String, Item>[] contributionEntries = contributionCollection.getAll();

        // Read contribution metadata
        for (Entry<String, Item> contributionEntry: contributionEntries) {
            Item contributionItem = contributionEntry.getData();
            Contribution contribution;
            try {
                contribution = contribution(contributionEntry.getKey(), contributionItem.getAlternate());
            } catch (ContributionReadException e) {
                continue;
            }

            // Create entries for the deployable composites
View Full Code Here

    public Item get(String key) throws NotFoundException {
        logger.info("get " + key);

        // Get the specified contribution info
        String contributionURI = contributionURI(key);
        Item contributionItem = contributionCollection.get(contributionURI);
       
        // Read the contribution
        Contribution contribution;
        try {
            contribution = contribution(contributionURI, contributionItem.getAlternate());
        } catch (ContributionReadException e) {
            throw new NotFoundException(key);
        }

        // Find the specified deployable composite
View Full Code Here

            // contribution
            List<Entry<String, Item>> entries = new ArrayList<Entry<String, Item>>();

            // Get the specified contribution info
            String contributionURI = queryString.substring(queryString.indexOf('=') + 1);
            Item contributionItem;
            try {
                contributionItem = contributionCollection.get(contributionURI);
            } catch (NotFoundException e) {
                return entries.toArray(new Entry[entries.size()]);
            }
           
            // Read the contribution
            Contribution contribution;
            try {
                contribution = contribution(contributionURI, contributionItem.getAlternate());
            } catch (ContributionReadException e) {
                return entries.toArray(new Entry[entries.size()]);
            }

            // Create entries for the deployable composites
View Full Code Here

            if (contribution == null) {
               
                // The contribution has not been loaded yet, load it with all its dependencies
                Entry<String, Item>[] entries = contributionCollection.query("alldependencies=" + contributionURI);
                for (Entry<String, Item> entry: entries) {
                    Item contributionItem = entry.getData();
   
                    // Read the contribution
                    Contribution c;
                    try {
                        c = contribution(loadedContributions, entry.getKey(), contributionItem.getAlternate());
                    } catch (ContributionReadException e) {
                        continue;
                    }
                    loadedContributions.add(c);
                    if (contributionURI.equals(entry.getKey())) {
View Full Code Here

            QName qname = compositeQName(key);

            // Load the contribution
            Contribution contribution = contributionMap.get(contributionURI);
            if (contribution == null) {
                Item contributionItem = contributionCollection.get(contributionURI);
               
                // Read the contribution
                try {
                    contribution = contribution(loadedContributions, contributionURI, contributionItem.getAlternate());
                } catch (ContributionReadException e) {
                    continue;
                }
                loadedContributions.add(contribution);
                contributionMap.put(contributionURI, contribution);
View Full Code Here

    private static Item item(Contribution contribution, Composite deployable) {
        String contributionURI = contribution.getURI();
        String contributionLocation = contribution.getLocation();
        QName qname = deployable.getName();
        String deployableURI = deployable.getURI();
        Item item = new Item();
        item.setTitle(compositeTitle(contributionURI, qname));
        item.setContents(content(deployable));
        item.setLink(compositeSourceLink(contributionURI, qname));
        item.setAlternate(compositeAlternateLink(contributionLocation, deployableURI));
        item.setRelated(relatedLink(deployable));
        return item;
    }
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.implementation.data.collection.Item

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.