Run a report with parameters. Path is relative to nextserver root
('/nextServer'). Ex: '/reports/test' <=> '/nextServer/reports/test'

@param runReportMetaData
runReportMetaData
@return documentUrl
178811
@POST
	@Path("runReport")
	public String runReport(RunReportMetaData runReportMetaData) {

		if (LOG.isDebugEnabled()) {
			LOG.debug("Run report web service params = {" + runReportMetaData + "}");
			LOG.debug("reportId = " + runReportMetaData.getReportId());
			LOG.debug("reportFormat = " + runReportMetaData.getFormat());
			LOG.debug("parametersValues = " + ReportUtil.getDebugParameters(runReportMetaData.getParametersValues()));
		}

		Report report = null;
		Date startDate = new Date();
		boolean error = false;
		String message = "Ok";
		String url = "";
		try {

			report = (Report) storageService.getEntityById(runReportMetaData.getReportId());

			ReportRuntime runtime = new ReportRuntime();
			runtime.setOutputType(runReportMetaData.getFormat());
			if (runReportMetaData.getParametersValues() == null) {
				runReportMetaData.setParametersValues(new HashMap<String, Object>());
			}
			runtime.setParametersValues(runReportMetaData.getParametersValues(), null);

			String[] result = reportService.reportToURL(report, runtime, "webservice", UUID.randomUUID().toString());
			if (result == null) {
				return "";
			}

			if (LOG.isDebugEnabled()) {
				LOG.debug("url = " + result[1]);
			}
			url = result[1];
			return url;

		} catch (NotFoundException e) {
			error = true;
			message = e.getMessage();
			LOG.error(message, e);
			throw new WebApplicationException(new Exception(e.getMessage()), ErrorCodes.NOT_FOUND);
		} catch (NoDataFoundException e) {
			error = false;
			message = "No Data";
			throw new WebApplicationException(new Exception(e.getMessage()), ErrorCodes.NO_DATA_FOUND);
		} catch (Exception e) {
			error = true;
			message = e.getMessage();
			LOG.error(message, e);
			throw new WebApplicationException(new Exception(e.getMessage()), ErrorCodes.RUN_ERROR);
		} finally {

			// save history
			if (report != null) {

				User user = (User) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
				String runnerId = user.getId();

				RunReportHistory runHistory = new RunReportHistory();
				String name = UUID.randomUUID().toString();
				runHistory.setName(name);

				String path = report.getPath() + StorageConstants.PATH_SEPARATOR + "runHistory"
						+ StorageConstants.PATH_SEPARATOR + name;
				runHistory.setPath(path);

				if (LOG.isDebugEnabled()) {
					LOG.debug("Create run history '" + runHistory.getPath() + "'");
				}

				runHistory.setRunnerId(runnerId);
				runHistory.setRunnerType(RunReportHistory.WEB_SERVICE);
				runHistory.setStartDate(startDate);
				runHistory.setEndDate(new Date());
				runHistory.setDuration(Seconds
						.secondsBetween(new DateTime(runHistory.getStartDate()), new DateTime(runHistory.getEndDate()))
						.getSeconds());
				runHistory.setError(error);
				runHistory.setMessage(message);
				runHistory.setUrl(url);
				runHistory.setParametersValues(runReportMetaData.getParametersValues(), null);

				try {
					storageService.addEntity(runHistory);
				} catch (Exception e) {
					e.printStackTrace();
					LOG.error(e.getMessage(), e);
				}
			}

		}
	}
75280
private void publishMetadata(String metadataValue, int branchId, Path metadataOutputPath)
      throws IOException {
    try {
      if (metadataOutputPath == null) {
        LOG.info("Metadata output path not set for branch " + String.valueOf(branchId) + ", not publishing.");
        return;
      }

      if (metadataValue == null) {
        LOG.info("No metadata collected for branch " + String.valueOf(branchId) + ", not publishing.");
        return;
      }

      FileSystem fs = this.metaDataWriterFileSystemByBranches.get(branchId);

        if (!fs.exists(metadataOutputPath.getParent())) {
          WriterUtils.mkdirsWithRecursivePermissionWithRetry(fs, metadataOutputPath, this.permissions.get(branchId), retrierConfig);
        }

      //Delete the file if metadata already exists
      if (fs.exists(metadataOutputPath)) {
        HadoopUtils.deletePath(fs, metadataOutputPath, false);
      }
      LOG.info("Writing metadata for branch " + String.valueOf(branchId) + " to " + metadataOutputPath.toString());
      try (FSDataOutputStream outputStream = fs.create(metadataOutputPath)) {
        outputStream.write(metadataValue.getBytes(StandardCharsets.UTF_8));
      }
    } catch (IOException e) {
      LOG.error("Metadata file is not generated: " + e, e);
    }
  }
