Package org.dspace.app.xmlui.utils

Examples of org.dspace.app.xmlui.utils.DSpaceValidity


    {
        if (validity == null)
        {
            try
            {
                DSpaceValidity validity = new DSpaceValidity();
                DSpaceObject dso = HandleUtil.obtainHandle(objectModel);

                if (dso != null)
                    validity.add(dso);

                BrowseInfo info = getBrowseInfo();

                // Are we browsing items, or unique metadata?
                if (isItemBrowse(info))
                {
                    // Add the browse items to the validity
                    for (BrowseItem item : (java.util.List<BrowseItem>) info.getResults())
                    {
                        validity.add(item);
                    }
                }
                else
                {
                    // Add the metadata to the validity
                    for (String[] singleEntry : browseInfo.getStringResults())
                    {
                        validity.add(singleEntry[0]+"#"+singleEntry[1]);
                    }
                }
            }
            catch (Exception e)
            {
View Full Code Here


                        analysisFile = StatisticsLoader.getGeneralAnalysis();

                    if (analysisFile != null)
                    {
                        // Generate the validity based on the properties of the report data file
                        DSpaceValidity newValidity = new DSpaceValidity();
                        newValidity.add(Long.toString(analysisFile.lastModified()));
                        newValidity.add("-");
                        newValidity.add(Long.toString(analysisFile.length()));
                        validity = newValidity.complete();
                    }
                }
            }
            catch (Exception e)
            {
View Full Code Here

  public SourceValidity getValidity() {
    if (this.validity == null) {
      // Only use the DSpaceValidity object is someone is logged in.
      if (context.getCurrentUser() != null) {
        try {
          DSpaceValidity validity = new DSpaceValidity();

          validity.add(eperson);

          Group[] groups = Group.allMemberGroups(context, eperson);
          for (Group group : groups) {
            validity.add(group);
          }

          this.validity = validity.complete();
        } catch (SQLException sqle) {
          // Just ignore it and return invalid.
        }
      } else {
        this.validity = NOPValidity.SHARED_INSTANCE;
View Full Code Here

            try {
                DSpaceObject dso = HandleUtil.obtainHandle(objectModel);


                DSpaceValidity val = new DSpaceValidity();

                // add reciently submitted items, serialize solr query contents.
                performSearch(dso);

                // Add the actual collection;
                if (dso != null)
                    val.add(dso);

                val.add("numFound:" + queryResults.getResults().getNumFound());

                for (SolrDocument doc : queryResults.getResults()) {
                    val.add(doc.toString());
                }

//                for (SolrDocument doc : queryResults.getResults()) {
//                    val.add(doc.toString());
//                }

                for (FacetField field : queryResults.getFacetFields()) {
                    val.add(field.getName());

                    for (FacetField.Count count : field.getValues()) {
                        val.add(count.getName() + count.getCount());
                    }
                }


                this.validity = val.complete();
            }
            catch (Exception e) {
                log.error(e.getMessage(),e);
            }
View Full Code Here

              if (!(dso instanceof Collection))
                  return null;
 
              collection = (Collection) dso;
 
              DSpaceValidity validity = new DSpaceValidity();
             
              // Add the actual collection;
              validity.add(collection);
             
              this.validity = validity.complete();
          }
          catch (Exception e)
          {
              // Just ignore all errors and return an invalid cache.
          }
View Full Code Here

              if (!(dso instanceof Community))
                  return null;
             
              community = (Community) dso;
             
              DSpaceValidity validity = new DSpaceValidity();
              validity.add(community);
             
              Community[] subCommunities = community.getSubcommunities();
              Collection[] collections = community.getCollections();
              // Sub communities
              for (Community subCommunity : subCommunities)
              {
                  validity.add(subCommunity);
              }
              // Sub collections
              for (Collection collection : collections)
              {
                  validity.add(collection);
                }
             
              this.validity = validity.complete();

          }
          catch (Exception e)
          {
              // Ignore all errors and invalidate the cache.
View Full Code Here

    @Override
    public SourceValidity getValidity() {
        if (this.validity == null) {

            try {
                DSpaceValidity validity = new DSpaceValidity();

                DSpaceObject dso = HandleUtil.obtainHandle(objectModel);

                if (dso != null) {
                    // Add the actual collection;
                    validity.add(dso);
                }

                // add reciently submitted items, serialize solr query contents.
                QueryResponse response = getQueryResponse(dso);

                validity.add("numFound:" + response.getResults().getNumFound());

//                for (SolrDocument doc : response.getResults()) {
//                    validity.add(doc.toString());
//                }

                for (SolrDocument doc : response.getResults()) {
                    validity.add(doc.toString());
                }

                for (FacetField field : response.getFacetFields()) {
                    validity.add(field.getName());

                    for (FacetField.Count count : field.getValues()) {
                        validity.add(count.getName() + "#" + count.getCount());
                    }
                }


                this.validity = validity.complete();
            } catch (Exception e) {
                // Just ignore all errors and return an invalid cache.
            }

            //TODO: dependent on tags as well :)
View Full Code Here

              if (!(dso instanceof Community))
                  return null;

              community = (Community) dso;

              DSpaceValidity validity = new DSpaceValidity();
              validity.add(community);

              Community[] subCommunities = community.getSubcommunities();
              Collection[] collections = community.getCollections();
              // Sub communities
              for (Community subCommunity : subCommunities)
              {
                  validity.add(subCommunity);
              }
              // Sub collections
              for (Collection collection : collections)
              {
                  validity.add(collection);
              }

              this.validity = validity.complete();
          }
          catch (Exception e)
          {
              // Ignore all errors and invalidate the cache.
          }
View Full Code Here

              if (!(dso instanceof Collection))
                  return null;

              collection = (Collection) dso;

              DSpaceValidity validity = new DSpaceValidity();

              // Add the actual collection;
              validity.add(collection);

              this.validity = validity.complete();
          }
          catch (Exception e)
          {
              // Just ignore all errors and return an invalid cache.
          }
View Full Code Here

        if (this.validity == null)
      {
          try {
              dso = HandleUtil.obtainHandle(objectModel);

              DSpaceValidity validity = new DSpaceValidity();
              validity.add(dso);
              this.validity =  validity.complete();
          }
          catch (Exception e)
          {
              // Ignore all errors and just invalidate the cache.
          }
View Full Code Here

TOP

Related Classes of org.dspace.app.xmlui.utils.DSpaceValidity

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.