LibreOffice Module sw (master) 1
Static Public Member Functions | List of all members
SwRDFHelper Class Reference

Provides access to RDF metadata on core objects. More...

#include <rdfhelper.hxx>

Static Public Member Functions

static css::uno::Sequence< css::uno::Reference< css::rdf::XURI > > getGraphNames (const css::uno::Reference< css::rdf::XDocumentMetadataAccess > &xDocumentMetadataAccess, const css::uno::Reference< css::rdf::XURI > &xType)
 Gets all graph-names in RDF of a given type. More...
 
static css::uno::Sequence< css::uno::Reference< css::rdf::XURI > > getGraphNames (const css::uno::Reference< css::frame::XModel > &xModel, const OUString &rType)
 Gets all graph-names in RDF of a given type. More...
 
static std::map< OUString, OUString > getStatements (const css::uno::Reference< css::frame::XModel > &xModel, const css::uno::Sequence< css::uno::Reference< css::rdf::XURI > > &rGraphNames, const css::uno::Reference< css::rdf::XResource > &xSubject)
 Gets all (XResource, key, value) statements in RDF graphs given the graph-names. More...
 
static std::map< OUString, OUString > getStatements (const css::uno::Reference< css::frame::XModel > &xModel, const OUString &rType, const css::uno::Reference< css::rdf::XResource > &xSubject)
 Gets all (XResource, key, value) statements in RDF graphs of type rType. More...
 
static void addStatement (const css::uno::Reference< css::frame::XModel > &xModel, const OUString &rType, const OUString &rPath, const css::uno::Reference< css::rdf::XResource > &xSubject, const OUString &rKey, const OUString &rValue)
 Add an (XResource, key, value) statement in the graph of type rType – or if it does not exist, create a graph at rPath first. More...
 
static bool hasMetadataGraph (const css::uno::Reference< css::frame::XModel > &xModel, const OUString &rType)
 Check if a graph of type rType exists. More...
 
static void removeStatement (const css::uno::Reference< css::frame::XModel > &xModel, const OUString &rType, const css::uno::Reference< css::rdf::XResource > &xSubject, const OUString &rKey, const OUString &rValue)
 Remove an (XResource, key, value) statement in the graph of type rType, if it exists. More...
 
static void cloneStatements (const css::uno::Reference< css::frame::XModel > &xSrcModel, const css::uno::Reference< css::frame::XModel > &xDstModel, const OUString &rType, const css::uno::Reference< css::rdf::XResource > &xSrcSubject, const css::uno::Reference< css::rdf::XResource > &xDstSubject)
 Clone all statements in the graph of type rType, if any exists, from one subject to another. More...
 
static void clearStatements (const css::uno::Reference< css::frame::XModel > &xModel, const OUString &rType, const css::uno::Reference< css::rdf::XResource > &xSubject)
 Remove all statements in the graph of type rType, if any exists. More...
 
static std::map< OUString, OUString > getTextNodeStatements (const OUString &rType, SwTextNode &rTextNode)
 Gets all (rTextNode, key, value) statements in RDF graphs of type rType. More...
 
static void addTextNodeStatement (const OUString &rType, const OUString &rPath, SwTextNode &rTextNode, const OUString &rKey, const OUString &rValue)
 Add an (rTextNode, key, value) statement in the graph of type rType – or if it does not exist, create a graph at rPath first. More...
 
static void removeTextNodeStatement (const OUString &rType, SwTextNode &rTextNode, const OUString &rKey, const OUString &rValue)
 Remove an (rTextNode, key, value) statement in the graph of type rType. More...
 
static void updateTextNodeStatement (const OUString &rType, const OUString &rPath, SwTextNode &rTextNode, const OUString &rKey, const OUString &rOldValue, const OUString &rNewValue)
 Update an (rTextNode, key, value) statement in the graph of type rType from old value to new. Creates the graph at rPath if doesn't exist. More...
 

Detailed Description

Provides access to RDF metadata on core objects.

Definition at line 36 of file rdfhelper.hxx.

Member Function Documentation

◆ addStatement()

void SwRDFHelper::addStatement ( const css::uno::Reference< css::frame::XModel > &  xModel,
const OUString &  rType,
const OUString &  rPath,
const css::uno::Reference< css::rdf::XResource > &  xSubject,
const OUString &  rKey,
const OUString &  rValue 
)
static

Add an (XResource, key, value) statement in the graph of type rType – or if it does not exist, create a graph at rPath first.

Definition at line 100 of file rdfhelper.cxx.

References getGraphNames(), comphelper::getProcessComponentContext(), and xModel.

Referenced by addTextNodeStatement(), cloneStatements(), lcl_ApplyParagraphClassification(), and SwEditShell::RestoreMetadataFieldsAndValidateParagraphSignatures().

◆ addTextNodeStatement()

void SwRDFHelper::addTextNodeStatement ( const OUString &  rType,
const OUString &  rPath,
SwTextNode rTextNode,
const OUString &  rKey,
const OUString &  rValue 
)
static

Add an (rTextNode, key, value) statement in the graph of type rType – or if it does not exist, create a graph at rPath first.

Definition at line 208 of file rdfhelper.cxx.

References addStatement(), SwXParagraph::CreateXParagraph(), SfxObjectShell::GetBaseModel(), SwNode::GetDoc(), and SwDoc::GetDocShell().

Referenced by SwFltControlStack::SetAttrInDoc().

◆ clearStatements()

void SwRDFHelper::clearStatements ( const css::uno::Reference< css::frame::XModel > &  xModel,
const OUString &  rType,
const css::uno::Reference< css::rdf::XResource > &  xSubject 
)
static

