[UCP-CMIS] save document

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

[UCP-CMIS] save document

Dan Corneanu
Hi,
I was able to open and see the content of a document through my custom
UCP but was not able to save any changes.
Is there a sequence diagram depicting how UCB communicates with the UCP
when is wants to save the content of a document ?
I am interested in what commands I have to implement.

Best regards,
Dan.

P.S.
I have implemented the "open" command and handle the cases for
XActiveDataStreamer and XActiveDataSink.

--
Dan Corneanu
Sava Technologies SRL
Eroilor de la Tisa nr. 33
300553 Timisoara
Romania

Phone: +40 256 201269, +40 356 101412
Mobile: +40 721 723604
E-mail: [hidden email]
http://www.savatech.ro


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [UCP-CMIS] save document

Kai Sommerfeld
Hi Dan,

On 27.05.10 09:09, Dan Corneanu wrote:
> Hi,
> I was able to open and see the content of a document through my custom
> UCP but was not able to save any changes.
> Is there a sequence diagram depicting how UCB communicates with the UCP
> when is wants to save the content of a document ?
> I am interested in what commands I have to implement.
>
  This is a little bit tricky. You need to implement interface
com.sun.star.ucb.XContentCreator and the command "insert".
"setPropertyValues" is also involved. Refer to
<http://ucb.openoffice.org/docs/ucb-api-usage.html#CreateResource> for
some more details.

- Kai.

> Best regards,
> Dan.
>
> P.S.
> I have implemented the "open" command and handle the cases for
> XActiveDataStreamer and XActiveDataSink.
>


--
OpenOffice.org Engineering at Sun: http://blogs.sun.com/GullFOSS

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [UCP-CMIS] save document

Dan Corneanu
On 5/27/2010 3:02 PM, Kai Sommerfeld wrote:

> Hi Dan,
>
> On 27.05.10 09:09, Dan Corneanu wrote:
>> Hi,
>> I was able to open and see the content of a document through my custom
>> UCP but was not able to save any changes.
>> Is there a sequence diagram depicting how UCB communicates with the UCP
>> when is wants to save the content of a document ?
>> I am interested in what commands I have to implement.
>>
>  This is a little bit tricky. You need to implement interface
> com.sun.star.ucb.XContentCreator and the command "insert".
> "setPropertyValues" is also involved. Refer to
> <http://ucb.openoffice.org/docs/ucb-api-usage.html#CreateResource> for
> some more details.

Do I have to implement this interface even if I just modify an existing
file that was already opened with my UCP ?
I thought implementing XContentCreator is necessary only if I want to be
able to create new documents stored in my UCP.

Thx, for the clue.

--
Dan Corneanu
Sava Technologies SRL
Eroilor de la Tisa nr. 33
300553 Timisoara
Romania

Phone: +40 256 201269, +40 356 101412
Mobile: +40 721 723604
E-mail: [hidden email]
http://www.savatech.ro


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [UCP-CMIS] save document

Kai Sommerfeld
Hi Dan,

On 27.05.10 14:24, Dan Corneanu wrote:

> On 5/27/2010 3:02 PM, Kai Sommerfeld wrote:
>> Hi Dan,
>>
>> On 27.05.10 09:09, Dan Corneanu wrote:
>>> Hi,
>>> I was able to open and see the content of a document through my custom
>>> UCP but was not able to save any changes.
>>> Is there a sequence diagram depicting how UCB communicates with the UCP
>>> when is wants to save the content of a document ?
>>> I am interested in what commands I have to implement.
>>>
>>   This is a little bit tricky. You need to implement interface
>> com.sun.star.ucb.XContentCreator and the command "insert".
>> "setPropertyValues" is also involved. Refer to
>> <http://ucb.openoffice.org/docs/ucb-api-usage.html#CreateResource>  for
>> some more details.
>
> Do I have to implement this interface even if I just modify an existing
> file that was already opened with my UCP ?

  Yes, you must implement the interface. This is not optimal with
