[dev] Re: XTextSection set background image API Changes ?
2011/3/10 Jürgen Schmidt : >> Indeed It was the URL -- odd thing is I have been using such >> (file:/home/user ) URIs since OOo 2.4 -- > it worked by luck and it seems that somebody have correct the code or > used some other underlying stuff that is less tolerant. > > The url syntax was and is wrong and you should use correct urls ;-) Okay -- thanks for the feedback... I will make the change as suggested. Odd thing is the JRE returns file URLs as file:/ (i.e. without the authority ) -- - To unsubscribe send email to dev-unsubscr...@openoffice.org For additional commands send email to sy...@openoffice.org with Subject: help
[dev] Re: XTextSection set background image API Changes ?
On Wed, Mar 9, 2011 at 5:47 PM, Michael Stahl wrote: >> (xSectionProps is the XPropertySet of a XTextSection ) >> >> Object bitmapTable = >> createInstance("com.sun.star.drawing.BitmapTable"); >> XNameContainer nameContainer = ooQueryInterface.XNameContainer(bitmapTable); >> String graphicName = "section-background" >> nameContainer.insertByName(graphicName, "file:/home/user/file.png"); > > i guess this should be "file:///home/user/file.png", right? > does that work? > Thanks ... Indeed It was the URL -- odd thing is I have been using such (file:/home/user ) URIs since OOo 2.4 -- So 00 I have 2 instances of the same code ... One has OOo 3.1 -- and it works with file:/home/user ... Same code on OOo 3.3 -- and it works only with file:/// protocol URLs e.g. file:///home/user -- - To unsubscribe send email to dev-unsubscr...@openoffice.org For additional commands send email to sy...@openoffice.org with Subject: help
[dev] XTextSection set background image API Changes ?
I was setting the background image as follows : (xSectionProps is the XPropertySet of a XTextSection ) Object bitmapTable = createInstance("com.sun.star.drawing.BitmapTable"); XNameContainer nameContainer = ooQueryInterface.XNameContainer(bitmapTable); String graphicName = "section-background" nameContainer.insertByName(graphicName, "file:/home/user/file.png"); graphicURL = (String) nameContainer.getByName(graphicName); xSectionProps.setPropertyValue("BackGraphic", graphicURL); xSectionProps.setPropertyValue("BackGraphicFilter", "PNG - Portable Network Graphic"); xSectionProps.setPropertyValue("BackGraphicLocation", com.sun.star.style.GraphicLocation.TILED); But this does not seem to work in OOo 3.3 ? Whats the way to set the background image of a section now ? thanks Ashok -- - To unsubscribe send email to dev-unsubscr...@openoffice.org For additional commands send email to sy...@openoffice.org with Subject: help
[dev] Re: RDF metadata, unable to read ?
I think i found a bug in the rdf implementation -- the problem seems to manifest if i give a particular kind of URI -- If i use this format "http://www.xyz.org/1.0"; as the URI for the rdf graph while saving : Dim uriAnx uriAnx = UriService.create("http://editor.bungeni.org/1.0"; ) Dim rdfMetafile rdfMetafile = odoc.addMetadataFile("meta/meta.rdf", Array(uriAnx)) In the above case the URI namespace is not recorded in manifest.rdf. If i use this format "http://www.xyz.org/1.0/abc"; as the URI for the rdf graph while saving : Dim uriAnx uriAnx = UriService.create("http://editor.bungeni.org/1.0/anx"; ) Dim rdfMetafile rdfMetafile = odoc.addMetadataFile("meta/meta.rdf", Array(uriAnx)) It works fine and I am able to browse the graph names in the repository. In this case the URI namespace is recorded in manifest.rdf Is this a bug or valid behavior ? The documentation is a bit ambiguous on this <http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/OfficeDev/RDF_metadata#Vocabulary> On Thu, Feb 10, 2011 at 6:03 PM, underscore wrote: > I have a ODF document where I have applied RDF metadata (using the UNO > API) to a textsection which looks like this : > > (met/meta.rdf) > > http://www.w3.org/1999/02/22-rdf-syntax-ns#";> > > xmlns:ns1="http://anx.bungeni.org/1.0/";>Clause > xmlns:ns2="http://anx.bungeni.org/1.0/";>1723-18388-38383-38383 > > > > I am unable to read it back -- > > e.g. [1] > > > Dim rdfRepo > rdfRepo = thisComponent.getRDFRepository() > Dim arrGraphs > arrGraphs = rdfRepo.getGraphNames() > > > > In the above case ... getGraphNames() always returns an empty array ! > > e.g. [2] > > Dim uriAnx > uriAnx = UriService.create("http://anx.bungeni.org/1.0"; ) > Dim uriGraphs > uriGraphs = thisComponent.getMetadataGraphsWithType(uriAnx) > > > In the above case too getMetadataGraphsWithType() returns a empty > array ...but the document has the metadata. > > What am i doing wrong ? Is this not the way to retrieve the metadata graph ? > > Just for reference -- this is what the manifest.rdf looks like > > > http://www.w3.org/1999/02/22-rdf-syntax-ns#";> > xmlns:ns1="http://docs.oasis-open.org/ns/office/1.2/meta/pkg#"; > rdf:about=""> > > > > > xmlns:ns2="http://docs.oasis-open.org/ns/office/1.2/meta/odf#"; > rdf:about="styles.xml"/> > xmlns:ns3="http://docs.oasis-open.org/ns/office/1.2/meta/odf#"; > rdf:about="content.xml"/> > > - To unsubscribe, e-mail: dev-unsubscr...@openoffice.org For additional commands, e-mail: dev-h...@openoffice.org
[dev] RDF metadata, unable to read ?
I have a ODF document where I have applied RDF metadata (using the UNO API) to a textsection which looks like this : (met/meta.rdf) http://www.w3.org/1999/02/22-rdf-syntax-ns#";> http://anx.bungeni.org/1.0/";>Clause http://anx.bungeni.org/1.0/";>1723-18388-38383-38383 I am unable to read it back -- e.g. [1] Dim rdfRepo rdfRepo = thisComponent.getRDFRepository() Dim arrGraphs arrGraphs = rdfRepo.getGraphNames() In the above case ... getGraphNames() always returns an empty array ! e.g. [2] Dim uriAnx uriAnx = UriService.create("http://anx.bungeni.org/1.0"; ) Dim uriGraphs uriGraphs = thisComponent.getMetadataGraphsWithType(uriAnx) In the above case too getMetadataGraphsWithType() returns a empty array ...but the document has the metadata. What am i doing wrong ? Is this not the way to retrieve the metadata graph ? Just for reference -- this is what the manifest.rdf looks like http://www.w3.org/1999/02/22-rdf-syntax-ns#";> http://docs.oasis-open.org/ns/office/1.2/meta/pkg#"; rdf:about=""> http://docs.oasis-open.org/ns/office/1.2/meta/odf#"; rdf:about="styles.xml"/> http://docs.oasis-open.org/ns/office/1.2/meta/odf#"; rdf:about="content.xml"/> - To unsubscribe, e-mail: dev-unsubscr...@openoffice.org For additional commands, e-mail: dev-h...@openoffice.org
Re: [dev] RDF metadata issue
On Wed, Feb 9, 2011 at 7:37 PM, Niklas Nebel wrote: > > Why do you want it to look like that? The first example should look the same > to any well-behaved tool. > I was wondering just for aesthetics ... it works fine as is ... thanks Ashok - To unsubscribe, e-mail: dev-unsubscr...@openoffice.org For additional commands, e-mail: dev-h...@openoffice.org
[dev] RDF metadata issue
I am trying to attach some custom RDF metadata to a TextSection... here is a snippet of code that I use to attach the RDF metadata : Dim odoc odoc = thisComponent Dim osection osection = odoc.getTextSections().getByName("Section1") Dim docText docText= odoc.getText() UriService = com.sun.star.rdf.URI UriSService = com.sun.star.rdf.URIs LiteralService = com.sun.star.rdf.Literal Dim uriAnx uriAnx = UriService.create("http://editor.bungeni.org/anx"; ) Dim rdfMetafile rdfMetafile = odoc.addMetadataFile("meta/meta.rdf", Array(uriAnx)) Dim rdfGraph rdfGraph = odoc.getRDFRepository().getGraph(rdfMetafile) Dim uriSecType, litSecType uriSecType = UriService.create("http://editor.bungeni.org/anx/sectionType";) litSecType = LiteralService.create("Clause") rdfGraph.addStatement(osection, uriSecType, litSecType) Dim uriSecUUID, litSecUUID uriSecUUID = UriService.create("http://editor.bungeni.org/anx/sectionUUID";) litSecUUID = LiteralService.create("1723-18388-38383-38383") rdfGraph.addStatement(osection, uriSecUUID, litSecUUID) The problem is that the metadata looks like this : http://www.w3.org/1999/02/22-rdf-syntax-ns#";> http://editor.bungeni.org/anx/";>Clause http://editor.bungeni.org/anx/";>1723-18388-38383-38383 Notice how the ns1 and ns2 namespace prefixes are duplicated But i want it to look like this -- http://www.w3.org/1999/02/22-rdf-syntax-ns#";> http://editor.bungeni.org/anx"; > Clause 1723-18388-38383-38383 How do i do this ? ... I tried using various combinations using createNS() instead of create() but couldnt get it to look like this Ashok - To unsubscribe, e-mail: dev-unsubscr...@openoffice.org For additional commands, e-mail: dev-h...@openoffice.org