809074
protected AbstractMetadataResolver buildMetadataResolverFrom(final SamlRegisteredService service,
                                                                 final SamlMetadataDocument metadataDocument) {
        try {
            val desc = StringUtils.defaultString(service.getDescription(), service.getName());
            val metadataResource = ResourceUtils.buildInputStreamResourceFrom(metadataDocument.getDecodedValue(), desc);
            val metadataResolver = new InMemoryResourceMetadataResolver(metadataResource, configBean);

            val metadataFilterList = new ArrayList<MetadataFilter>();
            if (StringUtils.isNotBlank(metadataDocument.getSignature())) {
                val signatureResource = ResourceUtils.buildInputStreamResourceFrom(metadataDocument.getSignature(), desc);
                buildSignatureValidationFilterIfNeeded(service, metadataFilterList, signatureResource);
            }
            configureAndInitializeSingleMetadataResolver(metadataResolver, service, metadataFilterList);
            return metadataResolver;
        } catch (final Exception e) {
            LOGGER.error(e.getMessage(), e);
        }
        return null;
    }
142048
public ReportWriter getReportWriter(final JasperPrint _jasperPrint, final String _format, final Map<JRExporterParameter,Object> _parameters) {
        final JRExporter exporter = FormatInfoRegistry.getInstance().getExporter(_format);
        exporter.setParameters(_parameters);

        if (_jasperPrint.getPages().size() > PAGES_THRESHHOLD) {
            return new FileReportWriter(_jasperPrint, exporter);
        } else {
            return new MemoryReportWriter(_jasperPrint, exporter);
        }
    }
194306
private void convertReports() throws RepositoryException {
		
		String statement = 
				"/jcr:root" + ISO9075.encodePath(StorageConstants.REPORTS_ROOT) + 
				"//*[@className='ro.nextreports.server.domain.Report' and @type='Next']" + 
				"//*[fn:name()='jcr:content' and @jcr:mimeType='text/xml']";
		  
		QueryResult queryResult = getTemplate().query(statement);

		NodeIterator nodes = queryResult.getNodes();
		LOG.info("Converter 5.1 : Found " + nodes.getSize() + " report nodes");
		while (nodes.hasNext()) {
			
			Node node = nodes.nextNode();
			
			Node reportNode = node.getParent().getParent().getParent().getParent();
			String reportName = reportNode.getName();
			String reportPath = reportNode.getPath();	
			LOG.info(" * Start convert '" + reportPath + "'");						
												
			Property prop = node.getProperty("jcr:data");			
        	String xml = null;
            try {                  	
            	xml = new Converter_5_2().convertFromInputStream(prop.getBinary().getStream(), true);            	            	
            	if (xml != null) {
                	ValueFactory valueFactory = node.getSession().getValueFactory(); 
                	Binary binaryValue = valueFactory.createBinary(new ByteArrayInputStream(xml.getBytes("UTF-8")));
                	node.setProperty ("jcr:data", binaryValue);                	
                	LOG.info("\t -> OK");
                } else {
                	LOG.error("\t -> FAILED : null xml");
                }
            	            	            	
            } catch (Throwable t) {                    	            	            
            	LOG.error("\t-> FAILED : " + t.getMessage(), t);            	
            } 					
            
		}
	}
1343148
@POST
    @Consumes(MediaType.APPLICATION_JSON)
    @Produces(MediaType.APPLICATION_JSON)
    @Path("/metrics")
    @Description("Submits externally collected metric data.")
    public Map<String, Object> submitMetrics(@Context HttpServletRequest req, final List<MetricDto> metricDtos) {
        PrincipalUser remoteUser = getRemoteUser(req);

        SystemAssert.requireArgument(metricDtos != null, "Cannot submit null timeseries metrics list.");

        List<Metric> legalMetrics = new ArrayList<>();
        List<MetricDto> illegalMetrics = new ArrayList<>();
        List<String> errorMessages = new ArrayList<>();

        for (MetricDto metricDto : metricDtos) {
            try {
                Metric metric = new Metric(metricDto.getScope(), metricDto.getMetric());
                metric.setTags(metricDto.getTags());
                if (metricDto.getMetatags() != null) {
                    metric.setMetatagsRecord(new MetatagsRecord(metricDto.getMetatags(), metricDto.getMetatagsKey()));
                }

                copyProperties(metric, metricDto);
                legalMetrics.add(metric);
            } catch (Exception e) {
                illegalMetrics.add(metricDto);
                errorMessages.add(e.getMessage());
            }
        }
        _collectionService.submitMetrics(remoteUser, legalMetrics);

        Map<String, Object> result = new HashMap<>();

        result.put("Success", legalMetrics.size() + " metrics");
        result.put("Error", illegalMetrics.size() + " metrics");
        result.put("Error Messages", errorMessages);
        return result;
    }
