You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openoffice.apache.org by Rajath Shashidhara <ra...@gmail.com> on 2013/06/16 09:37:00 UTC

MIMEType of folder

Hello,

When requested for MIMEType/ContentType for a folder, what should be the
result?


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

RE: MIMEType of folder

Posted by "Dennis E. Hamilton" <de...@acm.org>.
If you are talking about content items within an ODF Package, whether a path is considered that of a folder is determined in the ODF Package manifest.xml file.  The manifest.xml file will specify the MIME TYPE of the collection of items having the same path in the beginning of their file names when that collection has significance taken as a unit (more than just sharing a common prefix on their names).  

*** If you are not asking about that case, you can stop here ***

TMI;DNR

Some implementations create manifest.xml file entries for folders for no particular purpose (the MIME TYPE is not set).  These are unnecessary.  There is no requirement to have every path segment reflected in the manifest.  Only those that prefix a collection of items where the collection has a specific MIME type need to be distinguished.  The MIMETYPE indicates what is special about items in that particular collection other than their names having a common prefix of "/"-separated parts.

"Folders" have MIMETYPE entries, for example, when the items of another ODF document are embedded in another ODF document instead of embedding the other document's package as a single item.  The common prefix on the Zip file names of those embedded items will have an entry that provides the ODF MIMETYPE for the embedded document.  Actual files embedded in the ODF package, including another ODF package as a single file are required to have entries in manifest.xml that gives their MIMETYPEs.  

You might need to experiment to see if the Apache OpenOffice SDK or source-code objects you are using return a default MIMETYPE for manifest entries having no specified MIMETYPE and whether it will do that even for paths used in the filenames and not identified in the manifest.  I suspect that happens if the API you are using provides navigation of the package as if it is a hierarchical collection of folders.  This is a synthesis.  The files in the Zip have no hierarchical organization, although the contained files can have names of a hierarchical form, often for conceptual convenience and as a way to keep names separated into useful non-conflicting categories, such as "META-INF/...", "Configurations2/...", etc.  

Please note that this narrative is from the perspective of the ODF specifications, not incidentals of implementations, even though those incidentals matter if you encounter them in the API or object model of Apache OpenOffice.

 - Dennis

-----Original Message-----
From: Rajath Shashidhara [mailto:rajaths.rajaths@gmail.com] 
Sent: Sunday, June 16, 2013 02:38 AM
To: dev
Subject: Re: MIMEType of folder

Hello,
description of getContentType():
returns a type string, which is unique for that type of content (e.g.
"application/vnd.sun.star.hierarchy-folder").

is a folder's unique content type application/vnd.sun.star.hierarchy-folder?


On Sun, Jun 16, 2013 at 1:07 PM, Rajath Shashidhara <
rajaths.rajaths@gmail.com> wrote:

> Hello,
>
> When requested for MIMEType/ContentType for a folder, what should be the
> result?
>
>
> --
> Rajath S,
> M.Sc(Hons.) Physics,
> Birla Institute of Technology and Science - Pilani,
> Pilani
>



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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@openoffice.apache.org
For additional commands, e-mail: dev-help@openoffice.apache.org


Re: MIMEType of folder

Posted by Rajath Shashidhara <ra...@gmail.com>.
Hello,
description of getContentType():
returns a type string, which is unique for that type of content (e.g.
"application/vnd.sun.star.hierarchy-folder").

is a folder's unique content type application/vnd.sun.star.hierarchy-folder?


On Sun, Jun 16, 2013 at 1:07 PM, Rajath Shashidhara <
rajaths.rajaths@gmail.com> wrote:

> Hello,
>
> When requested for MIMEType/ContentType for a folder, what should be the
> result?
>
>
> --
> Rajath S,
> M.Sc(Hons.) Physics,
> Birla Institute of Technology and Science - Pilani,
> Pilani
>



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

Re: MIMEType of folder

Posted by Rajath Shashidhara <ra...@gmail.com>.
Hello Ariel,

I'm debugging the client application using breakpoints and step-by-step
execution.
I'm using Log statements in the UNO component.

Is there a way to use stpe-by-step executions for the UNO Component as well?


On Mon, Jun 17, 2013 at 1:28 AM, Rajath Shashidhara <
rajaths.rajaths@gmail.com> wrote:

> Hello Ariel,
>
> I'm debugging with the help of Log Statements.
> Is there any other way?
>
>
> On Mon, Jun 17, 2013 at 12:09 AM, Ariel Constenla-Haile <
> arielch@apache.org> wrote:
>
>> On Sun, Jun 16, 2013 at 11:10:56PM +0530, Rajath Shashidhara wrote:
>> > Hello,
>> >
>> > I created a new UNO project with some modified code and renamed it to
>> > CMISContentProvider and deleted my old project. I created the .oxt for
>> new
>> > project and installed it in the extension manager. But, the error stack
>> > trace printed by my test client application still points to my previous
>> > CMISContentProvider. My stack trace shows error from
>> connectToRepository()
>> > which is not there any more in my new project.
>> >
>> > How do I resolve this?
>>
>> I don't understand what you've done, but it looks like you have the two
>> versions installed at the same time; the obvious: did you restart the
>> application completely? If restarting does not work, remove the user
>> profile with all the extensions.
>>
>> By the way, how are you debugging all this? You should debug both the
>> client application and the UNO component, at the same time.
>>
>>
>> Regards
>> --
>> Ariel Constenla-Haile
>> La Plata, Argentina
>>
>
>
>
> --
> Rajath S,
> M.Sc(Hons.) Physics,
> Birla Institute of Technology and Science - Pilani,
> Pilani
>



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

Re: MIMEType of folder