Remove all statements in the graph of type rType, if any exists.

Definition at line 149 of file rdfhelper.cxx.

References getGraphNames(), comphelper::getProcessComponentContext(), and xModel.

Referenced by SwTextNode::DestroyAttr().

◆ cloneStatements()

void SwRDFHelper::cloneStatements ( const css::uno::Reference< css::frame::XModel > &  xSrcModel,
const css::uno::Reference< css::frame::XModel > &  xDstModel,
const OUString &  rType,
const css::uno::Reference< css::rdf::XResource > &  xSrcSubject,
const css::uno::Reference< css::rdf::XResource > &  xDstSubject 
)
static

Clone all statements in the graph of type rType, if any exists, from one subject to another.

Definition at line 174 of file rdfhelper.cxx.

References addStatement(), getGraphNames(), and comphelper::getProcessComponentContext().

◆ getGraphNames() [1/2]

css::uno::Sequence< uno::Reference< css::rdf::XURI > > SwRDFHelper::getGraphNames ( const css::uno::Reference< css::frame::XModel > &  xModel,
const OUString &  rType 
)
static

Gets all graph-names in RDF of a given type.

Definition at line 42 of file rdfhelper.cxx.

References getGraphNames(), comphelper::getProcessComponentContext(), and xModel.

◆ getGraphNames() [2/2]

static css::uno::Sequence< css::uno::Reference< css::rdf::XURI > > SwRDFHelper::getGraphNames ( const css::uno::Reference< css::rdf::XDocumentMetadataAccess > &  xDocumentMetadataAccess,
const css::uno::Reference< css::rdf::XURI > &  xType 
)
static

◆ getStatements() [1/2]

static std::map< OUString, OUString > SwRDFHelper::getStatements ( const css::uno::Reference< css::frame::XModel > &  xModel,
const css::uno::Sequence< css::uno::Reference< css::rdf::XURI > > &  rGraphNames,
const css::uno::Reference< css::rdf::XResource > &  xSubject 
)
static

Gets all (XResource, key, value) statements in RDF graphs given the graph-names.

Referenced by getStatements(), getTextNodeStatements(), sw::sidebar::MetadataToTreeNode(), and SwEditShell::RestoreMetadataFieldsAndValidateParagraphSignatures().

◆ getStatements() [2/2]

std::map< OUString, OUString > SwRDFHelper::getStatements ( const css::uno::Reference< css::frame::XModel > &  xModel,
const OUString &  rType,
const css::uno::Reference< css::rdf::XResource > &  xSubject 
)
static

Gets all (XResource, key, value) statements in RDF graphs of type rType.

Definition at line 93 of file rdfhelper.cxx.

References getGraphNames(), getStatements(), and xModel.

◆ getTextNodeStatements()

std::map< OUString, OUString > SwRDFHelper::getTextNodeStatements ( const OUString &  rType,
SwTextNode rTextNode 
)
static

Gets all (rTextNode, key, value) statements in RDF graphs of type rType.

Definition at line 202 of file rdfhelper.cxx.

References SwXParagraph::CreateXParagraph(), SfxObjectShell::GetBaseModel(), SwNode::GetDoc(), SwDoc::GetDocShell(), and getStatements().

Referenced by WW8Export::AppendSmartTags(), and DocxAttributeOutput::EndParagraphProperties().

◆ hasMetadataGraph()

bool SwRDFHelper::hasMetadataGraph ( const css::uno::Reference< css::frame::XModel > &  xModel,
const OUString &  rType 
)
static

Check if a graph of type rType exists.

Definition at line 123 of file rdfhelper.cxx.

References getGraphNames(), comphelper::getProcessComponentContext(), and xModel.

Referenced by SwEditShell::ClassifyDocPerHighestParagraphClass().

◆ removeStatement()

void SwRDFHelper::removeStatement ( const css::uno::Reference< css::frame::XModel > &  xModel,
const OUString &  rType,
const css::uno::Reference< css::rdf::XResource > &  xSubject,
const OUString &  rKey,
const OUString &  rValue 
)
static

Remove an (XResource, key, value) statement in the graph of type rType, if it exists.

Definition at line 131 of file rdfhelper.cxx.

References getGraphNames(), comphelper::getProcessComponentContext(), and xModel.

Referenced by lcl_ApplyParagraphClassification().

◆ removeTextNodeStatement()

void SwRDFHelper::removeTextNodeStatement ( const OUString &  rType,
SwTextNode rTextNode,
const OUString &  rKey,
const OUString &  rValue 
)
static

Remove an (rTextNode, key, value) statement in the graph of type rType.

Definition at line 214 of file rdfhelper.cxx.

References SwXParagraph::CreateXParagraph(), SfxObjectShell::GetBaseModel(), SwNode::GetDoc(), SwDoc::GetDocShell(), getGraphNames(), and comphelper::getProcessComponentContext().

◆ updateTextNodeStatement()

void SwRDFHelper::updateTextNodeStatement ( const OUString &  rType,
const OUString &  rPath,
SwTextNode rTextNode,
const OUString &  rKey,
const OUString &  rOldValue,
const OUString &  rNewValue 
)
static

Update an (rTextNode, key, value) statement in the graph of type rType from old value to new. Creates the graph at rPath if doesn't exist.

Definition at line 231 of file rdfhelper.cxx.

References SwXParagraph::CreateXParagraph(), SfxObjectShell::GetBaseModel(), SwNode::GetDoc(), SwDoc::GetDocShell(), getGraphNames(), and comphelper::getProcessComponentContext().


The documentation for this class was generated from the following files: