Package org.dspace.app.xmlui.objectmanager

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


          
           // 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)
                   adapter = new ContainerAdapter(context, collection,contextPath);
               }
               else if ("community".equals(type))
               {
                 Community community = Community.find(context,id);
                 if (community != null)
                   adapter = new ContainerAdapter(context, community,contextPath);
               }
      }
           }
         }
     return adapter;
View Full Code Here


            {
                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);
                 if (collection != null)
                         {
                             adapter = new ContainerAdapter(context, collection, contextPath);
                         }
               }
               else if ("community".equals(type))
               {
                 Community community = Community.find(context,id);
                 if (community != null)
                         {
                             adapter = new ContainerAdapter(context, community, contextPath);
                         }
               }
      }
           }
         }
View Full Code Here

TOP

Related Classes of org.dspace.app.xmlui.objectmanager.ContainerAdapter

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.