Search in sources :

Example 46 with SW360Exception

use of org.eclipse.sw360.datahandler.thrift.SW360Exception in project sw360portal by sw360.

the class ComponentHelper method makeRowsWithReleases.

private SubTable makeRowsWithReleases(Component component) throws SW360Exception {
    List<Release> releases = getReleases(component);
    SubTable table = new SubTable();
    if (releases.size() > 0) {
        for (Release release : releases) {
            List<String> currentRow = makeRowForComponent(component);
            currentRow.addAll(releaseHelper.makeRows(release).elements.get(0));
            table.addRow(currentRow);
        }
    } else {
        List<String> componentRowWithEmptyReleaseFields = makeRowForComponent(component);
        for (int i = 0; i < releaseHelper.getColumns(); i++) {
            componentRowWithEmptyReleaseFields.add("");
        }
        table.addRow(componentRowWithEmptyReleaseFields);
    }
    return table;
}
Also used : SW360Utils.fieldValueAsString(org.eclipse.sw360.datahandler.common.SW360Utils.fieldValueAsString) Release(org.eclipse.sw360.datahandler.thrift.components.Release)

Aggregations

SW360Exception (org.eclipse.sw360.datahandler.thrift.SW360Exception)23 IOException (java.io.IOException)10 InputStream (java.io.InputStream)9 TException (org.apache.thrift.TException)9 AttachmentContent (org.eclipse.sw360.datahandler.thrift.attachments.AttachmentContent)9 Project (org.eclipse.sw360.datahandler.thrift.projects.Project)9 ModerationRequest (org.eclipse.sw360.datahandler.thrift.moderation.ModerationRequest)8 Release (org.eclipse.sw360.datahandler.thrift.components.Release)5 User (org.eclipse.sw360.datahandler.thrift.users.User)5 Test (org.junit.Test)4 CommonUtils.isTemporaryTodo (org.eclipse.sw360.datahandler.common.CommonUtils.isTemporaryTodo)3 SW360Utils.fieldValueAsString (org.eclipse.sw360.datahandler.common.SW360Utils.fieldValueAsString)3 Component (org.eclipse.sw360.datahandler.thrift.components.Component)3 JSchException (com.jcraft.jsch.JSchException)2 Session (com.jcraft.jsch.Session)2 PipedInputStream (java.io.PipedInputStream)2 ParserConfigurationException (javax.xml.parsers.ParserConfigurationException)2 XPathExpressionException (javax.xml.xpath.XPathExpressionException)2 ConcatClosingInputStream (org.eclipse.sw360.datahandler.common.ConcatClosingInputStream)2 WrappedSW360Exception (org.eclipse.sw360.datahandler.common.WrappedException.WrappedSW360Exception)2