Examples of CollectionImpl


Examples of net.sf.archimede.model.collection.CollectionImpl

       
        List collections = rootCollection.getCollections();
        //Community
        for (Iterator collIt = collections.iterator(); collIt.hasNext(); ){
            Collection currentCollection = (Collection) collIt.next();
            Collection comparisonCollection = new CollectionImpl();
            comparisonCollection.setName(this.oldFolder.getGroupName());
            if (currentCollection.getName().equals(comparisonCollection.getName())) {
               return currentCollection;
            }
        }
       
        return null;
View Full Code Here

Examples of org.apache.olingo.odata2.core.servicedocument.CollectionImpl

        } else {
          extElements.add(parseExtensionSansTitleElement(reader));
        }
      }
    }
    return new CollectionImpl().setHref(resourceIdentifier).setTitle(title).setCommonAttributes(attributes)
        .setExtesionElements(extElements).setAcceptElements(acceptList).setCategories(categories);
  }
View Full Code Here

Examples of org.apache.xindice.client.xmldb.embed.CollectionImpl

            throw new XMLDBException(ErrorCodes.NO_SUCH_DATABASE,
                                     "Unknown database (must be '" + database.getName() + "'): " + uri);
        }

        try {
            return new CollectionImpl(database, colName);
        } catch (XMLDBException xmldbe) {
            if (xmldbe.errorCode == ErrorCodes.NO_SUCH_COLLECTION) {
                // per getCollection contract, return null if not found
                return null;
            } else {
View Full Code Here

Examples of org.exist.xmldb.CollectionImpl

            dbUri = XmldbURI.xmldbUriFor(dbBaseUri + XmldbURI.ROOT_COLLECTION);
        } else {
            dbUri = XmldbURI.xmldbUriFor(dbBaseUri);
        }
       
        CollectionImpl current = (CollectionImpl)DatabaseManager.getCollection(dbUri.toString(), dbUsername, dbPassword);
        XmldbURI p = XmldbURI.ROOT_COLLECTION_URI;
       
        for(final XmldbURI segment : segments) {
            p = p.append(segment);
            final XmldbURI xmldbURI = dbUri.resolveCollectionPath(p);
            CollectionImpl c = (CollectionImpl)DatabaseManager.getCollection(xmldbURI.toString(), dbUsername, dbPassword);
            if(c == null) {
              current.setTriggersEnabled(false);
                final CollectionManagementServiceImpl mgtService = (CollectionManagementServiceImpl)current.getService("CollectionManagementService", "1.0");
                c = (CollectionImpl)mgtService.createCollection(segment, created);
                current.setTriggersEnabled(true);
View Full Code Here

Examples of org.wso2.carbon.registry.core.CollectionImpl

            }
        }
        if (collection != null) {
            collection.setContent(results.toArray(new String[results.size()]));
        } else if (results.size() > 0) {
            collection = new CollectionImpl(results.toArray(new String[results.size()]));
        }
        return collection;
    }
View Full Code Here

Examples of org.wso2.carbon.registry.core.CollectionImpl

        resource.setAuthorUserName(username);
        return resource;
    }

    public Collection newCollection() throws RegistryException {
        CollectionImpl collection = new CollectionImpl();
        collection.setAuthorUserName(username);
        return collection;
    }
View Full Code Here