1028159
def runner(self):
        
        if os.path.isfile(self.report):
            self.report_parse()
        else:
            logging.info('Starting {} analysis pipeline'.format(self.analysistype))
            # Create the objects to be used in the analyses (if required)
            general = None
            for sample in self.runmetadata.samples:
                general = getattr(sample, 'general')
            if general is None:
                # Create the objects to be used in the analyses
                objects = Objectprep(self)
                objects.objectprep()
                self.runmetadata = objects.samples
            # Run the analyses
            MLSTmap(self, self.analysistype, self.cutoff)
            # Create the reports
            self.reporter()
            # Print the metadata to a .json file
            MetadataPrinter(self)
967375
@Override
    public void run() {

        // flag for logging in the "final" block
        boolean docOk = false;
        try {

            // create the index document
            m_result = createIndexDocument(m_cms, m_res, m_index, m_count, m_report);
            docOk = true;

            // check if the thread was interrupted
            if (isInterrupted() && LOG.isDebugEnabled()) {
                LOG.debug(
                    Messages.get().getBundle().key(Messages.LOG_ABANDONED_THREAD_FINISHED_1, m_res.getRootPath()));
            }

        } catch (CmsIndexNoContentException e) {
            // Ignore exception caused by empty documents, so that the report is not messed up with error message
            m_report.println(
                org.opencms.report.Messages.get().container(org.opencms.report.Messages.RPT_OK_0),
                I_CmsReport.FORMAT_OK);
        } catch (Throwable exc) {
            if (m_report != null) {
                m_report.println(
                    org.opencms.report.Messages.get().container(org.opencms.report.Messages.RPT_FAILED_0),
                    I_CmsReport.FORMAT_ERROR);
                m_report.println(
                    org.opencms.report.Messages.get().container(
                        org.opencms.report.Messages.RPT_ARGUMENT_1,
                        exc.toString()),
                    I_CmsReport.FORMAT_ERROR);
            }
            if (LOG.isErrorEnabled()) {
                LOG.error(
                    Messages.get().getBundle().key(
                        Messages.ERR_INDEX_RESOURCE_FAILED_2,
                        m_res.getRootPath(),
                        m_index.getName()),
                    exc);
            }
            // set flag to avoid logging in finally block
            docOk = true;
        } finally {
            if (!docOk) {
                // apparently there was a Throwable that causes an issue
                if (m_report != null) {
                    m_report.println(
                        org.opencms.report.Messages.get().container(org.opencms.report.Messages.RPT_FAILED_0),
                        I_CmsReport.FORMAT_ERROR);
                    m_report.println(
                        Messages.get().container(
                            Messages.ERR_INDEX_RESOURCE_FAILED_2,
                            m_res.getRootPath(),
                            m_index.getName()),
                        I_CmsReport.FORMAT_ERROR);
                }
                if (LOG.isErrorEnabled()) {
                    LOG.error(
                        Messages.get().getBundle().key(
                            Messages.ERR_INDEX_RESOURCE_FAILED_2,
                            m_res.getRootPath(),
                            m_index.getName()));
                }
            }
        }
    }
637513
@Override
    final public ManagedConnectionMetaData getMetaData()
                    throws ResourceException {

        if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
            SibTr.entry(this, TRACE, "getMetaData");
        }

        if (_metaData == null) {
            _metaData = new JmsJcaManagedConnectionMetaData();
        }

        if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
            SibTr.exit(this, TRACE, "getMetaData", _metaData);
        }
        return _metaData;

    }
857406
public void createRuntimeReport(PrintStream out) {
        // This function may be running in its own thread.

        out.print("MIME-Version: 1.0\n");
        out.print("Content-type: multipart/mixed; boundary=\"reportsection\"");

        out.print("\n\n--reportsection\nContent-Type: text/plain\n\nClientInterface Report\n");
        if (m_clientInterface != null) {
            out.print(m_clientInterface.toString() + "\n");
        }
    }
