Examples of ItemAdapter


Examples of org.dspace.app.xmlui.objectmanager.ItemAdapter

      // Specified using a regular handle.
           DSpaceObject dso = HandleManager.resolveToObject(context, handle);
          
           // Handles can be either items or containers.
           if (dso instanceof Item)
                        adapter = new ItemAdapter(context, (Item) dso, contextPath);
           else if (dso instanceof Collection || dso instanceof Community)
             adapter = new ContainerAdapter(context, dso, contextPath);
         }
         else if (internal != null)
         {
          // Internal identifier, format: "type:id".
           String[] parts = internal.split(":");
          
           if (parts.length == 2)
           {
             String type = parts[0];
                       String strid = parts[1];
             int id = 0;

                        // Handle prefixes must be treated as strings
                        // all non-repository types need integer IDs
                        if ("repository".equals(type))
                        {
                                if (ConfigurationManager.getProperty("handle.prefix").equals(strid))
                                        adapter = new RepositoryAdapter(context,contextPath);
                        }
                        else
                        {
                               id = Integer.valueOf(parts[1]);
               if ("item".equals(type))
               {
                 Item item = Item.find(context,id);
                 if (item != null)
                                                 adapter = new ItemAdapter(context,item,contextPath);
               }
               else if ("collection".equals(type))
               {
                 Collection collection = Collection.find(context,id);
                 if (collection != null)
View Full Code Here

Examples of org.dspace.app.xmlui.objectmanager.ItemAdapter

            DSpaceObject dso = HandleManager.resolveToObject(context, handle);

            // Handles can be either items or containers.
            if (dso instanceof Item)
            {
                adapter = new ItemAdapter(context, (Item) dso, contextPath);
            }
           else if (dso instanceof Collection || dso instanceof Community)
            {
                adapter = new ContainerAdapter(context, dso, contextPath);
            }
         }
         else if (internal != null)
         {
          // Internal identifier, format: "type:id".
           String[] parts = internal.split(":");
          
           if (parts.length == 2)
           {
             String type = parts[0];
                       String strid = parts[1];
             int id = 0;

                        // Handle prefixes must be treated as strings
                        // all non-repository types need integer IDs
                        if ("repository".equals(type))
                        {
                                if (HandleManager.getPrefix().equals(strid))
                                {
                                    adapter = new RepositoryAdapter(context, contextPath);
                                }
                        }
                        else
                        {
                               id = Integer.valueOf(parts[1]);
               if ("item".equals(type))
               {
                 Item item = Item.find(context,id);
                 if (item != null)
                         {
                             adapter = new ItemAdapter(context, item, contextPath);
                         }
               }
               else if ("collection".equals(type))
               {
                 Collection collection = Collection.find(context,id);
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.