From 3747e59f8cf5d93ee18cf4e0c9fd518ed09361fd Mon Sep 17 00:00:00 2001 From: Jon Phillips Date: Tue, 14 Aug 2007 07:22:11 +0000 Subject: Applied patches for default metadata and for fix on creative commons namespace. (bzr r3464) --- src/dialogs/rdf.cpp | 120 ++++++++++++++++++++++++++++++---------------------- 1 file changed, 69 insertions(+), 51 deletions(-) (limited to 'src/dialogs') diff --git a/src/dialogs/rdf.cpp b/src/dialogs/rdf.cpp index a145e0834..cf3cd581f 100644 --- a/src/dialogs/rdf.cpp +++ b/src/dialogs/rdf.cpp @@ -23,12 +23,13 @@ #include "xml/repr.h" #include "rdf.h" #include "sp-item-group.h" +#include "prefs-utils.h" /* Example RDF XML from various places... - @@ -48,7 +49,7 @@ - @@ -57,13 +58,13 @@ John Cliff - + - - - - + + + + @@ -91,76 +92,76 @@ struct rdf_double_t rdf_license_empty [] = { }; struct rdf_double_t rdf_license_cc_a [] = { - { "cc:permits", "http://web.resource.org/cc/Reproduction", }, - { "cc:permits", "http://web.resource.org/cc/Distribution", }, - { "cc:requires", "http://web.resource.org/cc/Notice", }, - { "cc:requires", "http://web.resource.org/cc/Attribution", }, - { "cc:permits", "http://web.resource.org/cc/DerivativeWorks", }, + { "cc:permits", "http://creativecommons.org/ns#Reproduction", }, + { "cc:permits", "http://creativecommons.org/ns#Distribution", }, + { "cc:requires", "http://creativecommons.org/ns#Notice", }, + { "cc:requires", "http://creativecommons.org/ns#Attribution", }, + { "cc:permits", "http://creativecommons.org/ns#DerivativeWorks", }, { NULL, NULL } }; struct rdf_double_t rdf_license_cc_a_sa [] = { - { "cc:permits", "http://web.resource.org/cc/Reproduction", }, - { "cc:permits", "http://web.resource.org/cc/Distribution", }, - { "cc:requires", "http://web.resource.org/cc/Notice", }, - { "cc:requires", "http://web.resource.org/cc/Attribution", }, - { "cc:permits", "http://web.resource.org/cc/DerivativeWorks", }, - { "cc:requires", "http://web.resource.org/cc/ShareAlike", }, + { "cc:permits", "http://creativecommons.org/ns#Reproduction", }, + { "cc:permits", "http://creativecommons.org/ns#Distribution", }, + { "cc:requires", "http://creativecommons.org/ns#Notice", }, + { "cc:requires", "http://creativecommons.org/ns#Attribution", }, + { "cc:permits", "http://creativecommons.org/ns#DerivativeWorks", }, + { "cc:requires", "http://creativecommons.org/ns#ShareAlike", }, { NULL, NULL } }; struct rdf_double_t rdf_license_cc_a_nd [] = { - { "cc:permits", "http://web.resource.org/cc/Reproduction", }, - { "cc:permits", "http://web.resource.org/cc/Distribution", }, - { "cc:requires", "http://web.resource.org/cc/Notice", }, - { "cc:requires", "http://web.resource.org/cc/Attribution", }, + { "cc:permits", "http://creativecommons.org/ns#Reproduction", }, + { "cc:permits", "http://creativecommons.org/ns#Distribution", }, + { "cc:requires", "http://creativecommons.org/ns#Notice", }, + { "cc:requires", "http://creativecommons.org/ns#Attribution", }, { NULL, NULL } }; struct rdf_double_t rdf_license_cc_a_nc [] = { - { "cc:permits", "http://web.resource.org/cc/Reproduction", }, - { "cc:permits", "http://web.resource.org/cc/Distribution", }, - { "cc:requires", "http://web.resource.org/cc/Notice", }, - { "cc:requires", "http://web.resource.org/cc/Attribution", }, - { "cc:prohibits", "http://web.resource.org/cc/CommercialUse", }, - { "cc:permits", "http://web.resource.org/cc/DerivativeWorks", }, + { "cc:permits", "http://creativecommons.org/ns#Reproduction", }, + { "cc:permits", "http://creativecommons.org/ns#Distribution", }, + { "cc:requires", "http://creativecommons.org/ns#Notice", }, + { "cc:requires", "http://creativecommons.org/ns#Attribution", }, + { "cc:prohibits", "http://creativecommons.org/ns#CommercialUse", }, + { "cc:permits", "http://creativecommons.org/ns#DerivativeWorks", }, { NULL, NULL } }; struct rdf_double_t rdf_license_cc_a_nc_sa [] = { - { "cc:permits", "http://web.resource.org/cc/Reproduction", }, - { "cc:permits", "http://web.resource.org/cc/Distribution", }, - { "cc:requires", "http://web.resource.org/cc/Notice", }, - { "cc:requires", "http://web.resource.org/cc/Attribution", }, - { "cc:prohibits", "http://web.resource.org/cc/CommercialUse", }, - { "cc:permits", "http://web.resource.org/cc/DerivativeWorks", }, - { "cc:requires", "http://web.resource.org/cc/ShareAlike", }, + { "cc:permits", "http://creativecommons.org/ns#Reproduction", }, + { "cc:permits", "http://creativecommons.org/ns#Distribution", }, + { "cc:requires", "http://creativecommons.org/ns#Notice", }, + { "cc:requires", "http://creativecommons.org/ns#Attribution", }, + { "cc:prohibits", "http://creativecommons.org/ns#CommercialUse", }, + { "cc:permits", "http://creativecommons.org/ns#DerivativeWorks", }, + { "cc:requires", "http://creativecommons.org/ns#ShareAlike", }, { NULL, NULL } }; struct rdf_double_t rdf_license_cc_a_nc_nd [] = { - { "cc:permits", "http://web.resource.org/cc/Reproduction", }, - { "cc:permits", "http://web.resource.org/cc/Distribution", }, - { "cc:requires", "http://web.resource.org/cc/Notice", }, - { "cc:requires", "http://web.resource.org/cc/Attribution", }, - { "cc:prohibits", "http://web.resource.org/cc/CommercialUse", }, + { "cc:permits", "http://creativecommons.org/ns#Reproduction", }, + { "cc:permits", "http://creativecommons.org/ns#Distribution", }, + { "cc:requires", "http://creativecommons.org/ns#Notice", }, + { "cc:requires", "http://creativecommons.org/ns#Attribution", }, + { "cc:prohibits", "http://creativecommons.org/ns#CommercialUse", }, { NULL, NULL } }; struct rdf_double_t rdf_license_pd [] = { - { "cc:permits", "http://web.resource.org/cc/Reproduction", }, - { "cc:permits", "http://web.resource.org/cc/Distribution", }, - { "cc:permits", "http://web.resource.org/cc/DerivativeWorks", }, + { "cc:permits", "http://creativecommons.org/ns#Reproduction", }, + { "cc:permits", "http://creativecommons.org/ns#Distribution", }, + { "cc:permits", "http://creativecommons.org/ns#DerivativeWorks", }, { NULL, NULL } }; struct rdf_double_t rdf_license_freeart [] = { - { "cc:permits", "http://web.resource.org/cc/Reproduction", }, - { "cc:permits", "http://web.resource.org/cc/Distribution", }, - { "cc:permits", "http://web.resource.org/cc/DerivativeWorks", }, - { "cc:requires", "http://web.resource.org/cc/ShareAlike", }, - { "cc:requires", "http://web.resource.org/cc/Notice", }, - { "cc:requires", "http://web.resource.org/cc/Attribution", }, + { "cc:permits", "http://creativecommons.org/ns#Reproduction", }, + { "cc:permits", "http://creativecommons.org/ns#Distribution", }, + { "cc:permits", "http://creativecommons.org/ns#DerivativeWorks", }, + { "cc:requires", "http://creativecommons.org/ns#ShareAlike", }, + { "cc:requires", "http://creativecommons.org/ns#Notice", }, + { "cc:requires", "http://creativecommons.org/ns#Attribution", }, { NULL, NULL } }; @@ -339,7 +340,7 @@ rdf_string(struct rdf_t * rdf) gchar *string=NULL; gchar *rdf_head="\ -\ "; @@ -976,6 +977,20 @@ struct rdf_entity_default_t { struct rdf_entity_default_t rdf_defaults[] = { { "format", "image/svg+xml", }, { "type", "http://purl.org/dc/dcmitype/StillImage", }, + { "title", "", }, + { "date", "", }, + { "creator", "", }, + { "rights", "", }, + { "publisher", "", }, + { "identifier", "", }, + { "source", "", }, + { "relation", "", }, + { "language", "", }, + { "subject", "", }, + { "coverage", "", }, + { "description", "", }, + { "contributor", "", }, + { "license_uri", "", }, { NULL, NULL, } }; @@ -1004,8 +1019,11 @@ rdf_set_defaults ( SPDocument * doc ) struct rdf_work_entity_t * entity = rdf_find_entity ( rdf_default->name ); g_assert ( entity != NULL ); + //get default matedata defined by user preferences + const gchar * text = prefs_get_string_attribute ("options.defaultmetadata", rdf_default->name); + if ( rdf_get_work_entity ( doc, entity ) == NULL ) { - rdf_set_work_entity ( doc, entity, rdf_default->text ); + rdf_set_work_entity ( doc, entity, text ? text : rdf_default->text ); } } } -- cgit v1.2.3