You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2017/11/11 11:02:19 UTC

[Bug 61745] New: [PATCH] Added Support To create chart object For DOCX

https://bz.apache.org/bugzilla/show_bug.cgi?id=61745

            Bug ID: 61745
           Summary: [PATCH] Added Support To create chart object For DOCX
           Product: POI
           Version: 3.17-FINAL
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: XWPF
          Assignee: dev@poi.apache.org
          Reporter: er.sandeeptiwari32@gmail.com
  Target Milestone: ---

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 61745] [PATCH] Added Support To create chart object For DOCX

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61745

Javen O'Neal <on...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #35516|text/plain                  |application/tar+gzip
          mime type|                            |
  Attachment #35516|1                           |0
           is patch|                            |

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 61745] [PATCH] Added Support To create chart object For DOCX

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61745

--- Comment #7 from Javen O'Neal <on...@apache.org> ---
This patch was generated with "ant -f patch.xml" (patch.tar.gz was the hint)
[1]

I fixed the mime-type of the patch to application/tar+gzip (Bugzilla sets the
mime type of attachments marked as a patch to "text/plain", hence the binary
mess your browser displayed).

This patch should download directly now. Apply this patch to a clean svn
checkout using
> ant -f patch.xml apply
or 
> tar xvzf patch.tar.gz
> svn patch patch.txt
> svn add ...

[1] https://poi.apache.org/guidelines.html#Approach+1+-+use+Ant

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 61745] [PATCH] Added Support To create chart object For DOCX

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61745

Javen O'Neal <on...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #35522|1                           |0
           is patch|                            |
  Attachment #35522|text/plain                  |application/tar+gzip
          mime type|                            |

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 61745] [PATCH] Added Support To create chart object For DOCX

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61745

Dominik Stadler <do...@gmx.at> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #13 from Dominik Stadler <do...@gmx.at> ---
This is applied as far as I see, please reopen if not or report new issues for
further patches.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 61745] [PATCH] Added Support To create chart object For DOCX

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61745

Mark Murphy <jm...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO

--- Comment #6 from Mark Murphy <jm...@apache.org> ---
I can't read the patch as it looks like it was just pasted into the text field
in a non-text format. Please attach a file that contains the whole patch. I can
read your test file though.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 61745] [PATCH] Added Support To create chart object For DOCX

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61745

--- Comment #11 from Javen O'Neal <on...@apache.org> ---
Applied attachment 35522 in r1815047 with a few modifications:

In XWPFChart.java:
> protected void XWPFChart(InputStream is)
doesn't make sense to me. Why is there a method with the same name as the class
that isn't a constructor? I removed this, as well as the body of
onDocumentRead().
I didn't check to see if removing the onDocumentRead body causes problems with
reading a chart in a document.

chartSpace and chart class variables should be final if you don't intend to
change them. (This is how I discovered void XWPFChart, which is not a
constructor.) I made these final.

The output stream should be closed in a try-with-resources block to avoid
leaks.
> chartSpace.save(out, xmlOptions);
I changed this, since we're dropping support for Java 6.

I updated the `@since POI 3.14-Beta1` Javadoc remarks to 4.0.0.

Some of the new files had inconsistent whitespace (tabs) and were missing the
ASL 2.0 license header. I fixed this.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 61745] [PATCH] Added Support To create chart object For DOCX

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61745

--- Comment #2 from SANDEEP TIWARI <er...@gmail.com> ---
Created attachment 35517
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=35517&action=edit
Test java file to check functionality of

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 61745] [PATCH] Added Support To create chart object For DOCX

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61745

--- Comment #5 from SANDEEP TIWARI <er...@gmail.com> ---
Created attachment 35519
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=35519&action=edit
Test output file of ms-word

this is output file after executing ApacheXWPFChartTest.java file.in test
program we shown how we can use our existing function to modify chart
properties

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 61745] [PATCH] Added Support To create chart object For DOCX

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61745

--- Comment #9 from SANDEEP TIWARI <er...@gmail.com> ---
@Mark Murphy sir, i used "ant -f patch.xml" command to create patch.

@Javen O'Neal sure sir.
i will create new java file with some test case using junit and will update the
patch with required changes.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 61745] [PATCH] Added Support To create chart object For DOCX

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61745

--- Comment #8 from Javen O'Neal <on...@apache.org> ---
Thank you for adding support for charts in XWPF!

Would you be able to write some unit tests (or modify existing ones) to cover
the new and changed functionality? See
https://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/xwpf/usermodel/TestXWPFPictureData.java?view=log
for an example.

Would you also be able to make the following changes:
XWPFDocument#getCharts:
return Collections.unmodifiableList(charts);

XWPFChart:
Remove @Deprecated API's in XWPFChart. No need for deprecated API's in new
code.
Update javadocs to @since POI 4.0.0

It looks like this was modeled after XWPFPictureData. To whoever ends up
committing this code to the svn repo, an "svn cp XWPFPictureData.java
XWPFChart.java; cp patch.tar.gz/XWPFChart.java ." might make sense.
If there's any code that XWPFChart and XWPFPictureData share in common, it may
make sense to create a class that implements the common methods.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 61745] [PATCH] Added Support To create chart object For DOCX

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61745

--- Comment #3 from SANDEEP TIWARI <er...@gmail.com> ---
Comment on attachment 35517
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=35517
Test java file to check functionality of

This is the test java file to test the functionality of new enhancement i.e
creating chart object from MS-word file

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 61745] [PATCH] Added Support To create chart object For DOCX

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61745

SANDEEP TIWARI <er...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |er.sandeeptiwari32@gmail.co
                   |                            |m

--- Comment #1 from SANDEEP TIWARI <er...@gmail.com> ---
Created attachment 35516
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=35516&action=edit
This Patch contains 1 java files XWPFChart and 2 modified java XWPFDocument,
XWPFRelation.This patch we can use to create chart object reading Document
file.

In DOCX (MS-Word) document we are not able to create chart object by reading
chart from document file.In this Patch i added 1 java files XWPFChart which we
can use to create chart object and then can use all method to add/modify chart
properties same as we are using in case of PPT/EXCEL along with that i modified
2 java files XWPFDocument, XWPFRelation to parse chart from document and add
relation in document file.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 61745] [PATCH] Added Support To create chart object For DOCX

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61745

SANDEEP TIWARI <er...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #35516|0                           |1
        is obsolete|                            |

--- Comment #10 from SANDEEP TIWARI <er...@gmail.com> ---
Created attachment 35522
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=35522&action=edit
updated Patch file with required changes

Updated patch file with required changes,along with that added unit test case
java file.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 61745] [PATCH] Added Support To create chart object For DOCX

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61745

--- Comment #12 from SANDEEP TIWARI <er...@gmail.com> ---
@javen thanks for updating patch. I used some of methods for future uses, I am
also writing support of create charts in document file without reading any
tamplate doc file, I will update my direct chart support in ms doc code
accordingly and we will review it in future.
Again thanks for updating patch. :)

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 61745] [PATCH] Added Support To create chart object For DOCX

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=61745

--- Comment #4 from SANDEEP TIWARI <er...@gmail.com> ---
Created attachment 35518
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=35518&action=edit
Test input ms-word file

this is test ms-word file from which we are creating chart object,

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org