Package org.fao.geonet.domain

Examples of org.fao.geonet.domain.ISODate


    return totalRecords != processedRecords;
  }

  @XmlAttribute
  public String getReportDate() {
    return new ISODate().toString();
  }
View Full Code Here


        + ""));
    xmlReport.addContent(new Element("notFound").setText(notFound.size()
        + ""));

    xmlReport.setAttribute("startDate", startDate.toString());
    xmlReport.setAttribute("reportDate", new ISODate().toString());
    xmlReport.setAttribute("running", String.valueOf(isProcessing()));
    xmlReport.setAttribute("totalRecords", totalRecords + "");
    xmlReport.setAttribute("processedRecords", processedRecords + "");
    xmlReport.setAttribute("nullRecords", nullRecords + "");
View Full Code Here

      }
    }

    if (doChanges) {
      boolean validate = false, ufo = false, indexImmediate = false;
      dataMan.updateMetadata(context, "" + metadataEntity.getId(), md, validate, ufo, indexImmediate, context.getLanguage(), new ISODate().toString(), true);

      metadata.add(metadataEntity.getId());
    }
   
  }
View Full Code Here

        String dateFromParam = Util.getParam(params, "dateFrom");
        String dateToParam = Util.getParam(params, "dateTo");
        String graphicType = Util.getParam(params, "graphicType");
        boolean byType = Util.getParam(params, "byType", false);
       
        ISODate dateFrom = null;
        ISODate dateTo = null;

        Element elResp = new Element(Jeeves.Elem.RESPONSE);
        final SearchRequestRepository requestRepository = context.getBean(SearchRequestRepository.class);

        try {
            dateFrom = new ISODate(dateFromParam);
            dateTo = new ISODate(dateToParam);

            // TODO : if ByServiceType
            if (byType) {
                final List<String> serviceTypes = requestRepository.selectAllDistinctAttributes(SearchRequest_
                        .service);
                for (String serviceType : serviceTypes) {
                    Element results = buildQuery(requestRepository, serviceType, dateFrom, dateTo, graphicType);

                    results.setAttribute("service", serviceType);
                    elResp.addContent(results);
                }
            } else {
                Element results = buildQuery(requestRepository, null, dateFrom, dateTo, graphicType);
                elResp.addContent(results);
            }

            elResp.addContent(new Element("dateFrom").setText(dateFrom.getDateAndTime()));
            elResp.addContent(new Element("dateTo").setText(dateTo.getDateAndTime()));
        } catch (Exception e) {
            elResp.setAttribute("error", e.getMessage());
        }

        final ISODate oldestRequestDate = requestRepository.getOldestRequestDate();
        SearchStatistics.addSingleDBValueToElement(elResp,
                oldestRequestDate,
                "dateMin", "min");
        final ISODate mostRecentRequestDate = requestRepository.getMostRecentRequestDate();
        SearchStatistics.addSingleDBValueToElement(elResp,
                mostRecentRequestDate ,
                "dateMax", "max");

        return elResp;
View Full Code Here

        //--- build header and set some infos

        Header h = new Header();

        h.setIdentifier(uuid);
        h.setDateStamp(new ISODate(changeDate));

        for (MetadataCategory metadataCategory : metadata.getCategories()) {
            h.addSet(metadataCategory.getName());
        }
View Full Code Here

      return null;
        }

    String uuid       = metadata.getUuid();
    String schema     = metadata.getDataInfo().getSchemaId();
    ISODate changeDate = metadata.getDataInfo().getChangeDate();

    //--- try to disseminate format if not by schema then by conversion

    if (!prefix.equals(schema)) {
      if (!Lib.existsConverter(sm.getSchemaDir(schema), prefix)) {
View Full Code Here

        String service = Util.getParam(params, SERVICE_PARAM);
        Element response = new Element("response");

        final SearchRequestRepository requestRepository = context.getBean(SearchRequestRepository.class);

        ISODate begin = requestRepository.getOldestRequestDate();
        ISODate end = requestRepository.getMostRecentRequestDate();
        if (begin == null || end == null) {
            return response;    // No stats available.
        }
        DateTime beginDate = ISODate.parseBasicOrFullDateTime(begin.getDateAndTime());
        DateTime endDate = ISODate.parseBasicOrFullDateTime(end.getDateAndTime());
        int days = Days.daysBetween(beginDate, endDate).getDays();
        int nonZeroDays = days == 0 ? 1 : days;
        int months = Months.monthsBetween(beginDate, endDate).getMonths();
        int nonZeroMonths = months == 0 ? 1 : months;
        response.addContent(new Element("activity_days").setText(days + ""));
View Full Code Here

  {
        final Metadata oldestByChangeDate = context.getBean(MetadataRepository.class).findOneOldestByChangeDate();

    //--- if we don't have metadata, just return 'now'
    if (oldestByChangeDate == null)
      return new ISODate();

    return oldestByChangeDate.getDataInfo().getChangeDate();
  }
View Full Code Here

    {
            if(Log.isDebugEnabled(Geonet.OAI_HARVESTER))
                Log.debug(Geonet.OAI_HARVESTER,"OAI " +this.getClass().getSimpleName()+ " : new request (no resumptionToken)");
      Element params = new Element("request");

      ISODate from   = req.getFrom();
      ISODate until  = req.getUntil();
      String  set    = req.getSet();
      String  prefix = req.getMetadataPrefix();

      if (from != null)
      {
        String sFrom = from.isDateOnly() ? from.getDateAsString() : from.toString();
        params.addContent(new Element(getDateFrom()).setText(sFrom));
      }

      if (until != null)
      {
        String sTo = until.isDateOnly() ? until.getDateAsString() : until.toString();
        params.addContent(new Element(getDateUntil()).setText(sTo));
      }

      if (from != null && until != null && from.timeDifferenceInSeconds(until) > 0)
        throw new BadArgumentException("From is greater than until");
View Full Code Here

                  boolean ufo = true;
                  boolean index = false;
                  String language = context.getLanguage();
                  // Always udpate metadata date stamp on metadata processing (minor edit has no effect).
                  boolean updateDateStamp = true;
                  dataMan.updateMetadata(context, id, processedMetadata, validate, ufo, index, language, new ISODate().toString(), updateDateStamp);
                    dataMan.indexMetadata(id, true);
              }
 
              report.addMetadataId(iId);
              // TODO : it could be relevant to list at least
View Full Code Here

TOP

Related Classes of org.fao.geonet.domain.ISODate

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.