Package org.dspace.content

Examples of org.dspace.content.Item


    private void processDefaultItem(Context context,
            HttpServletRequest request, HttpServletResponse response,
            Collection collection) throws SQLException, ServletException,
            IOException, AuthorizeException
    {
        Item item = collection.getTemplateItem();

        for (int i = 0; i < 10; i++)
        {
            int dcTypeID = UIUtil.getIntParameter(request, "dctype_" + i);
            String value = request.getParameter("value_" + i);
            String lang = request.getParameter("lang_" + i);

            if ((dcTypeID != -1) && (value != null) && !value.equals(""))
            {
                MetadataField field = MetadataField.find(context,dcTypeID);
                MetadataSchema schema = MetadataSchema.find(context,field.getSchemaID());
                item.addMetadata(schema.getName(),field.getElement(), field.getQualifier(), lang, value);
            }
        }

        item.update();

        // Now work out what next page is
        showNextPage(context, request, response, collection, DEFAULT_ITEM);

        context.complete();
View Full Code Here


       
        // get the workspace item
        WorkspaceItem wsItem = WorkspaceItem.find(context, wsItemID);
       
        // Ensure the user has authorisation
        Item item = wsItem.getItem();
        AuthorizeManager.authorizeAction(context, item, Constants.READ);
       
        log.info(LogManager.getHeader(context,
            "View Workspace Item",
            "workspace_item_id="+wsItemID));
View Full Code Here

        try
        {
            switch (dso.getType())
            {
            case Constants.ITEM :
                Item item = (Item)dso;
                if (item.isArchived() && !item.isWithdrawn())
                {
                    /** If the item is in the repository now, add it to the index*/
                    if (requiresIndexing(t, ((Item)dso).getLastModified()) || force)
                    {
                        buildDocument(context, (Item) dso, t);                      
View Full Code Here

                ItemIterator items = null;
                try
                {
                    for(items = Item.findAll(context);items.hasNext();)
                    {
                        Item item = (Item) items.next();
                        indexContent(context,item,force);
                        item.decache();
                    }
                }
                finally
                {
                    if (items != null)
View Full Code Here

        String bundleName = ConfigurationManager.getProperty("sword.bundle.name");
        if (bundleName == null || "".equals(bundleName))
        {
          bundleName = "SWORD";
        }
        Item item = result.getItem();
        Bundle[] bundles = item.getBundles(bundleName);
        Bundle swordBundle = null;
        if (bundles.length > 0)
        {
          swordBundle = bundles[0];
        }
        if (swordBundle == null)
        {
          swordBundle = item.createBundle(bundleName);
        }

        String fn = swordService.getFilename(context, deposit, true);

        FileInputStream fis = new FileInputStream(tempFile);
        Bitstream bitstream = swordBundle.createBitstream(fis);
        bitstream.setName(fn);
        bitstream.setDescription("SWORD deposit package");

        BitstreamFormat bf = BitstreamFormat.findByMIMEType(context, deposit.getContentType());
        if (bf != null)
        {
          bitstream.setFormat(bf);
        }

        bitstream.update();
        swordBundle.update();
        item.update();

        swordService.message("Original package stored as " + fn + ", in item bundle " + swordBundle);

        // now reset the context ignore authorisation
        context.setIgnoreAuthorization(ignoreAuth);
View Full Code Here

        {
            int itemCount = 0;

            while (allItems.hasNext())
            {
                Item i = allItems.next();
                String url = handleURLStem + i.getHandle();
                Date lastMod = i.getLastModified();

                if (makeHTMLMap)
                    html.addURL(url, lastMod);
                if (makeSitemapOrg)
                    sitemapsOrg.addURL(url, lastMod);
                i.decache();

                itemCount++;
            }

            if (makeHTMLMap)
View Full Code Here

    Collection toCollection = Collection.find(context,collectionID);
   
    for (String itemID : itemIDs)
        {
            Item item = Item.find(context, Integer.valueOf(itemID));

            if (AuthorizeManager.authorizeActionBoolean(context, item, Constants.READ))
            {
                // make sure item doesn't belong to this collection
                if (!item.isOwningCollection(toCollection))
                {
                    toCollection.addItem(item);
                    // FIXME Exception handling
                    try
                    {
View Full Code Here

    Collection toCollection = Collection.find(context,collectionID);
   
    for (String itemID : itemIDs)
        {
            Item item = Item.find(context, Integer.valueOf(itemID));

            if (AuthorizeManager.authorizeActionBoolean(context, item, Constants.READ))
            {
                // make sure item doesn't belong to this collection
                if (!item.isOwningCollection(toCollection))
                {
                    toCollection.removeItem(item);
                    // FIXME Exception handling
                    try
                    {
View Full Code Here

    {
        init();

        if (dso.getType() != Constants.ITEM)
            throw new CrosswalkObjectNotSupported("XSLTDisseminationCrosswalk can only crosswalk an Item.");
        Item item = (Item)dso;
        XSLTransformer xform = getTransformer(DIRECTION);
        if (xform == null)
            throw new CrosswalkInternalException("Failed to initialize transformer, probably error loading stylesheet.");

        try
View Full Code Here

    {
        init();

        if (dso.getType() != Constants.ITEM)
            throw new CrosswalkObjectNotSupported("XSLTDisseminationCrosswalk can only crosswalk an Item.");
        Item item = (Item)dso;
        XSLTransformer xform = getTransformer(DIRECTION);
        if (xform == null)
            throw new CrosswalkInternalException("Failed to initialize transformer, probably error loading stylesheet.");

        try
View Full Code Here

TOP

Related Classes of org.dspace.content.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.