Posted by Ariel Constenla-Haile <ar...@apache.org>.
On Mon, Jun 17, 2013 at 01:28:03AM +0530, Rajath Shashidhara wrote:
> Hello Ariel,
> 
> I'm debugging with the help of Log Statements.
> Is there any other way?

The proper way is setting break points in the source, watching
variables, etc.

How are you deploying your extension? How are you debugging it?

The task is: inside the same IDE, you have to debug your component once
the extension is installed; and you have to test it with a client
application that you also have to debug.

Right-click on the project root inside NetBeans, the context menu has
some AOO specific options:

a) Debug Extension in target AOO
b) Deploy and Run Extension in AOO

(a) will create a user profile inside the build folder
(build/soffice_debug) that will be removed every time you clean the
project. The extension will be installed for this user profile only.

This has some advantages and some drawbacks, one is that the client
application to test the extension cannot use the simple bootstrap
mechanism because it is likely to boostrap an office with your default
user profile, not this profile inside the build directory of your NB
project.

One possible solution to debug both the extension and the client
application:

- configure the JVM used by AOO to listen for debugger connections, see
  http://wiki.openoffice.org/wiki/Scripting_in_Java_with_NetBeans_IDE#Java_configuration_in_OpenOffice.org_Options_dialog
  (do not use port 8000 as in the example, choose other number like
  9009)
- deploy the extension in your default user profile
- attach the debugger: inside NetBeans, menu Debug - Attach Debugger (see
  http://wiki.openoffice.org/wiki/File:023_attach_debugger_config.png
  but change the port to the one you chose in the step above)
- set break points in the extension/component sources
- set break points in the client application
- Debug the client application Ctr + F5 with the project select

With this steps you should be able to debug the client application and
the UNO component together, while the first uses the second.

Draw back: every time you change your component's sources you should
deploy the extension (and restart the office).


Regards
-- 
Ariel Constenla-Haile
La Plata, Argentina

Re: MIMEType of folder

Posted by Rajath Shashidhara <ra...@gmail.com>.
Hello Ariel,

I'm debugging with the help of Log Statements.
Is there any other way?


On Mon, Jun 17, 2013 at 12:09 AM, Ariel Constenla-Haile
<ar...@apache.org>wrote:

> On Sun, Jun 16, 2013 at 11:10:56PM +0530, Rajath Shashidhara wrote:
> > Hello,
> >
> > I created a new UNO project with some modified code and renamed it to
> > CMISContentProvider and deleted my old project. I created the .oxt for
> new
> > project and installed it in the extension manager. But, the error stack
> > trace printed by my test client application still points to my previous
> > CMISContentProvider. My stack trace shows error from
> connectToRepository()
> > which is not there any more in my new project.
> >
> > How do I resolve this?
>
> I don't understand what you've done, but it looks like you have the two
> versions installed at the same time; the obvious: did you restart the
> application completely? If restarting does not work, remove the user
> profile with all the extensions.
>
> By the way, how are you debugging all this? You should debug both the
> client application and the UNO component, at the same time.
>
>
> Regards
> --
> Ariel Constenla-Haile
> La Plata, Argentina
>



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

Re: MIMEType of folder

Posted by Ariel Constenla-Haile <ar...@apache.org>.
On Sun, Jun 16, 2013 at 11:10:56PM +0530, Rajath Shashidhara wrote:
> Hello,
> 
> I created a new UNO project with some modified code and renamed it to
> CMISContentProvider and deleted my old project. I created the .oxt for new
> project and installed it in the extension manager. But, the error stack
> trace printed by my test client application still points to my previous
> CMISContentProvider. My stack trace shows error from connectToRepository()
> which is not there any more in my new project.
> 
> How do I resolve this?

I don't understand what you've done, but it looks like you have the two
versions installed at the same time; the obvious: did you restart the
application completely? If restarting does not work, remove the user
profile with all the extensions.

By the way, how are you debugging all this? You should debug both the
client application and the UNO component, at the same time.


Regards
-- 
Ariel Constenla-Haile
La Plata, Argentina

Re: MIMEType of folder

Posted by Rajath Shashidhara <ra...@gmail.com>.
Hello,

I created a new UNO project with some modified code and renamed it to
CMISContentProvider and deleted my old project. I created the .oxt for new
project and installed it in the extension manager. But, the error stack
trace printed by my test client application still points to my previous
CMISContentProvider. My stack trace shows error from connectToRepository()
which is not there any more in my new project.

How do I resolve this?

Re: MIMEType of folder

Posted by Ariel Constenla-Haile <ar...@apache.org>.
Hi Rajath,

On Sun, Jun 16, 2013 at 01:07:00PM +0530, Rajath Shashidhara wrote:
> Hello,
> 
> When requested for MIMEType/ContentType for a folder, what should be the
> result?

read the API doc carefully:
http://www.openoffice.org/api/docs/common/ref/com/sun/star/ucb/Content.html
Properties - Mandatory properties - ContentType

"contains a unique type string for the content ( i.e.
"application/vnd.sun.star.hierarchy-link" ).

This property is always read-only.

The ContentType should not be confused with the MIME media type ( MIME
types ) of the content. Media types may be provided through the optional
property "MediaType".

The value of this property should match the information on creatable
contents given by UCB contents that implement the property
"CreatableContentsInfo"."

a) do not confuse ContentType with MediaType (the MIME type)

b) the value of ContentType is up to the implementation, search for
application/ in main/ucb/source/ucp/ to get an idea
http://opengrok.adfinis-sygroup.org/source/search?q=application%2F&path=%2Faoo-trunk%2Fmain%2Fucb%2Fsource%2Fucp%2F&project=aoo-trunk

Something like

application/cmis-content-folder
application/cmis-content-document


Regards
-- 
Ariel Constenla-Haile
La Plata, Argentina