Archive

Posts Tagged ‘Groups’

HowTo: Group output items using XSL transformation

While trying to generate a single HTML page that will list all ClipFlair activities using XSL Transformations (XSLT), I had the need to group items in 2-column rows.

This is my contribution to other solutions suggested at (if you like it you can vote it up there):

http://stackoverflow.com/questions/9908488/xslt-for-each-wrapping-every-nth-item-in-a-div/


Faced by the same problem, that is wanting to output

<div class="container">
  <div class="row">
    <div class="col">...</div>
    <div class="col"/>...</div>
  </div>
  <div class="row">
  ...
  </div>
</div>

from a CXML (Collection XML) file (http://gallery.clipflair.net/collection/activities.cxml – the data behind the PivotViewer display at http://gallery.clipflair.net/activity)

I coined up the following, based on other suggestions here, but using "mode" attribute of "template" and "apply-templates" XSL tags instead which make it cleaner I believe:

<?xml version="1.0" encoding="UTF-8"?>
<?altova_samplexml http://gallery.clipflair.net/collection/activities.cxml?>

<xsl:stylesheet 
  version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:cxml="http://schemas.microsoft.com/collection/metadata/2009"
  exclude-result-prefixes="cxml"
  >

  <xsl:output method="html" version="4.0" encoding="UTF-8" indent="yes"/>
  <xsl:param name="COLUMNS" select="2"/>

  <!-- ########################### -->

  <xsl:template match="/">
    <html xmlns="http://www.w3.org/1999/xhtml">
      <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
        <title>ClipFlair Activities</title>
        <link rel="stylesheet" type="text/css" href="style.css"/>
      </head>
      <body>
        <xsl:apply-templates/>
      </body>
    </html>
  </xsl:template>

  <!-- ########################### -->

  <xsl:template match="cxml:Collection">
    <div class="container">
      <xsl:apply-templates/>
    </div>
  </xsl:template>

  <!-- ########################### -->

  <xsl:template match="cxml:Items">
    <xsl:apply-templates 
select="cxml:Item[position() mod $COLUMNS = 1]" mode="row"/> </xsl:template> <!-- ########################### --> <xsl:template match="cxml:Item" mode="row"> <div class="row"> <div>----------</div> <xsl:apply-templates
select=".|following-sibling::cxml:Item[position() &lt; $COLUMNS]" mode="col"/> </div> </xsl:template> <xsl:template match="cxml:Item" mode="col"> <xsl:variable name="URL" select="@Href"/> <xsl:variable name="FILENAME"
select="cxml:Facets/cxml:Facet[@Name='Filename']/cxml:String/@Value"/> <div class="col"> <xsl:value-of select="$FILENAME"/> --- <xsl:value-of select="$URL"/> </div> </xsl:template> <!-- ########################### --> <xsl:template match="*"> <xsl:apply-templates/> </xsl:template> <xsl:template match="text()|@*"> </xsl:template> </xsl:stylesheet>

the output from the above when run in Altova XMLSpy tool (note that it uses altova_samplexml processor instruction to find the XML data) is:


2DaysInParis-OpenActivity-CapRev-FR-EN.clipflair --- http://studio.clipflair.net/?activity=2DaysInParis-OpenActivity-CapRev-FR-EN.clipflair
Abu_Dukhan-CapRev-A1-AR.clipflair --- http://studio.clipflair.net/?activity=Abu_Dukhan-CapRev-A1-AR.clipflair
----------

AFarewellToArms-RevCap-C2-EN.clipflair --- http://studio.clipflair.net/?activity=AFarewellToArms-RevCap-C2-EN.clipflair
agComhaireamhCountingRND.clipflair --- http://studio.clipflair.net/?activity=agComhaireamhCountingRND.clipflair

----------

Al-imtihan-CapRev-B1-AR.clipflair --- http://studio.clipflair.net/?activity=Al-imtihan-CapRev-B1-AR.clipflair
AlBar-Cap-B1-B2-IT.clipflair --- http://studio.clipflair.net/?activity=AlBar-Cap-B1-B2-IT.clipflair

...

Κοινόχρηστο Ημερολόγιο (Group Calendar) με Microsoft Outlook ή Hotmail

1) Δημιουργείς ένα Windows Live Group:

http://explore.live.com/windows-live-groups-help-center

Επιλέγοντας να εγκρίνεις ποιοι γράφονται (να μην μπαίνουν στο group αυτόματα) αν έχει τέτοια επιλογή.  Μπορείς μετά να στείλεις προσκλήσεις εγγραφής στο group μέσω e-mail.

Στη συνέχεια φτιάχνουν Windows Live ID όσοι είναι να συμμετέχουν στο group για να βλέπουν το group calendar. Μπορούν να χρησιμοποιήσουν μια διεύθυνση @hotmail.com, @hotmail.gr κλπ. που παρέχει το Windows Live Hotmail δωρεάν ή το δικό τους e-mail συνδέοντας το με Windows Live ID στο http://www.passport.net (αν δεν έχουν ή δε θέλουν Hotmail αλλά μόνο Windows Live ID για να εισέρχονται σε υπηρεσίες της Microsoft όπως τα Windows Live Groups).

Έπειτα εγγράφονται στο group με το Windows Live ID τους

2) Όσοι έχουν hotmail μπορούν να το βλέπουν εναλλακτικά στο web στο ημερολόγιο του hotmail όπου δείχνει και τα ημερολόγια των group όπου είσαι εγγεγραμμένος.

3) Για όσους έχουν πρόσφατο Outlook (2007 και άνω), μπορούν να βλέπουν τοπικά το κοινόχρηστο ημερολόγιο εγκαθιστώντας το Outlook Social Connector

http://www.microsoft.com/download/en/details.aspx?id=7985

Αφού εγκατασταθεί το ρυθμίζεις με το e-mail που χρησιμοποίησες για να εγγραφείς στο Windows Live Group και στην περιοχή Calendar του Outlook έχει δυνατότητα να επιλέξεις να βλέπεις και το κοινόχρηστο Calendar (ή μόνο αυτό).

 

Αν πάλι διαθέτεις Windows Exchange Server μπορείς να χρησιμοποιήσεις αυτόν:

http://www.outlookipedia.com/outlook/group-calendar.aspx

ή κάποιες άλλες λύσεις τρίτων (εμπορικές)

http://www.outlookipedia.com/outlook/share-calendar.aspx#Group_Calendar_Solutions_for_Outlook

 

Τέλος, το παρακάτω δείχνει έναν τρόπο να κάνεις Group/Team Calendars χωρίς Exchange (π.χ. με κάποιο δικό σου web server):

http://www.commodore.ca/windows/shared_calendar/share_outlook_calendar.htm

%d bloggers like this: