Hello Alexandro,

Here is what happens:
Document is opened through the "Open" Dialog -> User asked if he wants to
checkout -> If Yes - > Document is checkedout and displayed in read-write
mode -> Save from Save dialog -> User checksin -> User is asked if he wants
to checksout.

When the user chooses not to checkout(initially), the document is opened in
readonly mode(the cursor cannot be placed in the document).

When the user doesn't checkout after checking in, the document is reopened
in the same frame as readonly. Here, the cursor can be placed in the
document but changes cannot be saved. (in a sense it is read-only because
it cannot be saved. But, it creates confusion to the user because the
cursor can  be placed and edited but save button remains deactivated).

As far as code snippet is concerned:
it is hard to point give the code as snippet because it is a ucb property.

I'll give the link to my code:
https://github.com/rajaths589/CMISContentProvider.git

Code snipped for loadComponentFromURL:

XMultiComponentFactory xMCF = m_xContext.getServiceManager();
        Object desktop =
xMCF.createInstanceWithContext("com.sun.star.frame.Desktop", m_xContext);
        XDesktop xDesktop = UnoRuntime.queryInterface(XDesktop.class,
desktop);
        XFrame current_frame = xDesktop.getCurrentFrame();
        XComponentLoader xComponentLoader =
(XComponentLoader)UnoRuntime.queryInterface(XComponentLoader.class,
desktop);
        try
        {
            PropertyValue pv[] = new PropertyValue[1];
            pv[0] = new PropertyValue();
            pv[0].Name = "ReadOnly";
            pv[0].Value = new Any(Type.BOOLEAN,true);
            pv[0].Handle = -1;

xComponentLoader.loadComponentFromURL(manager.getCompleteURL(),current_frame.getName(),
FrameSearchFlag.ALL, pv);
        }
        catch(Exception e)
        {
            log.info("what the hell is this");
        }

Hope this helps.



On Thu, Sep 5, 2013 at 8:01 PM, Alexandro Colorado <j...@oooes.org> wrote:

> Can you provide code snippet to be able to provide more quality answer. Is
> there any other property value being defined and is that definition passing
> through without problem.
>
> F
> rom some of my search through the DevGuide, it seems that before Read only
> was defined through a OpenFlag but that was instead repleaced with the own
> ReadOnly property for the MediaDescriptor service.
>
> http://wiki.openoffice.org/wiki/Documentation/DevGuide/OfficeDev/Handling_Documents
> 
>
>
>
> On Thu, Sep 5, 2013 at 8:57 AM, Rajath Shashidhara <
> rajaths.raja...@gmail.com> wrote:
>
> > Hello,
> >
> > I'm passing a propertyvalue, "readOnly"-true to loadComponentFromURL(),
> but
> > the openoffice is still not opening in readonly from.
> > What are the possible sources of error?
> >
> > --
> > Rajath S,
> > M.Sc(Hons.) Physics, B.E.(Hons.) Computer Science
> > Birla Institute of Technology and Science - Pilani,
> > Pilani
> >
>
>
>
> --
> Alexandro Colorado
> Apache OpenOffice Contributor
> http://www.openoffice.org
>



-- 
Rajath S,
M.Sc(Hons.) Physics, B.E.(Hons.) Computer Science
Birla Institute of Technology and Science - Pilani,
Pilani

Reply via email to