Examples of ItemCounter


Examples of org.dspace.browse.ItemCounter

        AuthorizeManager.removeAllPolicies(ourContext, this);

        // get rid of the content count cache if it exists
        try
        {
            ItemCounter ic = new ItemCounter(ourContext);
            ic.remove(this);
        }
        catch (ItemCountException e)
        {
            // FIXME: upside down exception handling due to lack of good
            // exception framework
View Full Code Here

Examples of org.dspace.browse.ItemCounter

                //To improve scalability, XMLUI only adds item counts if they are cached
                if (useCache)
            {
                  try
                  //try to determine Collection size (i.e. # of items)
                    int size = new ItemCounter(this.dspaceContext).getCount(collection);
                    createField("dc","format","extent",null, String.valueOf(size));
                  }
                  catch(ItemCountException e)
                  {
                      IOException ioe = new IOException("Could not obtain Collection item-count");
                      ioe.initCause(e);
                    throw ioe;
                  }
            }
            }
            else if (dso.getType() == Constants.COMMUNITY)
            {
                Community community = (Community) dso;
               
                String description = community.getMetadata("introductory_text");
                String description_abstract = community.getMetadata("short_description");
                String description_table = community.getMetadata("side_bar_text");
                String identifier_uri = "http://hdl.handle.net/" + community.getHandle();
                String rights = community.getMetadata("copyright_text");
                String title = community.getMetadata("name");
               
                createField("dc","description",null,null,description);
                createField("dc","description","abstract",null,description_abstract);
                createField("dc","description","tableofcontents",null,description_table);
                createField("dc","identifier","uri",null,identifier_uri);
                createField("dc","rights",null,null,rights);
                createField("dc","title",null,null,title);
               
                boolean useCache = ConfigurationManager.getBooleanProperty("webui.strengths.cache");
           
                //To improve scalability, XMLUI only adds item counts if they are cached
            if (useCache)
            {
              try
                  //try to determine Community size (i.e. # of items)
                    int size = new ItemCounter(this.dspaceContext).getCount(community);
                    createField("dc","format","extent",null, String.valueOf(size));
                  }
                  catch(ItemCountException e)
                  {
                    IOException ioe = new IOException("Could not obtain Collection item-count");
View Full Code Here

Examples of org.dspace.browse.ItemCounter

        }

        //  get rid of the content count cache if it exists
        try
        {
          ItemCounter ic = new ItemCounter(ourContext);
          ic.remove(this);
        }
        catch (ItemCountException e)
        {
          // FIXME: upside down exception handling due to lack of good
          // exception framework
View Full Code Here

Examples of org.dspace.browse.ItemCounter

                
                if (showCount)
                {
                    try
                    // try to determine Collection size (i.e. # of items)
                        int size = new ItemCounter(this.dspaceContext).getCount(collection);
                        createField("dc","format","extent",null, String.valueOf(size));
                    }
                    catch (ItemCountException e)
                    {
                        throw new IOException("Could not obtain Collection item count", e);
                    }
                }
            }
            else if (dso.getType() == Constants.COMMUNITY)
            {
                Community community = (Community) dso;
               
                String description = community.getMetadata("introductory_text");
                String description_abstract = community.getMetadata("short_description");
                String description_table = community.getMetadata("side_bar_text");
                String identifier_uri = "http://hdl.handle.net/" + community.getHandle();
                String rights = community.getMetadata("copyright_text");
                String title = community.getMetadata("name");
               
                createField("dc","description",null,null,description);
                createField("dc","description","abstract",null,description_abstract);
                createField("dc","description","tableofcontents",null,description_table);
                createField("dc","identifier","uri",null,identifier_uri);
                createField("dc","rights",null,null,rights);
                createField("dc","title",null,null,title);
               
                boolean showCount = ConfigurationManager.getBooleanProperty("webui.strengths.show");
           
                if (showCount)
                {
                    try
                    // try to determine Community size (i.e. # of items)
                        int size = new ItemCounter(this.dspaceContext).getCount(community);
                        createField("dc","format","extent",null, String.valueOf(size));
                    }
                    catch (ItemCountException e)
                    {
                        throw new IOException("Could not obtain Collection item count", e);
View Full Code Here

Examples of org.dspace.browse.ItemCounter

        }

        //  get rid of the content count cache if it exists
        try
        {
          ItemCounter ic = new ItemCounter(ourContext);
          ic.remove(this);
        }
        catch (ItemCountException e)
        {
          // FIXME: upside down exception handling due to lack of good
          // exception framework
View Full Code Here

Examples of org.dspace.browse.ItemCounter

        removeMetadataFromDatabase();

        // get rid of the content count cache if it exists
        try
        {
            ItemCounter ic = new ItemCounter(ourContext);
            ic.remove(this);
        }
        catch (ItemCountException e)
        {
            // FIXME: upside down exception handling due to lack of good
            // exception framework
View Full Code Here

Examples of org.dspace.browse.ItemCounter

                  // Include the item count in the validity, only if the value is shown.
                  boolean showCount = ConfigurationManager.getBooleanProperty("webui.strengths.show");
                  if (showCount)
              {
                      try
                        int size = new ItemCounter(context).getCount(subCommunity);
                        validity.add("size:"+size);
                      } catch(ItemCountException e) { /* ignore */ }
              }
              }
              // Sub collections
              for (Collection collection : collections)
              {
                  validity.add(collection);
                 
                  // Include the item count in the validity, only if the value is shown.
                  boolean showCount = ConfigurationManager.getBooleanProperty("webui.strengths.show");
                  if (showCount)
              {
                      try {
                        int size = new ItemCounter(context).getCount(collection);
                        validity.add("size:"+size);
                      } catch(ItemCountException e) { /* ignore */ }
              }
              }

View Full Code Here

Examples of org.dspace.browse.ItemCounter

                  if (showCount)
              {
                      try
                      //try to determine Collection size (i.e. # of items)
                       
                        int size = new ItemCounter(context).getCount(node.getDSO());
                        validity.add("size:"+size);
                      }
                      catch(ItemCountException e) { /* ignore */ }
              }
                 
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.