Examples of org.wso2.carbon.registry.core.CollectionImpl

        if (!(introspection instanceof Feed)) {
            abderaClient.teardown();
            throw new RegistryException("Got " + introspection.getQName() +
                    " when expecting <feed>!");
        }
        CollectionImpl resource;
        // This is a collection
        Feed feed = (Feed) introspection;
        String state = feed.getSimpleExtension(new QName(APPConstants.NAMESPACE, "state"));
        if (state != null && state.equals("Deleted")) {
            abderaClient.teardown();
View Full Code Here

Examples of org.wso2.carbon.registry.core.CollectionImpl

     * @throws org.wso2.carbon.registry.core.exceptions.RegistryException
     *          : If user is unable to open the URL connection
     */
    private CollectionImpl createResourceFromFeed(Feed feed)
            throws RegistryException {
        CollectionImpl resource = new CollectionImpl();
        org.wso2.carbon.registry.app.Properties properties =
                feed.getExtension(PropertyExtensionFactory.PROPERTIES);
        RemoteRegistry.createPropertiesFromExtensionElement(properties, resource);
        if (feed.getAuthor() != null) {
            resource.setAuthorUserName(feed.getAuthor().getName());
        }
        resource.setLastModified(feed.getUpdated());
        String createdDate = feed.getSimpleExtension(
                new QName(APPConstants.NAMESPACE, "createdTime"));
        if (createdDate != null) {
            resource.setCreatedTime(new Date(Long.parseLong(createdDate)));
        }

        String lastUpdatedUser = feed.getSimpleExtension(APPConstants.QN_LAST_UPDATER);
        if (lastUpdatedUser != null) {
            resource.setLastUpdaterUserName(lastUpdatedUser);
        }

        final Link pathLink = feed.getLink("path");
        String path = (pathLink != null) ? pathLink.getHref().toString() : feed.getTitle();
        path = URLDecoder.decode(path);
        resource.setPath(path);

        // This MUST be after path is set.
        String snapshotID = feed.getSimpleExtension(APPConstants.QN_SNAPSHOT_ID);
        if (snapshotID != null) {
            resource.setMatchingSnapshotID(Long.parseLong(snapshotID));
        }

        String mediaType = feed.getSimpleExtension(new QName(APPConstants.NAMESPACE, "mediaType"));
        if (mediaType != null) {
            resource.setMediaType(mediaType);
        }

        resource.setDescription(feed.getSubtitle());
        String state = feed.getSimpleExtension(new QName(APPConstants.NAMESPACE, "state"));
        if (state != null && "Deleted".equals(state)) {
            resource.setState(RegistryConstants.DELETED_STATE);
        }

        String childCount = feed.getSimpleExtension(APPConstants.QN_CHILD_COUNT);
        if (childCount != null) {
            resource.setChildCount(Integer.parseInt(childCount));
        }

        String isComments = feed.getSimpleExtension(APPConstants.QN_COMMENTS);
        if (isComments != null) {
            resource.setContent(getCommentsFromFeed(feed));
        } else {
            List entries = feed.getEntries();
            if (entries != null) {
                String[] childNodes = new String[entries.size()];
                for (int i = 0; i < entries.size(); i++) {
                    Entry entry = (Entry) entries.get(i);
                    Link childLink = Utils.getLinkWithRel(entry, "path");
                    /*Link childLink = entry.getLink("path");
                    if (childLink == null) {
                        for (Link link : entry.getLinks()) {
                            if (link.getRel() != null &&
                                    link.getRel().equals("path")) {
                                childLink = link;
                                break;
                            }
                        }
                    }      */
                    childNodes[i] = URLDecoder.decode(childLink.getHref().toString());
                }
                resource.setContent(childNodes);
            }
        }

        return resource;
    }
View Full Code Here

Examples of org.wso2.carbon.registry.core.CollectionImpl

                        registry.getRegistryContext(),
                        RegistryConstants.SYSTEM_COLLECTION_BASE_PATH)
                        + "' collection of the Registry.");
            }

            CollectionImpl systemCollection = (CollectionImpl) registry.newCollection();
            String systemDescription = "System collection of the Registry. This collection is " +
                    "used to store the resources required by the carbon server.";
            systemCollection.setDescription(systemDescription);
            registry.put(RegistryUtils.getAbsolutePath(
                    registry.getRegistryContext(), RegistryConstants.SYSTEM_COLLECTION_BASE_PATH),
                    systemCollection);
            systemCollection.discard();

            CollectionImpl localRepositoryCollection = (CollectionImpl) registry.newCollection();
            String localRepositoryDescription =
                    "Local data repository of the carbon server. This " +
                            "collection is used to store the resources local to this carbon " +
                            "server instance.";
            localRepositoryCollection.setDescription(localRepositoryDescription);
            registry.put(RegistryUtils.getAbsolutePath(
                    registry.getRegistryContext(), RegistryConstants.LOCAL_REPOSITORY_BASE_PATH),
                    localRepositoryCollection);
            localRepositoryCollection.discard();

            CollectionImpl configRegistryCollection = (CollectionImpl) registry.newCollection();
            String configRegistryDescription = "Configuration registry of the carbon server. " +
                    "This collection is used to store the resources of this product cluster.";
            configRegistryCollection.setDescription(configRegistryDescription);
            registry.put(RegistryUtils.getAbsolutePath(
                    registry.getRegistryContext(), RegistryConstants.CONFIG_REGISTRY_BASE_PATH),
                    configRegistryCollection);
            configRegistryCollection.discard();

            CollectionImpl governanceRegistryCollection = (CollectionImpl) registry.newCollection();
            String governanceRegistryDescription = "Governance registry of the carbon server. " +
                    "This collection is used to store the resources common to the whole " +
                    "platform.";
            governanceRegistryCollection.setDescription(governanceRegistryDescription);
            registry.put(RegistryUtils.getAbsolutePath(
                    registry.getRegistryContext(), RegistryConstants.GOVERNANCE_REGISTRY_BASE_PATH),
                    governanceRegistryCollection);
            governanceRegistryCollection.discard();
        }
        // This is to create the repository collections for the various registries and clean
        // them at start-up, if needed.
        boolean cleanRegistry = false;
        if (System.getProperty(RegistryConstants.CARBON_REGISTRY_CLEAN) != null) {
View Full Code Here

Examples of org.wso2.carbon.registry.core.CollectionImpl

                return;
            }
            if (log.isTraceEnabled()) {
                log.trace("Creating the '" + profilesPath + "' collection of the Registry.");
            }
            CollectionImpl systemCollection = (CollectionImpl) registry.newCollection();
            String systemDescription = "Collection which contains user-specific details.";
            systemCollection.setDescription(systemDescription);
            registry.put(profilesPath, systemCollection);
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.