Search in sources :

Example 21 with UsedAsLiferayAction

use of org.eclipse.sw360.portal.common.UsedAsLiferayAction in project sw360portal by sw360.

the class ComponentUploadPortlet method updateComponents.

@UsedAsLiferayAction
public void updateComponents(ActionRequest request, ActionResponse response) throws PortletException, IOException, TException {
    List<CSVRecord> releaseRecords = getCSVFromRequest(request, "file");
    FluentIterable<ComponentCSVRecord> compCSVRecords = convertCSVRecordsToCompCSVRecords(releaseRecords);
    log.trace("read records <" + Joiner.on("\n").join(compCSVRecords) + ">");
    final ComponentService.Iface componentClient = thriftClients.makeComponentClient();
    final VendorService.Iface vendorClient = thriftClients.makeVendorClient();
    final AttachmentService.Iface attachmentClient = thriftClients.makeAttachmentClient();
    User user = UserCacheHolder.getUserFromRequest(request);
    final RequestSummary requestSummary = writeToDatabase(compCSVRecords, componentClient, vendorClient, attachmentClient, user);
    renderRequestSummary(request, response, requestSummary);
}
Also used : VendorService(org.eclipse.sw360.datahandler.thrift.vendors.VendorService) User(org.eclipse.sw360.datahandler.thrift.users.User) CSVRecord(org.apache.commons.csv.CSVRecord) ComponentService(org.eclipse.sw360.datahandler.thrift.components.ComponentService) RequestSummary(org.eclipse.sw360.datahandler.thrift.RequestSummary) AttachmentService(org.eclipse.sw360.datahandler.thrift.attachments.AttachmentService) UsedAsLiferayAction(org.eclipse.sw360.portal.common.UsedAsLiferayAction)

Aggregations

User (org.eclipse.sw360.datahandler.thrift.users.User)18 UsedAsLiferayAction (org.eclipse.sw360.portal.common.UsedAsLiferayAction)18 TException (org.apache.thrift.TException)13 RequestStatus (org.eclipse.sw360.datahandler.thrift.RequestStatus)8 CSVRecord (org.apache.commons.csv.CSVRecord)4 RequestSummary (org.eclipse.sw360.datahandler.thrift.RequestSummary)3 ComponentService (org.eclipse.sw360.datahandler.thrift.components.ComponentService)3 AttachmentService (org.eclipse.sw360.datahandler.thrift.attachments.AttachmentService)2 VendorService (org.eclipse.sw360.datahandler.thrift.vendors.VendorService)2 WrappedTException (org.eclipse.sw360.datahandler.common.WrappedException.WrappedTException)1 SW360Exception (org.eclipse.sw360.datahandler.thrift.SW360Exception)1 FossologyHostFingerPrint (org.eclipse.sw360.datahandler.thrift.fossology.FossologyHostFingerPrint)1 FossologyService (org.eclipse.sw360.datahandler.thrift.fossology.FossologyService)1 UserService (org.eclipse.sw360.datahandler.thrift.users.UserService)1 Vendor (org.eclipse.sw360.datahandler.thrift.vendors.Vendor)1