Return-Path: Delivered-To: apmail-lenya-user-archive@www.apache.org Received: (qmail 62411 invoked from network); 28 Apr 2008 07:34:23 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 28 Apr 2008 07:34:23 -0000 Received: (qmail 99242 invoked by uid 500); 28 Apr 2008 07:34:24 -0000 Delivered-To: apmail-lenya-user-archive@lenya.apache.org Received: (qmail 99215 invoked by uid 500); 28 Apr 2008 07:34:24 -0000 Mailing-List: contact user-help@lenya.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@lenya.apache.org Delivered-To: mailing list user@lenya.apache.org Received: (qmail 99204 invoked by uid 99); 28 Apr 2008 07:34:24 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 28 Apr 2008 00:34:24 -0700 X-ASF-Spam-Status: No, hits=1.8 required=10.0 tests=HTTP_ESCAPED_HOST,MIME_QP_LONG_LINE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of thorsten.scherler.ext@juntadeandalucia.es designates 217.12.18.114 as permitted sender) Received: from [217.12.18.114] (HELO mta.juntadeandalucia.es) (217.12.18.114) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 28 Apr 2008 07:33:36 +0000 Received: from [10.240.225.254] (helo=mail.juntadeandalucia.es) by guadix2.juntadeandalucia.es with esmtps (TLSv1:AES256-SHA:256) (Exim 4.60) (envelope-from ) id 1JqNru-0002g2-8M for user@lenya.apache.org; lun, 28 abr 2008 09:33:46 +0200 Received: from [10.240.192.30] by mail.juntadeandalucia.es with esmtpa (Exim 4.60) (envelope-from ) id 1JqNru-0002Gw-Po for user@lenya.apache.org; Mon, 28 Apr 2008 09:33:46 +0200 Subject: Re: Addind "ShareMe" functionality into the pages From: Thorsten Scherler To: user@lenya.apache.org In-Reply-To: References: Content-Type: text/plain; charset=utf-8 Date: Mon, 28 Apr 2008 09:29:54 +0200 Message-Id: <1209367794.30564.21.camel@localhost> Mime-Version: 1.0 X-Mailer: Evolution 2.10.1 Content-Transfer-Encoding: quoted-printable X-SA-Report: * -0.2 ALL_TRUSTED Passed through trusted hosts only via SMTP * 0.2 MIME_QP_LONG_LINE RAW: Quoted-printable line longer than 76 chars X-Spam-Score: -0.0 (/) X-Spam-Score-Int: 0 X-Virus-Checked: Checked by ClamAV on apache.org On Fri, 2008-04-25 at 17:31 +0100, Milan Je=C5=BEd=C3=ADk wrote: > According to this: http://solprovider.com/lenya/variableshowto I am able=20 > to put the parameters into my page (ad 1). Using=20 > {page-envelop:document-url-without-language}. >=20 > I still don't know how to convert special chars into HEX entities (ad=20 > 2). So I still need help with creating the encoded article URL for=20 > bookmark services (Exactly how to produce this: > http%3A%2F%2Flenya.apache.org%2Fscreenshots.html > from this: > http://lenya.apache.org/screenshots.html ? Hmm, why you need it so verbose? >=20 > I was thinking about using XSP to do this but I am afraid about the site=20 > performance. I would create a small java helper class that is doing the conversion (URLHexEncoder.java#encode(string)), then you can write an input module that is using the helper to calculate the url encoding and/or using it from a jx page. URLHexEncoder.java public class URLHexEncoder { public static String encode(String url){ String resultUrl =3D null; //calculate your resultUrl and then return resultUrl; } } However there is org.apache.cocoon.util.NetUtils that may offer already the decode/encode functionality you are looking for. Then from an input module (URLHexEncoderModule.java) public class URLHexEncoderModule extends AbstractInputModule { public Object getAttribute(String name, Configuration modeConf, Map objectModel) throws ConfigurationException { return URLHexEncoder.encode(name); } } or from jx HTH salu2 >=20 > M. >=20 >=20 >=20 > Milan Je=C5=BEd=C3=ADk wrote: > > Hello, > >=20 > > I would like to have "Share me" box on each article. This box will=20 > > contain a list of links to bookmark services such as digg, facebook,=20 > > delicious, etc. directly bookmarking this article. (example:=20 > > http://digg.com/submit?phase=3D2&url=3Dhttp%3A%2F%2Flenya.apache.org%2F= screenshots.html&title=3DLenya+Apache+org)=20 > >=20 > >=20 > >=20 > > Questions: > > 1) How can I achieve this? > > 2) How can I convert special chars into HEX encoding? Eg. ':' -> %3A '/= '=20 > > -> %2F, etc. > >=20 > > I was thinking about using variables such=20 > > {page-envelope:context-prefix}. I just don't know if I can use (and=20 > > how/where) these in XSL templates. > >=20 > > Is this possible with changes only in XSL templates under xslt director= y=20 > > or it needs some xmap changes? > >=20 > > Any help appreciated. > >=20 > > Thanks, > > Milan >=20 >=20 > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org > For additional commands, e-mail: user-help@lenya.apache.org >=20 --=20 Thorsten Scherler thorsten.at.apache.org Open Source Java consulting, training and solutions --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org For additional commands, e-mail: user-help@lenya.apache.org