Class: SiSU_JSON_Format::HeadInformation
- Inherits:
-
Object
- Object
- SiSU_JSON_Format::HeadInformation
- Includes:
- SiSU_Parts_JSON
- Defined in:
- lib/sisu/json_format.rb
Instance Method Summary collapse
-
#initialize ⇒ HeadInformation
constructor
dc rdf.
- #meta_content_clean(content = '') ⇒ Object
- #table_close ⇒ Object
- #toc_head ⇒ Object
Methods included from SiSU_Parts_JSON
#the_line_break, #the_table_close, #the_url_decoration, #txt_close, #txt_open, #xml_close, #xml_open
Methods included from SiSU_Parts_Generic
#footer_signature, #home, #home_txt, #i_choice, #i_home_button, #i_ico, #i_new, #rl_root, #root_http, #sisu, #sisu_txt, #sisudoc, #site, #the_icon, #the_text, #the_url, #txt_home, #txt_hp, #txt_hp_alias, #txt_signature, #urify, #url_close, #url_open
Constructor Details
#initialize ⇒ HeadInformation
dc rdf
86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 |
# File 'lib/sisu/json_format.rb', line 86 def initialize #dc rdf @full_title=@subtitle=@author=@subject=@description=@publisher=@contributor=@date=@type=@format=@identifier=@source=@language=@relation=@coverage=@rights=@copyright=@owner=@keywords='' @md=@@md # DublinCore 1 - title @rdfurl=%{ rdf:about="http://www.jus.uio.no/lm/toc"\n} if defined? @md.title.full \ and @md.title.full # DublinCore 1 - title @rdf_title=%{ dc.title="#{seg_name}#{@md.title.full}"\n} @full_title=%{<meta name="dc.title" content="#{seg_name}#{@md.title.full}" />\n} end if defined? @md.creator. \ and @md.creator. # DublinCore 2 - creator/author (author) @rdf_author=%{ dc.author="#{@md.creator.}"\n} @author=%{<meta name="dc.author" content="#{@md.creator.}" />\n} end if defined? @md.classify.subject \ and @md.classify.subject=~/\S+/ # DublinCore 3 - subject (us library of congress, eric or udc, or schema???) @rdf_subject=%{ dc.subject="#{@md.classify.subject}"\n} @subject=%{<meta name="dc.subject" content="#{@md.classify.subject}" />\n} end if defined? @md.notes.description \ and @md.notes.description=~/\S+/ # DublinCore 4 - description @rdf_description=%{ dc.description="#{@md.notes.description}"\n} @description=%{<meta name="dc.description" content="#{@md.notes.description}" />\n} end if defined? @md.publisher \ and @md.publisher=~/\S+/ # DublinCore 5 - publisher (current copy published by) @rdf_publisher=%{ dc.publisher="#{@md.publisher}"\n} @publisher=%{<meta name="dc.publisher" content="#{@md.publisher}" />\n} end if defined? @md.creator.contributor \ and @md.creator.contributor=~/\S+/ # DublinCore 6 - contributor @rdf_contributor=%{ dc.contributor="#{@md.creator.contributor}"\n} @contributor=%{<meta name="dc.contributor" content="#{@md.creator.contributor}" />\n} end if defined? @md.date.published \ and @md.date.published # DublinCore 7 - date year-mm-dd @rdf_date=%{ dc.date="#{@md.date.published}"\n} @date=%{<meta name="dc.date" content="#{@md.date.published}" #{@md.date_scheme} />\n} end if defined? @md.date.created \ and @md.date.created # DublinCore 7 - date.created year-mm-dd @rdf_date_created=%{ dc.date.created="#{@md.date.created}"\n} @date_created=%{<meta name="dc.date.created" content="#{@md.date.created}" #{@md.date_created_scheme} />\n} end if defined? @md.date.issued \ and @md.date.issued # DublinCore 7 - date.issued year-mm-dd @rdf_date_issued=%{ dc.date.issued="#{@md.date.issued}"\n} @date_issued=%{<meta name="dc.date.issued" content="#{@md.date.issued}" #{@md.date_issued_scheme} />\n} end if defined? @md.date.available \ and @md.date.available # DublinCore 7 - date.available year-mm-dd @rdf_date_available=%{ dc.date.available="#{@md.date.available}"\n} @date_available=%{<meta name="dc.date.available" content="#{@md.date.available}" #{@md.date_available_scheme} />\n} end if defined? @md.date.valid \ and @md.date.valid # DublinCore 7 - date.valid year-mm-dd @rdf_date_valid=%{ dc.date.valid="#{@md.date.valid}"\n} @date_valid=%{<meta name="dc.date.valid" content="#{@md.date.valid}" #{@md.date_valid_scheme} />\n} end if defined? @md.date.modified \ and @md.date.modified # DublinCore 7 - date.modified year-mm-dd @rdf_date_modified=%{ dc.date.modified="#{@md.date.modified}"\n} @date_modified=%{<meta name="dc.date.modified" content="#{@md.date.modified}" #{@md.date_modified_scheme} />\n} end if defined? @md.notes.coverage \ and @md.notes.coverage=~/\S+/ # DublinCore 14 - coverage @rdf_coverage=%{ dc.coverage="#{@md.notes.coverage}"\n} @coverage=%{<meta name="dc.coverage" content="#{@md.notes.coverage}" />\n} end if defined? @md.notes.relation \ and @md.notes.relation=~/\S+/ # DublinCore 13 - relation @rdf_relation=%{ dc.relation="#{@md.notes.relation}"\n} @relation=%{<meta name="dc.relation" content="#{@md.notes.relation}" />\n} end if defined? @md.notes.type \ and @md.notes.type # DublinCore 8 - type (genre eg. report, convention etc) @rdf_type=%{ dc.type="#{@md.notes.type}"\n} @type=%{<meta name="dc.type" content="#{@md.notes.type}" />\n} end if defined? @md.notes.format \ and @md.notes.format=~/\S+/ # DublinCore 9 - format (use your mime type) @rdf_format=%{ dc.format="#{@md.notes.format}"\n} @format=%{<meta name="dc.format" content="#{@md.notes.format}" />\n} end #if defined? @md.identifier.sisupod \ #and @md.identifier.sisupod=~/\S+/ # DublinCore 10 - identifier (your identifier, could use urn which is free) # @rdf_identifier=%{ dc.identifier="#{@md.identifier.sisupod}"\n} # @identifier=%{<meta name="dc.identifier" content="#{@md.identifier.sisupod}" />\n} #end if defined? @md.original.source \ and @md.original.source=~/\S+/ # DublinCore 11 - source (document source) @rdf_source=%{ dc.source="#{@md.original.source}"\n} @source=%{<meta name="dc.source" content="#{@md.source}" />\n} end if defined? @md.original.language \ and @md.original.language=~/\S+/ # DublinCore 12 - language (English) @rdf_language=%{ dc.language="#{@md.original.title}"\n} @language=%{<meta name="dc.language" content="#{@md.language[:name]}" />\n} end if defined? @md.rights.all \ and @md.rights.all=~/\S+/ # DublinCore 15 - rights rights=(@md.rights.all) copyright=(@md.rights.copyright.all) @rdf_rights=%{ dc.rights="#{rights}"\n} @rights=%{<meta name="dc.rights" content="#{rights}" />\n} end @copyright=%{<meta name="copyright" content="#{copyright}" />\n} \ if @md.rights.copyright.all # possibly redundant see dc.rights @owner=%{<meta name="owner" content="#{@md.owner}" />\n} if @md.owner @keywords=%{<meta name="keywords" content="#{@md.keywords}" />\n} if @md.keywords @index='index' end |
Instance Method Details
#meta_content_clean(content = '') ⇒ Object
199 200 201 202 203 204 205 206 |
# File 'lib/sisu/json_format.rb', line 199 def (content='') content=if not content.nil? content=content.tr('"',"'"). gsub(/&/,'&') content=SiSU_XML_Munge::Trans.new(@md).char_enc.utf8(content) else content end end |
#table_close ⇒ Object
207 208 209 |
# File 'lib/sisu/json_format.rb', line 207 def table_close '</font> </td></tr></table>' end |
#toc_head ⇒ Object
210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 |
# File 'lib/sisu/json_format.rb', line 210 def toc_head <<WOK <html> <head> <title>#{@md.html_title}</title> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/"> <rdf:Description #{@rdfurl} #{@rdf_title} #{@rdf_subtitle} #{@rdf_author} #{@rdf_subject} #{@rdf_description} #{@rdf_publisher} #{@rdf_contributor} #{@rdf_date} #{@rdf_date_created} #{@rdf_date_issued} #{@rdf_date_available} #{@rdf_date_valid} #{@rdf_date_modified} #{@rdf_type} #{@rdf_format} #{@rdf_identifier} #{@rdf_source} #{@rdf_language} #{@rdf_relation} #{@rdf_coverage} #{@rdf_rights} /> </rdf:RDF> #{@full_title} #{@author} #{@subject} #{@description} #{@publisher} #{@contributor} #{@date} #{@date_created} #{@date_issued} #{@date_available} #{@date_valid} #{@date_modified} #{@type} #{@format} #{@identifier} #{@source} #{@language} #{@relation} #{@coverage} #{@rights} #{@copyright} #{@owner} #{@png.ico} #{@txt.generator} #{@js.head} \n</head> #{@color.body} #{@font.css_table_file} <a name="top"></a> <a name="up"></a> <a name="start"></a> #{@js.top} WOK end |