Package org.jdesktop.wonderland.modules.errorreport.common

Examples of org.jdesktop.wonderland.modules.errorreport.common.ErrorReport


            List<ErrorReport> reports = new ArrayList<ErrorReport>();
           
            for (ContentNode node : dir.getChildren()) {
                if (node instanceof ContentResource) {
                    try {
                        ErrorReport report = read((ContentResource) node);
                        if (!includeContent) {
                            report.setContent(null);
                        }
                   
                        reports.add(report);
                    } catch (JAXBException je) {
                        LOGGER.log(Level.WARNING, "Error reading " + node.getName(),
View Full Code Here


            ContentNode node = dir.getChild(id);
            if (node == null || !(node instanceof ContentResource)) {
                throw new WebApplicationException(Response.Status.NOT_FOUND);
            }
           
            final ErrorReport log = read((ContentResource) node);
            if (log == null) {
                return Response.status(Response.Status.NOT_FOUND)
                               .entity("No object with id " + id).build();
            }
           
View Full Code Here

            ContentNode node = dir.getChild(id);
            if (node == null || !(node instanceof ContentResource)) {
                throw new WebApplicationException(Response.Status.NOT_FOUND);
            }
           
            final ErrorReport log = read((ContentResource) node);
            if (log == null) {
                return Response.status(Response.Status.NOT_FOUND)
                               .entity("No object with id " + id).build();
            }
           
            ResponseBuilder out = Response.ok(new StreamingOutput() {
                public void write(OutputStream out) throws IOException, WebApplicationException {
                    PrintStream ps = new PrintStream(out);
                   
                    ps.println("User: " + log.getCreator());
                    ps.println("Submitted: " +
                            SimpleDateFormat.getDateTimeInstance().format(log.getTimeStamp()));
                    ps.println("Comments:");
                    ps.println(log.getComments());
                    ps.println("---------- Error Report ----------");
                    ps.println(log.getContent());
                }
            });

            if (asAttachment) {
                out.header("Content-Disposition",
                           "attachment; filename=" + log.getId() + ".txt");
            }
            
            return out.build();       
        } catch (ContentRepositoryException ce) {
            throw new WebApplicationException(ce, Response.Status.INTERNAL_SERVER_ERROR);
View Full Code Here

        Unmarshaller unmarshaller = getContext().createUnmarshaller();
       
        // reports may contain illegal characters. Add a filter to
        // ignore all these characters.
        Reader in = new EscapeBadCharsReader(new InputStreamReader(resource.getInputStream()));
        ErrorReport report = (ErrorReport) unmarshaller.unmarshal(in);
        report.setId(resource.getName());
        return report;
    }
View Full Code Here

       
        String username = submitUserTF.getText();
        String comments = submitCommentsTF.getText();
        String log = errorText.getText();
       
        ErrorReport report = new ErrorReport(username, new Date(), log, comments);
       
        try {
            submit(report);
        } catch (ContentRepositoryException ce) {
            LOGGER.log(Level.WARNING, "Error submitting report", ce);
View Full Code Here

TOP

Related Classes of org.jdesktop.wonderland.modules.errorreport.common.ErrorReport

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.