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

classic Classic list List threaded Threaded
15 messages Options
Reply | Threaded
Open this post in threaded view
|

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

Bugzilla from bugzilla@apache.org
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: [hidden email]
          Reporter: [hidden email]
  Target Milestone: ---

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

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

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

SANDEEP TIWARI <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[hidden email]
                   |                            |m

--- Comment #1 from SANDEEP TIWARI <[hidden email]> ---
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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

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

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=61745

--- Comment #2 from SANDEEP TIWARI <[hidden email]> ---
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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

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

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=61745

--- Comment #3 from SANDEEP TIWARI <[hidden email]> ---
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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

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

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=61745

--- Comment #4 from SANDEEP TIWARI <[hidden email]> ---
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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

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

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=61745

--- Comment #5 from SANDEEP TIWARI <[hidden email]> ---
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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

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

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=61745

Mark Murphy <[hidden email]> changed:

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

--- Comment #6 from Mark Murphy <[hidden email]> ---
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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

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

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=61745

Javen O'Neal <[hidden email]> 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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

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

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=61745

--- Comment #7 from Javen O'Neal <[hidden email]> ---
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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

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

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=61745

--- Comment #8 from Javen O'Neal <[hidden email]> ---
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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

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

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=61745

--- Comment #9 from SANDEEP TIWARI <[hidden email]> ---
@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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

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

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=61745

SANDEEP TIWARI <[hidden email]> changed:

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

--- Comment #10 from SANDEEP TIWARI <[hidden email]> ---
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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

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

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=61745

Javen O'Neal <[hidden email]> 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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

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

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=61745

--- Comment #11 from Javen O'Neal <[hidden email]> ---
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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

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

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=61745

--- Comment #12 from SANDEEP TIWARI <[hidden email]> ---
@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: [hidden email]
For additional commands, e-mail: [hidden email]