Subversion Repositories SmartDukaan

Rev

Rev 17411 | Rev 17419 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 17411 Rev 17416
Line 25... Line 25...
25
 
25
 
26
public class ProductLabelGenerator{
26
public class ProductLabelGenerator{
27
	private static Logger logger = LoggerFactory
27
	private static Logger logger = LoggerFactory
28
    .getLogger(ProductLabelGenerator.class);
28
    .getLogger(ProductLabelGenerator.class);
29
	
29
	
30
	public static String generatePdfLabelSheet(String itemId, String itemNumber) throws IOException{
30
	public static ByteArrayOutputStream generatePdfLabelSheet(String itemId, String itemNumber) throws IOException{
31
		ByteArrayOutputStream baosPDF = null;
31
		ByteArrayOutputStream baosPDF = null;
32
		try {
32
		try {
33
			CatalogClient cClient = new CatalogClient();
33
			CatalogClient cClient = new CatalogClient();
34
	        in.shop2020.model.v1.catalog.CatalogService.Client catalogClient = cClient.getClient();
34
	        in.shop2020.model.v1.catalog.CatalogService.Client catalogClient = cClient.getClient();
35
	        Item item = catalogClient.getItem(Long.parseLong(itemId));
35
	        Item item = catalogClient.getItem(Long.parseLong(itemId));
Line 92... Line 92...
92
        } catch (Exception e) {
92
        } catch (Exception e) {
93
            logger.error("Error while generating Invoice: ", e);
93
            logger.error("Error while generating Invoice: ", e);
94
            e.printStackTrace();
94
            e.printStackTrace();
95
        }
95
        }
96
 
96
 
97
        String tmpDir = System.getProperty("java.io.tmpdir");
-
 
98
        String filename = tmpDir + "/item-" + itemId +"-" +System.currentTimeMillis() + ".pdf";
-
 
99
        File f = new File(filename);
-
 
100
        FileOutputStream fos = new FileOutputStream(f);
-
 
101
        baosPDF.writeTo(fos);
-
 
102
        return filename;
97
        return baosPDF;
103
	}
98
	}
104
	/*
99
	/*
105
	public static void main(String[] args) throws IOException{
100
	public static void main(String[] args) throws IOException{
106
		ByteArrayOutputStream baosPDF = null;
101
		ByteArrayOutputStream baosPDF = null;
107
		long itemId = 18267L;
102
		long itemId = 18267L;