Bug 163309 - RDF metadata visualization: show rdf:type content of bookmark metadata optionally
Summary: RDF metadata visualization: show rdf:type content of bookmark metadata option...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard: target:25.2.0
Keywords:
Depends on:
Blocks: Bookmarks
  Show dependency treegraph
 
Reported: 2024-10-05 11:24 UTC by László Németh
Modified: 2024-10-05 14:21 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
test document with rdf:type bookmark metadata (15.24 KB, application/vnd.oasis.opendocument.text)
2024-10-05 11:40 UTC, László Németh
Details
screenshot of the visualization (27.55 KB, image/png)
2024-10-05 14:03 UTC, László Németh
Details
alternative patch with RDF prefix/suffix (tag-like) implementation (14.23 KB, patch)
2024-10-05 14:10 UTC, László Németh
Details

Note You need to log in before you can comment on or make changes to this bug.
Description László Németh 2024-10-05 11:24:38 UTC
Description:
OOo's RDF handling had limited support to optional metadata visualization, like custom prefix/suffix of metadata fields. Add a similar solution for bookmark rdf:type metadata.

Steps to Reproduce:
1. Open the attached test document.

Actual Results:
Only colored bookmark boundary marks based on bookmark metadata, enabling View->Field Shading

Expected Results:
Showing rdf:type content "Chapter" of the bookmark metadata


Reproducible: Always


User Profile Reset: No

Additional Info:
Follow-up of Bug 150717
Comment 1 László Németh 2024-10-05 11:40:41 UTC
Created attachment 196904 [details]
test document with rdf:type bookmark metadata
Comment 2 László Németh 2024-10-05 14:03:54 UTC
Created attachment 196908 [details]
screenshot of the visualization
Comment 3 László Németh 2024-10-05 14:10:15 UTC
Created attachment 196909 [details]
alternative patch with RDF prefix/suffix (tag-like) implementation

Abandoned because of line ending problems, only for possible future developments...

Subject: [PATCH] add RDF visualization for bookmarks with

rdf:type RDF metadata, showing rdf:type content
as markup around the bookmark with RDF metadata:

[tag]bookmark[/tag]

The patch uses zero-length SwFieldPortions (no associated
character in the text), but this is very fragile with line ends,
see suffix of meta-field/TryNewLengthPortion/SetNoLength
for possible clean-up.

Note: the order/indices are bad: sPrefix and sSuffix comes after it.first->GetName(). Also the recent master needs

+        rtl::Reference<SwXTextDocument> xModel = rDoc.GetDocShell()->GetBaseModel();
...
+        uno::Reference<rdf::XDocumentMetadataAccess> xDocumentMetadataAccess(
+            rDoc.GetDocShell()->GetBaseModel());
Comment 4 Commit Notification 2024-10-05 14:21:37 UTC
László Németh committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/3393e52be0900ad63ceee0a43cd44d473ec8248a

tdf#163309 sw: show rdf:type as labels on bookmark boundary marks

It will be available in 25.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.