Examples of Collection


Examples of org.dspace.rest.common.Collection

            if(AuthorizeManager.authorizeActionBoolean(context, dso, org.dspace.core.Constants.READ)) {
                switch(dso.getType()) {
                    case Constants.COMMUNITY:
                        return new Community((org.dspace.content.Community) dso, expand, context);
                    case Constants.COLLECTION:
                        return new Collection((org.dspace.content.Collection) dso, expand, context, null, null);
                    case Constants.ITEM:
                        return new Item((org.dspace.content.Item) dso, expand, context);
                    default:
                        return new DSpaceObject(dso);
                }
View Full Code Here

Examples of org.exist.collections.Collection

        broker = db.get(null);
      } catch (final EXistException e) {
        return false;
      }
 
          final Collection collection = broker.getCollection(uri.toCollectionPathURI());
          if (collection != null) {return true;}
 
          final Collection parent_collection = broker.getCollection(uri.toCollectionPathURI().removeLastSegment());
          if (parent_collection == null) {return false;}
 
          tm = db.getTransactionManager();
      final Txn transaction = tm.beginTransaction();
     
      try {
        final Collection child = broker.getOrCreateCollection(transaction, uri.toCollectionPathURI());
        broker.saveCollection(transaction, child);
        tm.commit(transaction);
      } catch (final Exception e) {
          tm.abort(transaction);
        return false;
View Full Code Here

Examples of org.hibernate.mapping.Collection

  public void setCollectionCacheConcurrencyStrategy(String collectionRole, String concurrencyStrategy, String region) {
    caches.add( new CacheHolder( collectionRole, concurrencyStrategy, region, false, false ) );
  }

  private void applyCollectionCacheConcurrencyStrategy(CacheHolder holder) {
    Collection collection = getCollectionMapping( holder.role );
    if ( collection == null ) {
      throw new MappingException( "Cannot cache an unknown collection: " + holder.role );
    }
    collection.setCacheConcurrencyStrategy( holder.usage );
    collection.setCacheRegionName( holder.region );
  }
View Full Code Here

Examples of org.mongodb.meclipse.views.objects.Collection

    // Get the selection
    IStructuredSelection selection = (IStructuredSelection) view
        .getViewer().getSelection();

    if (selection != null && selection instanceof IStructuredSelection) {
      Collection obj = (Collection) selection.getFirstElement();
      // If we had a selection lets open the editor
      if (obj != null) {
        CollectionEditorInput input = new CollectionEditorInput(obj);
        try {
          page.openEditor(input, CollectionEditor.ID);
View Full Code Here

Examples of org.purl.sword.base.Collection

    SWORDConfiguration swordConfig = swordService.getSwordConfig();
    SWORDUrlManager urlManager = swordService.getUrlManager();
    Context context = swordService.getContext();

    Item item = (Item) dso;
    Collection scol = new Collection();

    // prepare the parameters to be put in the sword collection
    String location = urlManager.getDepositLocation(item);
    scol.setLocation(location);

    // the item title is the sword collection title, or "untitled" otherwise
    String title = "Untitled";
    DCValue[] dcv = item.getMetadata("dc.title");
    if (dcv.length > 0)
    {
      title = dcv[0].value;
    }
    scol.setTitle(title);

    // FIXME: there is no collection policy for items that is obvious to provide.
    // the collection policy is the licence to which the collection adheres
    // String collectionPolicy = col.getLicense();

    // abstract is the short description of the item, if it exists
    String dcAbstract = "";
    DCValue[] dcva = item.getMetadata("dc.description.abstract");
    if (dcva.length > 0)
    {
      dcAbstract = dcva[0].value;
    }
    if (dcAbstract != null && !"".equals(dcAbstract))
    {
      scol.setAbstract(dcAbstract);
    }

    // do we suppot mediated deposit
    scol.setMediation(swordConfig.isMediated());

    // the list of mime types that we accept, which we take from the
    // bitstream format registry
    List<String> acceptFormats = swordConfig.getAccepts(context, item);
    for (String acceptFormat : acceptFormats)
    {
      scol.addAccepts(acceptFormat);
    }

    return scol;
  }
View Full Code Here

Examples of org.restlet.ext.atom.Collection

                    }
                    this.state = IN_WORKSPACE;
                }
            } else if (localName.equalsIgnoreCase("collection")) {
                if (this.state == IN_WORKSPACE) {
                    this.currentCollection = new Collection(
                            this.currentWorkspace, attrs.getValue("title"),
                            attrs.getValue("href"));
                    String attr = attrs.getValue("xml:base");
                    if (attr != null) {
                        this.currentCollection.setBaseReference(new Reference(
View Full Code Here

Examples of org.terrier.indexing.Collection

            --start;
            _input.seek(start);
      }
      internalInputStream = inputStream = new CountingInputStream(_input, start);
    }
    Collection rtr = CollectionFactory.loadCollection(
      ApplicationSetup.getProperty("trec.collection.class", "TRECCollection"),
      new Class[]{InputStream.class},
      new Object[]{internalInputStream});

    if (rtr == null)
View Full Code Here

Examples of org.wso2.carbon.registry.api.Collection

                CarbonContext.getCurrentContext().getRegistry(RegistryType.SYSTEM_GOVERNANCE);
        String loggedInUser = CarbonContext.getCurrentContext().getUsername();

        String accessKeyId = null;
        String secretAccessKeyId = null;
        Collection userCollection;
        try {
            if (registry.resourceExists(RegistryConstants.PROFILES_PATH + userName)) {
                userCollection = (Collection) registry.get(RegistryConstants.PROFILES_PATH + userName);
                accessKeyId = userCollection.getProperty(MessageBoxConstants.ACCESS_KEY_ID);
                secretAccessKeyId = userCollection.getProperty(MessageBoxConstants.SECRET_ACCESS_KEY_ID);
            }

            if (accessKeyId == null || secretAccessKeyId == null ||
                (!registry.resourceExists(RegistryConstants.PROFILES_PATH + userName))) {

                // generate keys
                accessKeyId = UUID.randomUUID().toString();
                secretAccessKeyId = UUID.fromString(accessKeyId).toString().
                        concat(UUID.randomUUID().toString()).replaceAll("-", "").substring(24);
                accessKeyId = accessKeyId.replaceAll("-", "").substring(12);

                // store keys in registry
                userCollection = registry.newCollection();
                registry.put(RegistryConstants.PROFILES_PATH + userName, userCollection);
                userCollection.addProperty(MessageBoxConstants.ACCESS_KEY_ID, accessKeyId);
                userCollection.addProperty(MessageBoxConstants.SECRET_ACCESS_KEY_ID, secretAccessKeyId);
                registry.put(RegistryConstants.PROFILES_PATH + userName, userCollection);


                // store user/access key in registry
                String accessKeyIndexPath = MessageBoxConstants.REGISTRY_ACCESS_KEY_INDEX_PATH;
                if (!registry.resourceExists(accessKeyIndexPath)) {
                    userCollection = registry.newCollection();
                    registry.put(accessKeyIndexPath, userCollection);
                }
                userCollection = (Collection) registry.get(accessKeyIndexPath);
                userCollection.addProperty(accessKeyId, userName);

                registry.put(accessKeyIndexPath, userCollection);
            }

            // we only allow user and admin to see the secret keys
View Full Code Here

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

        // getting the gadget data
        try {
            registry = getConfigSystemRegistry();
            if (registry.resourceExists(nextGadgetIdPath)) {

                Collection gadgets = (Collection) registry.get(gadgetRepoPath);

                int gadgetCount = gadgets.getChildCount();
                String[] gadgetPaths = gadgets.getChildren();

                for (int i = 0; i < gadgetCount; i++) {
                    if (registry.resourceExists(gadgetPaths[i])) {
                        Resource tempRes = registry.get(gadgetPaths[i]);
                        resList.add(tempRes);
View Full Code Here

Examples of org.xmldb.api.base.Collection

    Class cl = Class.forName(driver);
    Database database = (Database) cl.newInstance();
    database.setProperty("create-database", "true");
    DatabaseManager.registerDatabase(database);

    Collection col = null;
    XMLResource res = null;
    try {
      // get the collection
      col = DatabaseManager.getCollection(URI + "/security");
      col.setProperty(OutputKeys.INDENT, "no");
      res = (XMLResource)col.getResource("example");

      if(res == null) {
        System.out.println("document not found!");
      } else {
        System.out.println(res.getContent());
      }
    } finally {
      //dont forget to clean up!

      if(res != null) {
        //try { ((EXistResource)res).freeResources(); } catch(XMLDBException xe) {xe.printStackTrace();}
      }

      if(col != null) {
        try { col.close(); } catch(XMLDBException xe) {xe.printStackTrace();}
      }
    }
  }
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.