Package org.dspace.app.xmlui.utils

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


     * DSpaceValidity object.
     */
    public SourceValidity getValidity() {
        if (this.validity == null) {
            try {
                DSpaceValidity validity = new DSpaceValidity();

                DSpaceObject scope = getScope();
                validity.add(scope);

                performSearch(scope);

                List<DSpaceObject> results = this.queryResults.getDspaceObjects();

                if (results != null) {
                    validity.add("total:"+this.queryResults.getTotalSearchResults());
                    validity.add("start:"+this.queryResults.getStart());
                    validity.add("size:" + results.size());

                    for (DSpaceObject dso : results) {
                        validity.add(dso);
                    }
                }

                Map<String, List<DiscoverResult.FacetResult>> facetResults = this.queryResults.getFacetResults();
                for(String facetField : facetResults.keySet()){
                    List<DiscoverResult.FacetResult> facetValues = facetResults.get(facetField);
                    for (DiscoverResult.FacetResult facetResult : facetValues)
                    {
                        validity.add(facetField + facetResult.getAsFilterQuery() + facetResult.getCount());
                    }
                }

                this.validity = validity.complete();
            } catch (RuntimeException re) {
                throw re;
            }
            catch (Exception e) {
                this.validity = null;
View Full Code Here


                    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

                    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

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

              DSpaceValidity validity = new DSpaceValidity();

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

                getRecentlySubmittedItems(dso);
                if(queryResults != null){
                    List<DSpaceObject> resultingObjects = queryResults.getDspaceObjects();
                    for(DSpaceObject resultObject : resultingObjects){
                        validity.add(resultObject);
                    }
                    validity.add("numFound:" + resultingObjects.size());
                }

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

                    }

                    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

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.