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 2016/04/07 20:57:14 UTC

[Bug 59287] New: Provide a write() method and change semantics of close() to not automatically write

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

            Bug ID: 59287
           Summary: Provide a write() method and change semantics of
                    close() to not automatically write
           Product: POI
           Version: 3.15-dev
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: OPC
          Assignee: dev@poi.apache.org
          Reporter: dominik.stadler@gmx.at

We repeatedly get questions/bug-reports related to the automatic saving of
changes on close() for the OPCPackage based formats, it seems to be not
expected by most users. 

So we should discuss changing the semantic here to not save on close() by
default and ask users to additionally call a new write() method if they need
the current behavior. 

It will be a breaking change, but I think the confusion among users is big
enough to warrant this change.

-- 
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 59287] Provide a write() method and change semantics of close() to not automatically write

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Blocks|                            |59252

--- Comment #1 from Dominik Stadler <do...@gmx.at> ---
Bug 59252 is related and is probably solved automatically if this one gets
implemented.

Things to take care of here:
* Code-changes
* Tests
* Javadoc in potentially many places
* Documentation on the webpage (with notes about which version changed the
behavior)

-- 
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 59287] Provide a write() method and change semantics of close() to not automatically write

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

--- Comment #2 from Nick Burch <ap...@gagravarr.org> ---
I think we should probably take a few hours to finish the in-place-write on
POIDocument and POIXMLDocument when making this change too - should be easish
now that both NPOIFS and OPC support it at the FS level, and would be a good
improvement excuse to cover the breaking change!

-- 
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 59287] Provide a write() method and change semantics of close() to not automatically write

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

Andreas Beeker <ki...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |daniela.loew@giz.de

--- Comment #6 from Andreas Beeker <ki...@apache.org> ---
*** Bug 62985 has been marked as a duplicate of this bug. ***

-- 
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


Re: [Bug 59287] Provide a write() method and change semantics of close() to not automatically write

Posted by Greg Woolsey <gr...@gmail.com>.
I definitely want/need an option to open a document, make changes, and
perform the equivalent of "Save As..." on the modified version.  I have
some static files I use as templates and don't want/can't modify them.
They are typically read-only files in the context of the Java process.

On Mon, Jun 25, 2018 at 1:06 PM <bu...@apache.org> wrote:

> https://bz.apache.org/bugzilla/show_bug.cgi?id=59287
>
> --- Comment #5 from Mark Murphy <jm...@apache.org> ---
> Seems to me that I had an issue at one point (XML document) where I wanted
> to
> read a template, make changes, and save the output as a regular document,
> but,
> it would always update the template in place. I don't know if that would
> have
> anything to do with this, but we might want to make sure that we can do
> that as
> long as we are making changes here.
>
> --
> 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 59287] Provide a write() method and change semantics of close() to not automatically write

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

--- Comment #5 from Mark Murphy <jm...@apache.org> ---
Seems to me that I had an issue at one point (XML document) where I wanted to
read a template, make changes, and save the output as a regular document, but,
it would always update the template in place. I don't know if that would have
anything to do with this, but we might want to make sure that we can do that as
long as we are making changes here.

-- 
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 59287] Provide a write() method and change semantics of close() to not automatically write

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |120011676@qq.com

--- Comment #7 from Dominik Stadler <do...@gmx.at> ---
*** Bug 65215 has been marked as a duplicate of this bug. ***

-- 
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 59287] Provide a write() method and change semantics of close() to not automatically write

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Blocks|                            |58779


Referenced Bugs:

https://bz.apache.org/bugzilla/show_bug.cgi?id=58779
[Bug 58779] Closing an XSSFWorkbook or XSLFSlideShow that was opened with File
instead of FileInputStream modifies the 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 59287] Provide a write() method and change semantics of close() to not automatically write

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

Andreas Beeker <ki...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Blocks|                            |63029


Referenced Bugs:

https://bz.apache.org/bugzilla/show_bug.cgi?id=63029
[Bug 63029] OPCPackage Potentially clobbers files on close()
-- 
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 59287] Provide a write() method and change semantics of close() to not automatically write

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Blocks|                            |59634

-- 
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 59287] Provide a write() method and change semantics of close() to not automatically write

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

--- Comment #3 from Andreas Beeker <ki...@apache.org> ---
When using write(OutputStream) the currently opened package is also written
[1]. How about always working on copy/temporary file and in the case of
write()/commit() move it to over the original file?

[1] https://stackoverflow.com/a/50830215/2066598

-- 
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 59287] Provide a write() method and change semantics of close() to not automatically write

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

--- Comment #4 from PJ Fanning <fa...@yahoo.com> ---
Seems like if we want to make this change, this is the right time to do it.

-- 
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 59287] Provide a write() method and change semantics of close() to not automatically write

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

Sz.Noemi <no...@foconis.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |noemi.szemenyei@foconis.de

-- 
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