main/sfx2/source/doc/DocumentMetadataAccess.cxx
/** actually write a metadata file to the storage */
actually write a metadata file to the storage
actually write a metadata file to the storage
static void
exportStream(struct DocumentMetadataAccess_Impl & i_rImpl,
    uno::Reference< embed::XStorage > const & i_xStorage,
    uno::Reference<rdf::XURI> const & i_xGraphName,
    ::rtl::OUString const & i_rFileName,
    ::rtl::OUString const & i_rBaseURI)
{
    const uno::Reference<io::XStream> xStream(
        i_xStorage->openStreamElement(i_rFileName,
            embed::ElementModes::WRITE | embed::ElementModes::TRUNCATE),
        uno::UNO_SET_THROW);
    const uno::Reference< beans::XPropertySet > xStreamProps(xStream,
        uno::UNO_QUERY);
    if (xStreamProps.is()) { 
        xStreamProps->setPropertyValue(
            ::rtl::OUString::createFromAscii("MediaType"),
            uno::makeAny(::rtl::OUString::createFromAscii(s_rdfxml)));
    }
    const uno::Reference<io::XOutputStream> xOutStream(
        xStream->getOutputStream(), uno::UNO_SET_THROW );
    const uno::Reference<rdf::XURI> xBaseURI(
        rdf::URI::create(i_rImpl.m_xContext, i_rBaseURI));
    i_rImpl.m_xRepository->exportGraph(rdf::FileFormat::RDF_XML,
        xOutStream, i_xGraphName, xBaseURI);
}
static void exportStream ( struct DocumentMetadataAccess_Impl & i_rImpl , uno :: Reference < embed :: XStorage > const & i_xStorage , uno :: Reference < rdf :: XURI > const & i_xGraphName , :: rtl :: OUString const & i_rFileName , :: rtl :: OUString const & i_rBaseURI ) { const uno :: Reference < io :: XStream > xStream ( i_xStorage -> openStreamElement ( i_rFileName , embed :: ElementModes :: WRITE | embed :: ElementModes :: TRUNCATE ) , uno :: UNO_SET_THROW ) ; const uno :: Reference < beans :: XPropertySet > xStreamProps ( xStream , uno :: UNO_QUERY ) ; if ( xStreamProps . is ( ) ) { xStreamProps -> setPropertyValue ( :: rtl :: OUString :: createFromAscii ( " " ) , uno :: makeAny ( :: rtl :: OUString :: createFromAscii ( s_rdfxml ) ) ) ; } const uno :: Reference < io :: XOutputStream > xOutStream ( xStream -> getOutputStream ( ) , uno :: UNO_SET_THROW ) ; const uno :: Reference < rdf :: XURI > xBaseURI ( rdf :: URI :: create ( i_rImpl . m_xContext , i_rBaseURI ) ) ; i_rImpl . m_xRepository -> exportGraph ( rdf :: FileFormat :: RDF_XML , xOutStream , i_xGraphName , xBaseURI ) ; }
actually write a metadata file to the storage
actually write a metadata file to the storage
// this is NOT supported in FileSystemStorage