1253324
function checkMetaDocsUrl(context, exportsNode) {
    if (exportsNode.type !== "ObjectExpression") {

        // if the exported node is not the correct format, "internal-no-invalid-meta" will already report this.
        return;
    }

    const metaProperty = getPropertyFromObject("meta", exportsNode);
    const metaDocs = metaProperty && getPropertyFromObject("docs", metaProperty.value);
    const metaDocsUrl = metaDocs && getPropertyFromObject("url", metaDocs.value);

    if (!metaDocs) {
        context.report({
            node: metaProperty,
            message: "Rule is missing a meta.docs property"
        });
        return;
    }

    if (!metaDocsUrl) {
        context.report({
            node: metaDocs,
            message: "Rule is missing a meta.docs.url property"
        });
        return;
    }

    const ruleId = path.basename(context.getFilename().replace(/.js$/u, ""));
    const expected = `https://eslint.org/docs/rules/${ruleId}`;
    const url = metaDocsUrl.value.value;

    if (url !== expected) {
        context.report({
            node: metaDocsUrl.value,
            message: `Incorrect url. Expected "${expected}" but got "${url}"`
        });
    }

}
767294
private void publishLrReports(@Nonnull Run<?, ?> build) throws IOException {
        File reportDirectory = new File(build.getRootDir(), PERFORMANCE_REPORT_FOLDER);
        if (reportDirectory.exists()) {
            File htmlIndexFile = new File(reportDirectory, INDEX_HTML_NAME);
            if (htmlIndexFile.exists()) {
                build.replaceAction(new PerformanceReportAction(build));
            }
        }

        File summaryDirectory = new File(build.getRootDir(), TRANSACTION_SUMMARY_FOLDER);
        if (summaryDirectory.exists()) {
            File htmlIndexFile = new File(summaryDirectory, INDEX_HTML_NAME);
            if (htmlIndexFile.exists()) {
                build.replaceAction(new TransactionSummaryAction(build));
            }
        }
    }
1143564
def run_metadata_route(self, request):
    """"""
    tag = request.args.get('tag')
    run = request.args.get('run')
    if tag is None:
      return http_util.Respond(
          request, 'query parameter "tag" is required', 'text/plain', 400)
    if run is None:
      return http_util.Respond(
          request, 'query parameter "run" is required', 'text/plain', 400)
    result = self.run_metadata_impl(run, tag)
    if result is not None:
      (body, mime_type) = result  # pylint: disable=unpacking-non-sequence
      return http_util.Respond(request, body, mime_type)
    else:
      return http_util.Respond(request, '404 Not Found', 'text/plain',
                               code=404)
631026
public GetFolderResult withCustomMetadata(java.util.Map<String, String> customMetadata) {
        setCustomMetadata(customMetadata);
        return this;
    }
1239259
@GetMapping("/sp/metadata")
    public ResponseEntity<String> getFirstServiceProviderMetadata() {
        val saml2Client = builtClients.findClient(SAML2Client.class);
        if (saml2Client != null) {
            return getSaml2ClientServiceProviderMetadataResponseEntity(saml2Client);
        }
        return getNotAcceptableResponseEntity();
    }
754114
def methodreporter(self):
        
        # Ensure that the analyses are set to complete
        self.analysescomplete = True
        # Reset the report path to original value
        self.reportpath = os.path.join(self.path, 'reports')
        # Clear the runmetadata - it will be populated with all the metadata from completemetadata
        self.runmetadata = MetadataObject()
        self.runmetadata.samples = list()
        # As the samples were entered into self.completemetadata depending on when they passed the quality threshold,
        # this list is not ordered numerically/alphabetically like the original runmetadata. Reset the order.
        for strain in self.samples:
            for sample in self.completemetadata:
                if sample.name == strain:
                    # Append the sample to the ordered list of objects
                    self.runmetadata.samples.append(sample)
        # Create the reports
        self.reporter()
        self.genusspecific()
        self.sixteensreporter()
        self.gdcsreporter()
        self.confindr_reporter()
1333557
private XmlHttpResponse getReportXml(String reportXmlFilename) {
        String url = LalCallColumnFixture.getLalUrl() + "/xmlrr/archive/Report/" + reportXmlFilename;
        return env.doHttpGetXml(url);
    }