FBS for praktikere Fyn Notifikation og print skabeloner
1.Velkomst v/anton Helms 2.Introduktion til HTML/CSS/Freemarker v/kent Gottschalk Hansen. 3.Skabeloner i Cicero v/kent Gottschalk Hansen. 4.Erfaringsudveksling om skabeloner. 5.Bordet rundet Kommunerne giver kort status med deres arbejde med FBS/Cicero. 6.Eventuelt.
Punkt 2 + 3 CICERO NOTIFIKATIONER OG PRINT SKABELONER - HTML - CSS - Freemarker - Data VÆRKTØJER & LINKS EKSEMPLER
Notifikationer og print i Cicero
Hvad kan redigeres Opsætning og tilpasning af udskrifter
Hvad kan redigeres
Typer: Notifikationer (54) NOTIFIKATION EMAIL NOTIFIKATION SMS NOTIFIKATION DIGITAL POST
Typer: Print (27) PRINT BON EXPORT CSV LABEL
Typer: Andet (3) SMS Svar Konfigureret visning
Klienten
Klienten
Typer TEKST HTML CSS FREEMARKER EMAIL TEKST FREEMARKER LABELS SMS DIGITAL POST
HTML
Tekst
HTML, CSS, Freemarker, Data
Skabelon INPUT SKABELON OUTPUT INPUT
Html HTML bruges til at definere strukturen på HTML-sider. <h1>lånerstatus</h1> <p>status for Test Testesen</p> <! kommentar -> <p>udlån (1)</p> <table> <tr> <th>forfatter</th> <th>titel</th> </tr> <tr> <td>j.r.r. Tolkien</td> <td>ringenes herre</td> </tr> </table> Links https://www.w3schools.com/ https://www.codecademy.com/learn/learn-html
Css CSS bruges til at definere layoutet på HTML-sider. <h1>lånerstatus</h1> <p>status for Test Testesen</p> <! kommentar -> <p>udlån (1)</p> <table> <tr> <th>forfatter</th> <th>titel</th> </tr> <tr> <td>j.r.r. Tolkien</td> <td class= alert >Ringenes herre</td> </tr> </table> <style> table { width: 50%; } table, th, td { border: 1px solid black; border-collapse: collapse; } table th { background-color: #393E42; color: white; }.alert { background-color: #f8d7da; } </style>
Css Font-size: 12px - 1em; Font-weight: 700-500 - 300 Color: red - #FFD700 Margin: 10px 5px 0px 5px Padding: 10px Border: 1px solid #ddd Text-decoration: understregning Font-style: italic Links https://www.w3schools.com/ https://www.codecademy.com/learn/learn-css
Model
Freemarker Freemarker bruges til variabler og logik <h1>lånerstatus</h1> <p>status for ${data.loanermodel.name}</p> <! kommentar -> <p>udlån (${data.loansmodel?size})</p> <table> <tr> <th>${(loan.author)!""}</th> <th>${(loan.title)!""}</th> </tr> <#list data.loansmodel as loan> <tr> <td>${(loan.author)!""}</td> <td class= alert >${(loan.title)!""}</td> </tr> </#list> </table> Værdi (value/interpolation) ${data.loanermodel.name} = Test Testesen ${(loan.author)!""} ${data.loansmodel?size} = 1 ${1+1} Datatyper (type) Basis (scalars) 1 tekst 1 tal true/false boolean April 4, 2003 10:19:18 PM datetime 1 +1 = 2 1 + 1 = fejl Lister (containers) [100,250,50]
Værdier data.agencyname Odense Bibliotek og Borgerservice String data.checkedoutmaterials.biblio graphicsrecord Collection, string data.loanersummary.balance 150 number
Funktioner (directives) <ul> <#list data.checkedoutmaterials as checkedoutmaterial> <li>${checkedoutmaterials. bibliographicsrecord} <#if data.loanersummary.balance < 500> Besked til låner </#list> <#-- FORKERT --> </#if> </ul> <ul> <#list data.checkedoutmaterials as checkedoutmaterial> <li>${checkedoutmaterials. bibliographicsrecord}</li> </#list> </ul> <#if data.loanersummary.balance < 500> Besked til låner </#if> <#-- KORREKT --> https://freemarker.apache.org/docs/ref_directives.html
Operatorer og metoder (built in refence) Operatorer == lig med && og eller! ikke Metoder (Build in reference)?starts_with( string")?has_content.now?date?string["dd-mm-yyyy"] På https://freemarker.apache.org/ findes mere dokumentation. Vær opmærksom på versionsnummer i forhold til, hvilke funktioner man kan bruge. Nyeste: 2.3.28 Cicero: 2.3.21 OBS. Store / små bogstaver har betydning
Værktøjer og links
Html, Css & Freemarker
Links Yderligere info Freemarker https://freemarker.apache.org/ Variabler: Opsætning og tilpasning af udskrifter (fbsudrulning.dk) VS Code med Freemarker extension
Værktøjer Brug forhåndsvisning Kopier koden ud i en teksteditor Notepad VS code Gem kopier af koden Man kan altid genskabe standard Alt kører live, der er ikke noget test miljø
https://code.visualstudio.com/ Editor VScode
https://www.grigsoft.com/wincmp3.htm Diff Compare It
Eksempler
Printskabelon for afhentningsnote <!-- Hvis låner er læsekreds --> <#if data.loanerinfo.name?contains("læsekreds")> <tr><td><p></p></td></tr> <tr> <td class="header">${data.loanerinfo.name}</td> </tr> <tr><td><p></p></td></tr> </#if>
Printskabelon for afhentningsnote <#assign fynskebibs = ['20181907','20285039','20285040','20285042','20285043','20285045','20285046', '20285049','20285050','20285051','20285104','20285547']> <#if fynskebibs?seq_contains(data.loanerinfo.loanernumber) && data.basicbibliographicrecordinfo.title?contains("læsetaske")> <tr><td><p></p></td></tr> <tr><td class="loanername">obs! Læsetaske til fynsk bib</td></tr> <tr><td class="loanername">*** Print køreseddel ***</td></tr> <tr><td><p></p></td></tr> </#if>
Printskabelon for materialelabels <#-- Faglitteratur --> <#elseif data.bibliographicrecord.classification?has_content && (data.bibliographicrecord.classification[0]?matches("[0-9]") data.bibliographicrecord.classification?starts_with("te") data.bibliographicrecord.classification?starts_with("dr") data.bibliographicrecord.classification?starts_with("bi")) && (data.material.periodical)==false> ${(data.bibliographicrecord.classification)!""} <#if data.bibliographicrecord.author?has_content>${(data.bibliographicrecord.author)!""}</#if> ${(data.bibliographicrecord.title)!""} <#if data.bibliographicrecord.edition?has_content &&!(data.bibliographicrecord.edition?contains("1."))> ${(data.bibliographicrecord.edition)!""} </#if>${(data.bibliographicrecord.attachmentcount)!""}
Printskabelon for udlånskvittering <#switch data.branchname> <#case "Odense Hovedbibliotek og Musikbibliotek"> <tr><td>østre Stationsvej 15, 5000 Odense C</td></tr> <tr><td>tlf. 6613 1372</td></tr> <tr><td>e-mail: adm-bib@odense.dk</td></tr> <tr><td>www.odensebib.dk og på Facebook</td></tr> <tr><td> </td></tr> <tr><td>åbningstider:</td></tr> </table>
Afhentningsnote <#list data.loanerinfo.loanergroups as row> <tr><td> Klasse: ${(row.loanergroupname)!""} </td></tr> </#list>
Låneoversigt
Låneoversigt
Videndeling