respect to the effort needed to implement a ucp, but currently a matter
of fact. ;-)

> I thought implementing XContentCreator is necessary only if I want to be
> able to create new documents stored in my UCP.

  Acknowledged, that the existing documentation is misleading here. ;-)

- Kai.

--
OpenOffice.org Engineering at Sun: http://blogs.sun.com/GullFOSS

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [UCP-CMIS] save document

Dan Corneanu
My implementation looks something like this:

class CMISContent extends WeakBase
    implements XContent,
                        XCommandProcessor2,
                        XContentCreator

public final class CMISContentProvider extends WeakBase
        implements com.sun.star.ucb.XContentProvider,
        com.sun.star.ucb.XParameterizedContentProvider,
        com.sun.star.lang.XServiceInfo,
        com.sun.star.ucb.XContentIdentifierFactory

I open a file using a "cmis" uri. I change the file then I try to save it.
I get an
"Error saving document
cmis:///EFS_CMIS_Tests/Foo.txt?http://fender.savatech.ro:8080/alfresco/cmis
Error creating object.
Could not create backup copy."

The UCB does not try to issue an "insert" command to the UCP.
I guess I'll have to debug OO with gdb :((

--
Dan Corneanu
Sava Technologies SRL
Eroilor de la Tisa nr. 33
300553 Timisoara
Romania

Phone: +40 256 201269, +40 356 101412
Mobile: +40 721 723604
E-mail: [hidden email]
http://www.savatech.ro


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [UCP-CMIS] save document

Kai Sommerfeld
Hi Dan,

On 27.05.10 15:46, Dan Corneanu wrote:

> My implementation looks something like this:
>
> class CMISContent extends WeakBase
>      implements XContent,
>                          XCommandProcessor2,
>                          XContentCreator
>
> public final class CMISContentProvider extends WeakBase
>          implements com.sun.star.ucb.XContentProvider,
>          com.sun.star.ucb.XParameterizedContentProvider,
>          com.sun.star.lang.XServiceInfo,
>          com.sun.star.ucb.XContentIdentifierFactory
>
> I open a file using a "cmis" uri. I change the file then I try to save it.
> I get an
> "Error saving document
> cmis:///EFS_CMIS_Tests/Foo.txt?http://fender.savatech.ro:8080/alfresco/cmis
> Error creating object.
> Could not create backup copy."
>
> The UCB does not try to issue an "insert" command to the UCP.
> I guess I'll have to debug OO with gdb :((
>
  A good starting point might be /sfx2/source/doc/docfile.cxx Look for
ERRCODE_SFX_CANTCREATEBACKUP.

  BTW: Do you know <http://svn.services.openoffice.org/opengrok> ?

- Kai.

--
OpenOffice.org Engineering at Sun: http://blogs.sun.com/GullFOSS

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [UCP-CMIS] save document

Kai Sommerfeld
Hi Dan,

On 27.05.10 16:24, Kai Sommerfeld wrote:

> Hi Dan,
>
> On 27.05.10 15:46, Dan Corneanu wrote:
>> My implementation looks something like this:
>>
>> class CMISContent extends WeakBase
>> implements XContent,
>> XCommandProcessor2,
>> XContentCreator
>>
>> public final class CMISContentProvider extends WeakBase
>> implements com.sun.star.ucb.XContentProvider,
>> com.sun.star.ucb.XParameterizedContentProvider,
>> com.sun.star.lang.XServiceInfo,
>> com.sun.star.ucb.XContentIdentifierFactory
>>
>> I open a file using a "cmis" uri. I change the file then I try to save
>> it.
>> I get an
>> "Error saving document
>> cmis:///EFS_CMIS_Tests/Foo.txt?http://fender.savatech.ro:8080/alfresco/cmis
>>
>> Error creating object.
>> Could not create backup copy."
>>
>> The UCB does not try to issue an "insert" command to the UCP.
>> I guess I'll have to debug OO with gdb :((
>>
> A good starting point might be /sfx2/source/doc/docfile.cxx Look for
> ERRCODE_SFX_CANTCREATEBACKUP.
>
  Seems, that the problem is (again) that OOo does not know how to deal
