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

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

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

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

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

Reply | Threaded
Open this post in threaded view
|

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

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

Dominik Stadler <[hidden email]> changed:

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

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

Reply | Threaded
Open this post in threaded view
|

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

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

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

Reply | Threaded
Open this post in threaded view
|

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

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

Javen O'Neal <[hidden email]> changed:

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

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

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

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

Reply | Threaded
Open this post in threaded view
|

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

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

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

Reply | Threaded
Open this post in threaded view
|

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

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

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

Reply | Threaded
Open this post in threaded view
|

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

Greg Woolsey
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 <[hidden email]> wrote:

> https://bz.apache.org/bugzilla/show_bug.cgi?id=59287
>
> --- Comment #5 from Mark Murphy <[hidden email]> ---
> 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: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|

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

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

Andreas Beeker <[hidden email]> changed:

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

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