370 likes | 451 Views
OSP Forms and Presentations in a Nutshell. Tom Kuipers Universiteit van Amsterdam Information Technology Centre. Forms and Portfolios in a Nutshell. Tom Kuipers Universiteit van Amsterdam Information Technology Centre. Agenda. Overview Forms Portfolios Questions. Overview.
E N D
OSP Forms and Presentations in a Nutshell Tom Kuipers Universiteit van Amsterdam Information Technology Centre
Forms and Portfolios in a Nutshell Tom Kuipers Universiteit van Amsterdam Information Technology Centre
Agenda • Overview • Forms • Portfolios • Questions
Overview • Collecting information • Forms • Presenting information • Portfolio
Outline Options Forms and Files Anatomy of a Portfolio Presentation outline & supporting files XML
Steps • Define what type of information to collect • Split up in logical entities • Reusability • Create Forms • Create Portfolio template • Create XSL stylesheet
Types of Portfolios • Free form presentation • Page centered • Drag ‘n drop interface • Choose style, layout and content • ‘classic’ template presentation • Templates have predefined layout and style • Add existing content items from Resources • Placeholders for specific types of content
Sakai tools involved • Resources (maintain, access role) • Forms (maintain role) • Portfolios (maintain, access role) • Portfolio Templates (maintain role)
It’s all XML • XML • XSD • XSL • XPath
Tools • XSD Weaver http://trident.cdws.ucf.edu/xsdweaver/ • From within you XML editor of choice use Xalan as XSLT-engine java org.apache.xalan.xslt.Process -IN %1 -XSL %3 -OUT %2 • passthrough.xsl
Forms creation • Creating XSD’s for your forms • Manual or by using online tool XSD Weaver
XSD’s • XSD (XML Schema Definition) • Describes structure and data types of an XML document • File extension *.xsd • Mime-type "application/xml" or "text/xml"
passthrough.xsl stylesheet (available in .\sakai-demo\webapps\osp-presentation-tool\WEB-INF\resources) <?xml version="1.0" ?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="ospiPresentation"> <ospiPresentation> <xsl:copy-of select="*"></xsl:copy-of> </ospiPresentation> </xsl:template> </xsl:stylesheet>
Outline Options Forms and Files Anatomy of a Portfolio Presentation outline & supporting files XML
XSL Development process • In your presentation use passthrough.xsl as template and save the raw XML to desktop • Create your own XSL, use XML editor for XPath queries to show what you want • Use an XML editor with Xalan as (optional) XSLT-engine to do the translation • Improve XSL stylesheet, when satisfied upload it to Sakai environment, and update portfolio template
Example XSL <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> [...] <xsl:variable name="border_color" select="ospiPresentation/presentationProperties/cv-properties/border-color"/> <xsl:variable name="color_schema" select="ospiPresentation/presentationProperties/cv-properties/color-schema"/> <xsl:output method="html" indent="yes"/> <xsl:strip-space elements="*"/> <xsl:template match="ospiPresentation"> <html> <head> <xsl:element name="title"><xsl:value-of select="presentationProperties/cv-properties/titel"/></xsl:element> <link rel="stylesheet" type="text/css"> <xsl:attribute name="href"> <xsl:value-of select="presentationFiles/curriculumvitae_css/artifact/fileArtifact/uri"/> </xsl:attribute> </link> <style type="text/css" media="screen"> .border-top { background-image: url(<xsl:value-of select="presentationFiles/*[name()=concat('border_top_',$border_color)]/artifact/fileArtifact/uri"/>); width: 778px; height: 18px; } [...]
Lessons Learned • In XSD Weaver spaces in element name are allowed, while spaces are not allowed in xml element name (invalid syntax) • Published Form types cannot be altered. You can bypass this by ‘un-publishing’ it in de database. Set the fields 'sitestate' and 'globalstate' to 0 in table 'metaobj_form_def'. Upload revised xsd form definition and restore published state • Import / export multiple forms at once by adding the forms to a portfolio template and importing / exporting that template
Links • XSD Weaver online tool for XSD creation at http://trident.cdws.ucf.edu/xsdweaver/ • Community library at http://osportfolio.org. Containing xsd schemas, matrix examples, xslt portfolio templates, how-to tips, and more
Questions? • T.F.Kuipers@uva.nl