with your private URL scheme. I suggest to switch to the scheme Stephan
suggested. There are good chances that from the OOo side everything
works well, then.

- Kai.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [UCP-CMIS] save document

Dan Corneanu
On 5/27/2010 5:34 PM, Kai Sommerfeld wrote:
>> A good starting point might be /sfx2/source/doc/docfile.cxx Look for
>> ERRCODE_SFX_CANTCREATEBACKUP.
>>
>
Already had a look there. I think I will not get past this error without
gdb.

>  Seems, that the problem is (again) that OOo does not know how to deal
> with your private URL scheme. I suggest to switch to the scheme
> Stephan suggested. There are good chances that from the OOo side
> everything works well, then.
>
> - Kai.
I have switched to
cmis://http%253A%252F%252Ffender.savatech.ro%253A8080%252Falfresco%252Fcmis/EFS_CMIS_Tests/ATest.odt
and got the same error :(

--
Dan Corneanu
Sava Technologies SRL
Eroilor de la Tisa nr. 33
300553 Timisoara
Romania

Phone: +40 256 201269, +40 356 101412
Mobile: +40 721 723604
E-mail: [hidden email]
http://www.savatech.ro


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [UCP-CMIS] save document

stephan.bergmann
On 05/28/10 09:34, Dan Corneanu wrote:
> I have switched to
> cmis://http%253A%252F%252Ffender.savatech.ro%253A8080%252Falfresco%252Fcmis/EFS_CMIS_Tests/ATest.odt

Why do you escape the http URL in the authority component twice (i.e.,
why not
<cmis://http%3A%2F%2Ffender.savatech.ro%3A8080%2Falfresco%2Fcmis/EFS_CMIS_Tests/ATest.odt>
or even---as ":" need not be escaped in the authority
component---<cmis://http:%2F%2Ffender.savatech.ro:8080%2Falfresco%2Fcmis/EFS_CMIS_Tests/ATest.odt>)?

-Stephan

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [UCP-CMIS] save document

Dan Corneanu
On 5/28/2010 10:46 AM, Stephan Bergmann wrote:

> On 05/28/10 09:34, Dan Corneanu wrote:
>> I have switched to
>> cmis://http%253A%252F%252Ffender.savatech.ro%253A8080%252Falfresco%252Fcmis/EFS_CMIS_Tests/ATest.odt
>>
>
> Why do you escape the http URL in the authority component twice (i.e.,
> why not
> <cmis://http%3A%2F%2Ffender.savatech.ro%3A8080%2Falfresco%2Fcmis/EFS_CMIS_Tests/ATest.odt>
> or even---as ":" need not be escaped in the authority
> component---<cmis://http:%2F%2Ffender.savatech.ro:8080%2Falfresco%2Fcmis/EFS_CMIS_Tests/ATest.odt>)?
>
>
> -Stephan
I have used Java's URLEncoder/URLDecoder. Is the UCB so sensible to the
URI used by a UCP ?

--
Dan Corneanu
Sava Technologies SRL
Eroilor de la Tisa nr. 33
300553 Timisoara
Romania

Phone: +40 256 201269, +40 356 101412
Mobile: +40 721 723604
E-mail: [hidden email]
http://www.savatech.ro


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [UCP-CMIS] save document

Dan Corneanu
In reply to this post by stephan.bergmann
On 5/28/2010 10:46 AM, Stephan Bergmann wrote:

> On 05/28/10 09:34, Dan Corneanu wrote:
>> I have switched to
>> cmis://http%253A%252F%252Ffender.savatech.ro%253A8080%252Falfresco%252Fcmis/EFS_CMIS_Tests/ATest.odt
>>
>
> Why do you escape the http URL in the authority component twice (i.e.,
> why not
> <cmis://http%3A%2F%2Ffender.savatech.ro%3A8080%2Falfresco%2Fcmis/EFS_CMIS_Tests/ATest.odt>
> or even---as ":" need not be escaped in the authority
> component---<cmis://http:%2F%2Ffender.savatech.ro:8080%2Falfresco%2Fcmis/EFS_CMIS_Tests/ATest.odt>)?
>
>
> -Stephan
You were right, I was escaping twice.
I have switched to
cmis://http:%2F%2Fadmin:[hidden email]:8080%2Falfresco%2Fcmis/EFS_CMIS_Tests/ATest.odt
and the results are the same :(

Could it be the userinfo ?

--
Dan Corneanu
Sava Technologies SRL
Eroilor de la Tisa nr. 33
300553 Timisoara
Romania

Phone: +40 256 201269, +40 356 101412
Mobile: +40 721 723604
E-mail: [hidden email]
http://www.savatech.ro


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [UCP-CMIS] save document

stephan.bergmann
In reply to this post by Dan Corneanu
On 05/28/10 09:56, Dan Corneanu wrote:

> On 5/28/2010 10:46 AM, Stephan Bergmann wrote:
>> On 05/28/10 09:34, Dan Corneanu wrote:
>>> I have switched to
>>> cmis://http%253A%252F%252Ffender.savatech.ro%253A8080%252Falfresco%252Fcmis/EFS_CMIS_Tests/ATest.odt
>>>
>> Why do you escape the http URL in the authority component twice (i.e.,
>> why not
>> <cmis://http%3A%2F%2Ffender.savatech.ro%3A8080%2Falfresco%2Fcmis/EFS_CMIS_Tests/ATest.odt>
>> or even---as ":" need not be escaped in the authority
>> component---<cmis://http:%2F%2Ffender.savatech.ro:8080%2Falfresco%2Fcmis/EFS_CMIS_Tests/ATest.odt>)?
>>
>>
>> -Stephan
> I have used Java's URLEncoder/URLDecoder. Is the UCB so sensible to the
> URI used by a UCP ?

No, it should not be (and I assume your problem is not really related to
your URI scheme).  I was just curious.

-Stephan


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [UCP-CMIS] save document

Kai Sommerfeld
On 28.05.10 11:06, Stephan Bergmann wrote:

> On 05/28/10 09:56, Dan Corneanu wrote:
>> On 5/28/2010 10:46 AM, Stephan Bergmann wrote:
>>> On 05/28/10 09:34, Dan Corneanu wrote:
>>>> I have switched to
>>>> cmis://http%253A%252F%252Ffender.savatech.ro%253A8080%252Falfresco%252Fcmis/EFS_CMIS_Tests/ATest.odt
>>>>
>>>>
>>> Why do you escape the http URL in the authority component twice (i.e.,
>>> why not
>>> <cmis://http%3A%2F%2Ffender.savatech.ro%3A8080%2Falfresco%2Fcmis/EFS_CMIS_Tests/ATest.odt>
>>>
>>> or even---as ":" need not be escaped in the authority
>>> component---<cmis://http:%2F%2Ffender.savatech.ro:8080%2Falfresco%2Fcmis/EFS_CMIS_Tests/ATest.odt>)?
>>>
>>>
>>>
>>> -Stephan
>> I have used Java's URLEncoder/URLDecoder. Is the UCB so sensible to the
>> URI used by a UCP ?
>
> No, it should not be (and I assume your problem is not really related to
> your URI scheme). I was just curious.

  Meanwhile, after reading docfile.cxx again, I tend to agree that the
actual problem is not related to Dan's cmis URI scheme. The error
message seems to indicate a problem with a local(!) file, not a remote
file. But it is indeed hard to tell without debugging.

- Kai.

--
OpenOffice.org Engineering at Sun: http://blogs.sun.com/GullFOSS

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]