You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by so...@apache.org on 2007/09/19 09:10:03 UTC
svn commit: r577177 [8/12] - in /lenya/branches/revolution/1.3.x: ./
src/webapp/ src/webapp/WEB-INF/ src/webapp/lenya/pubs/default/
src/webapp/lenya/pubs/default12/ src/webapp/lenya/pubs/default12/config/ac/
src/webapp/lenya/pubs/default13/ src/webapp/...
Added: lenya/branches/revolution/1.3.x/src/webapp/lenya/pubs/default13/lenya/content/search/search-and-results.xsp
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/pubs/default13/lenya/content/search/search-and-results.xsp?rev=577177&view=auto
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/pubs/default13/lenya/content/search/search-and-results.xsp (added)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/pubs/default13/lenya/content/search/search-and-results.xsp Wed Sep 19 00:09:42 2007
@@ -0,0 +1,674 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ Copyright 1999-2004 The Apache Software Foundation
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<!-- $Id: usecase-bxeng.xmap 180171 2005-06-05 23:16:13Z gregor $ -->
+
+<xsp:page language="java"
+ xmlns:xsp="http://apache.org/xsp"
+ xmlns:util="http://apache.org/xsp/util/2.0"
+ xmlns:xsp-request="http://apache.org/xsp/request/2.0"
+>
+ <xsp:structure>
+ <xsp:include>java.io.FileNotFoundException</xsp:include>
+ <xsp:include>java.util.Enumeration</xsp:include>
+ <xsp:include>java.util.HashSet</xsp:include>
+ <xsp:include>java.util.Hashtable</xsp:include>
+ <xsp:include>java.util.Iterator</xsp:include>
+ <xsp:include>java.util.StringTokenizer</xsp:include>
+ <xsp:include>java.util.Vector</xsp:include>
+ <xsp:include>org.apache.avalon.framework.context.ContextException</xsp:include>
+ <xsp:include>org.apache.avalon.framework.component.ComponentException</xsp:include>
+ <xsp:include>org.apache.cocoon.environment.Session</xsp:include>
+ <xsp:include>org.apache.lenya.ac.Accreditable</xsp:include>
+ <xsp:include>org.apache.lenya.ac.Identifiable</xsp:include>
+ <xsp:include>org.apache.lenya.ac.Identity</xsp:include>
+ <xsp:include>org.apache.lenya.lucene.ReTokenizeFile</xsp:include>
+ <xsp:include>org.apache.lenya.lucene.Publication</xsp:include>
+ <xsp:include>org.apache.lucene.analysis.Analyzer</xsp:include>
+ <xsp:include>org.apache.lucene.analysis.standard.StandardAnalyzer</xsp:include>
+ <xsp:include>org.apache.lucene.document.Document</xsp:include>
+ <xsp:include>org.apache.lucene.document.Field</xsp:include>
+ <xsp:include>org.apache.lucene.queryParser.QueryParser</xsp:include>
+ <xsp:include>org.apache.lucene.queryParser.MultiFieldQueryParser</xsp:include>
+ <xsp:include>org.apache.lucene.search.Hits</xsp:include>
+ <xsp:include>org.apache.lucene.search.IndexSearcher</xsp:include>
+ <xsp:include>org.apache.lucene.search.Query</xsp:include>
+ <xsp:include>org.apache.lucene.search.Searcher</xsp:include>
+ <xsp:include>org.apache.lucene.search.Sort</xsp:include>
+ </xsp:structure>
+
+<xsp:logic>
+ File workDir = null;
+ File indexDir=null;
+ File excerptDir=null;
+ String[] fields={"contents","title"};
+ String field = "contents";
+ Vector roles = new Vector();
+ Hashtable protectedAreas = new Hashtable();
+
+ /**
+ * Contextualize this class
+ */
+ public void contextualize(Context context) throws ContextException {
+ super.contextualize( context );
+ workDir = (File) context.get(Constants.CONTEXT_WORK_DIR);
+ }
+
+ /**
+ * Search index
+ */
+ Hits search(String query_string, String publication_id, String sortField, boolean sortReverse) throws ProcessingException, IOException{
+
+ // Load roles
+ Session session = request.getSession(true);
+ if(session != null){
+ Identity id=(Identity) session.getAttribute("org.apache.lenya.ac.Identity");
+ if(id != null){
+ Identifiable[] ids = id.getIdentifiables();
+ Accreditable[] acs =id.getAccreditables();
+ for (int ai = 0; ai < acs.length; ai++) {
+ boolean found = false;
+ for(int i = 0; i < ids.length; i++){
+ if(ids[i].toString().equals(acs[ai].toString())){ found = true;}
+ }
+ if(!found){
+ roles.add(acs[ai].toString());
+ }
+ }
+ } // id
+ } // session
+ hits=null;
+ try{
+ Searcher searcher=new IndexSearcher(indexDir.getAbsolutePath());
+ Analyzer l_analyzer=new StandardAnalyzer();
+
+ QueryParser l_queryParser = new QueryParser(field,l_analyzer); // Single field
+ l_queryParser.setOperator(QueryParser.DEFAULT_OPERATOR_AND);
+
+ getLogger().debug(query_string);
+ Query l_query = l_queryParser.parse(query_string); // Single field
+
+ if (sortField != null) {
+ Sort sort = new Sort(sortField, sortReverse);
+ hits = searcher.search(l_query, sort);
+ }else{
+ hits = searcher.search(l_query);
+ }
+ if(hits != null){
+ return hits;
+ }
+ }catch(IOException e){
+ System.err.println(".search(): EXCEPTION: "+e);
+ throw e;
+ }catch(Exception e){
+ System.err.println(".search(): EXCEPTION: "+e);
+ }
+ return null;
+ }
+
+ /**
+ *
+ */
+ String getPercent(float score){
+ return ""+java.lang.Math.round(score*100.0);
+ }
+
+ Hits hits;
+ int hits_length=-1;
+
+ String[] words=new String[0];
+
+ int hitsPerPage;
+ int maxPages;
+ int excerptOffset;
+ int start;
+ int end;
+
+</xsp:logic>
+
+ <search-and-results>
+<xsp:logic>
+ // ***********************
+ // *** Protected Areas ***
+ // ***********************
+ // DEFINITION: protectedAreas.add("/UrlStart", "group,group");
+ // UrlStart begins with / after .../live.
+ // There are no spaces between groups and commas.
+ protectedAreas.put("/employee", "employee");
+
+ // Get sitemap path
+ org.apache.excalibur.source.Source input_source=this.resolver.resolveURI("");
+ String sitemapPath=input_source.getURI();
+ sitemapPath=sitemapPath.substring(5); // Remove "file:" protocol
+
+ // Read parameters from sitemap
+ String numberOfPubs = parameters.getParameter("number-of-pubs", "1");
+ Publication[] pubs = new Publication[Integer.parseInt(numberOfPubs)];
+ for(int i = 0;i < pubs.length;i++) {
+ pubs[i] = new Publication();
+ pubs[i].id = parameters.getParameter("pub"+i+"-id","@ID@");
+ pubs[i].name = parameters.getParameter("pub"+i+"-name","@NAME@");
+ pubs[i].indexDir = parameters.getParameter("pub"+i+"-index-dir","@INDEX-DIR@");
+ pubs[i].searchFields = parameters.getParameter("pub"+i+"-search-fields","title,contents");
+ pubs[i].excerptDir = parameters.getParameter("pub"+i+"-excerpt-dir","@EXCERPT-DIR@");
+ pubs[i].prefix = parameters.getParameter("pub"+i+"-prefix","@PREFIX@");
+ }
+ String param_hits_per_page = parameters.getParameter("max-hits-per-page","13");
+ hitsPerPage = Integer.parseInt(param_hits_per_page);
+ String param_max_pages = parameters.getParameter("max-pages","5");
+ maxPages = Integer.parseInt(param_max_pages);
+ String param_excerpt_offset = parameters.getParameter("excerpt-offset","100");
+ excerptOffset = Integer.parseInt(param_excerpt_offset);
+
+ // Read parameters from query string
+ String urlQuerystring = <xsp-request:get-query-string />;
+ String query = <xsp-request:get-parameter name="query" default=""/>;
+ String publication_id = <xsp-request:get-parameter name="publication-id" default="phlburg"/>;
+ String sortBy = <xsp-request:get-parameter name="sortBy" default="score"/>;
+ String sortReverse = <xsp-request:get-parameter name="sortReverse" default="false"/>;
+
+ String language = "";
+ StringTokenizer qsTokens = new StringTokenizer(urlQuerystring, "&=", true);
+ String token = "";
+ HashSet languageSet = new HashSet();
+ if(qsTokens.hasMoreTokens()){ token = qsTokens.nextToken(); }
+ while(qsTokens.hasMoreTokens()){
+ if(token.equalsIgnoreCase("language")){
+ token = qsTokens.nextToken();
+ if(token.equals("=") && qsTokens.hasMoreTokens()){
+ languageSet.add(qsTokens.nextToken());
+ }
+ }else{
+ token = qsTokens.nextToken();
+ }
+ }
+ Iterator languageSetItems = languageSet.iterator();
+ if(languageSetItems.hasNext()){ language = languageSetItems.next().toString(); }
+ while(languageSetItems.hasNext()){ language += "," + languageSetItems.next().toString(); }
+ if(language.length() == 0) language = "en";
+
+ String startString = <xsp-request:get-parameter name="start" default="1"/>;
+ String endString = <xsp-request:get-parameter name="end" default="10"/>;
+ start=new Integer(startString).intValue();
+ if(endString == null){
+ end=hitsPerPage;
+ }else{
+ end=new Integer(endString).intValue();
+ }
+
+ // Find the number of the selected publication
+ int whichPublication=0;
+ for (int i = 0;i < pubs.length;i++) {
+ if (pubs[i].id.equals(publication_id)) {
+ whichPublication = i;
+ }
+ }
+
+ // Get all search fields
+ Vector twords = null;
+ Vector myFields = new Vector();
+ Enumeration parameterNames = request.getParameterNames();
+ while(parameterNames.hasMoreElements()){
+ String parameterName=(String)parameterNames.nextElement();
+ String value=request.getParameter(parameterName);
+
+ if (parameterName.indexOf(".fields") > 0) { // looking for field parameters
+ StringTokenizer st = new StringTokenizer(parameterName, ".");
+ int length = st.countTokens();
+ if(st.hasMoreTokens()){
+ String fieldPublicationId = st.nextToken();
+ if(st.hasMoreTokens()){
+ if(fieldPublicationId.equals(publication_id) || fieldPublicationId.equals("dummy-index-id")) {
+ st.nextToken(); // Ignore "fields" token
+ if(length == 2) { // radio or select
+ myFields.addElement(value);
+ }else if (length == 3) { // checkbox
+ myFields.addElement(st.nextToken());
+ }else{
+ // something is wrong
+ }
+ }
+ }
+ }
+ }
+ }
+ if(myFields.size() > 0) {
+ field = (String)myFields.elementAt(0);
+ fields = new String[myFields.size()];
+ for(int i = 0; i < myFields.size(); i++) {
+ fields[i] = (String)myFields.elementAt(i);
+ }
+ }
+ // Set index and excerpt dir
+ String param_index_dir=pubs[whichPublication].indexDir;
+ if(param_index_dir.charAt(0) == '/'){
+ indexDir=new File(param_index_dir);
+ }
+ else{
+ indexDir=new File(sitemapPath+File.separator+param_index_dir);
+ }
+ String param_excerpt_dir=pubs[whichPublication].excerptDir;
+ if(param_excerpt_dir.charAt(0) == '/'){
+ excerptDir=new File(param_excerpt_dir);
+ }else{
+ excerptDir=new File(sitemapPath+File.separator+param_excerpt_dir);
+ }
+</xsp:logic>
+ <configuration><xsp:attribute name="checked-pid"><xsp:expr>publication_id</xsp:expr></xsp:attribute>
+ <number-of-publications><xsp:expr>numberOfPubs</xsp:expr></number-of-publications>
+
+<xsp:logic>
+ for(int i = 0;i < pubs.length;i++) {
+</xsp:logic>
+ <publication><xsp:attribute name="pid"><xsp:expr>pubs[i].id</xsp:expr></xsp:attribute>
+ <name><xsp:expr>pubs[i].name</xsp:expr></name>
+ <index-dir><xsp:expr>pubs[i].indexDir</xsp:expr></index-dir>
+ <search-fields>
+<xsp:logic>
+ String[] searchFields = pubs[i].getFields();
+ if (searchFields != null) {
+ for (int k = 0; k < searchFields.length; k++) {
+ <field><xsp:expr>searchFields[k]</xsp:expr></field>
+ }
+ } else {
+</xsp:logic>
+ <xsp:content><xsp:expr>pubs[i].searchFields</xsp:expr></xsp:content><exception>.getFields() returned null</exception>
+<xsp:logic>
+ }
+</xsp:logic>
+ </search-fields>
+ <excerpt-dir><xsp:expr>pubs[i].excerptDir</xsp:expr></excerpt-dir>
+ <prefix><xsp:expr>pubs[i].prefix</xsp:expr></prefix>
+ </publication>
+<xsp:logic>
+ }
+</xsp:logic>
+ <hits-per-page><xsp:expr>hitsPerPage</xsp:expr></hits-per-page>
+ <max-pages><xsp:expr>maxPages</xsp:expr></max-pages>
+ <excerpt-offset><xsp:expr>excerptOffset</xsp:expr></excerpt-offset>
+ </configuration>
+
+<!-- Search Results -->
+ <search>
+<xsp:logic>
+ Enumeration para_names = request.getParameterNames();
+ if(para_names.hasMoreElements()){
+</xsp:logic>
+ <request-parameters>
+<xsp:logic>
+ while(para_names.hasMoreElements()){
+ String para_name=(String)para_names.nextElement();
+ String para_value=request.getParameter(para_name);
+</xsp:logic>
+ <parameter><xsp:attribute name="name"><xsp:expr>para_name</xsp:expr></xsp:attribute><xsp:attribute name="value"><xsp:expr>para_value</xsp:expr></xsp:attribute></parameter>
+ <xsp:element><xsp:param name="name"><xsp:expr>para_name</xsp:expr></xsp:param><xsp:expr>para_value</xsp:expr></xsp:element>
+<xsp:logic>
+ }
+</xsp:logic>
+ </request-parameters>
+<xsp:logic>
+ }
+ if(query != null && query.length() != 0 && publication_id != null && publication_id.length() > 0){
+
+ try {
+ if (sortBy.equals("score")) {
+ hits = search(query, publication_id, null, false);
+ } else {
+ if (sortReverse.equals("true")) {
+ hits = search(query, publication_id, sortBy, true);
+ } else {
+ hits = search(query, publication_id, sortBy, false);
+ }
+ }
+ } catch(Exception e) {
+</xsp:logic>
+ <exception><xsp:expr>e.toString()</xsp:expr></exception>
+<xsp:logic>
+ }
+ if(hits != null){
+ hits_length=hits.length();
+ }
+ else{
+ hits_length=-1;
+ hits=null;
+ }
+</xsp:logic>
+ <publication-id><xsp:expr>publication_id</xsp:expr></publication-id>
+ <publication-name><xsp:expr>pubs[whichPublication].name</xsp:expr></publication-name>
+ <publication-prefix><xsp:expr>pubs[whichPublication].prefix</xsp:expr></publication-prefix>
+ <sort-by><xsp:expr>sortBy</xsp:expr></sort-by>
+ <query><xsp:expr>query</xsp:expr></query>
+<xsp:logic>
+ if(query != null){
+ twords = new Vector();
+</xsp:logic>
+ <words>
+<xsp:logic>
+ StringTokenizer st=new StringTokenizer(query," ");
+ while(st.hasMoreTokens()){
+ String word=(String)st.nextElement();
+ if(!(word.equalsIgnoreCase("OR") || word.equalsIgnoreCase("AND"))){
+ <word><xsp:expr>word</xsp:expr></word>
+ twords.addElement(word);
+ }
+ }
+ words=new String[twords.size()];
+ for(int i=0;i<twords.size();i++){
+ words[i]=(String)twords.elementAt(i);
+ }
+</xsp:logic>
+ </words>
+<xsp:logic>
+ }
+</xsp:logic>
+ <start><xsp:expr>start</xsp:expr></start>
+ <end><xsp:expr>end</xsp:expr></end>
+ <language><xsp:expr>language</xsp:expr></language>
+ <fields>
+<xsp:logic>
+ for (int i = 0; i < fields.length; i++) {
+ <field><xsp:expr>fields[i]</xsp:expr></field>
+ }
+</xsp:logic>
+ </fields>
+<xsp:logic>
+ try{
+ Analyzer ll_analyzer=new StandardAnalyzer();
+ QueryParser queryParser = new QueryParser(field,ll_analyzer);
+ //MultiFieldQueryParser queryParser = new MultiFieldQueryParser("contents",ll_analyzer);
+ queryParser.setOperator(QueryParser.DEFAULT_OPERATOR_AND);
+ Query ll_query = queryParser.parse(query);
+ //Query ll_query = queryParser.parse(query,fields,ll_analyzer);
+ <query><xsp:expr>ll_query.toString("contents")</xsp:expr></query>
+ }
+ catch(Exception e){
+ <exception><xsp:expr>e.toString()</xsp:expr></exception>
+ }
+ }
+ else{
+ hits_length=-1;
+ hits=null;
+ }
+</xsp:logic>
+ </search>
+<xsp:logic>
+ if(hits != null){
+ int validCount = 0; //number of valid results
+</xsp:logic>
+ <results>
+<xsp:logic>
+ if(hits_length > 0){
+</xsp:logic>
+ <hits>
+<xsp:logic>
+// i = index of result. validCount = count valid results.
+for (int i = 0; (i < hits.length()); i++) {
+ Document ldoc=hits.doc(i);
+ Enumeration lfields = ldoc.fields();
+ String lpath=ldoc.get("path");
+
+ String lurl=ldoc.get("url");
+ String ltitle=ldoc.get("title");
+ String mime_type=ldoc.get("mime-type");
+ String docLanguage = "";
+ if(lpath != null){
+</xsp:logic>
+ <hit>
+ <score><xsp:attribute name="percent"><xsp:expr>getPercent(hits.score(i))</xsp:expr></xsp:attribute>
+ <xsp:expr>hits.score(i)</xsp:expr></score>
+ <path><xsp:expr>lpath</xsp:expr></path>
+ </hit>
+<xsp:logic>
+ }
+ else if(lurl != null){
+ // Check Language
+ // This also filters sitetree.xml since it has no language.
+ docLanguage = "";
+ while (lfields.hasMoreElements()) {
+ Field lfield = (Field)lfields.nextElement();
+ if(0 == lfield.name().compareTo("language")){
+ docLanguage = lfield.stringValue();
+ }
+ }
+</xsp:logic>
+<language><xsp:expr>language</xsp:expr></language>
+<language-check><xsp:attribute name="doc"><xsp:expr>docLanguage</xsp:expr></xsp:attribute></language-check>
+<xsp:logic>
+ if((docLanguage.length() > 0) && (language.indexOf(docLanguage) != -1)){
+</xsp:logic>
+<language-yes/>
+<xsp:logic>
+ // Get URL parts
+ String parent = "";
+ String filename = "";
+ String querystring = "";
+ if(lurl.lastIndexOf("/") > -1) {
+ parent = lurl.substring(0,lurl.lastIndexOf("/"));
+ filename = lurl.substring(lurl.lastIndexOf("/")+1);
+ }
+ if(lurl.indexOf("?") > -1) {
+ querystring = lurl.substring(lurl.indexOf("?"));
+ }
+ // Check Restricted
+ boolean restricted = false;
+ // Get list of restricted prefixes and check against roles.
+ Enumeration protectedArea = protectedAreas.keys();
+ while((!restricted) && protectedArea.hasMoreElements()){
+ String startUrl = (String) protectedArea.nextElement();
+ if(parent.startsWith(startUrl)){
+ StringTokenizer rolesAllowed = new StringTokenizer((String)protectedAreas.get(startUrl), ",");
+ restricted = true;
+ while(rolesAllowed.hasMoreElements()){
+ // Check roles
+ if(roles.contains(rolesAllowed.nextElement())){
+ restricted = false;
+ }
+ }
+ }
+ }
+ if(!restricted){
+ // Build hit
+ validCount++;
+ if((validCount >= start) && (validCount <= end)){
+</xsp:logic>
+ <hit><xsp:attribute name="pos"><xsp:expr>validCount</xsp:expr></xsp:attribute>
+ <fields>
+<xsp:logic>
+ lfields = ldoc.fields();
+ int first = -1;
+ while (lfields.hasMoreElements()) {
+ Field lfield = (Field)lfields.nextElement();
+ String slfield = lfield.stringValue();
+
+ if(lfield.name().equals("htmlbody")){
+ String tmphtmlbody = slfield;
+ String upperhtmlbody = tmphtmlbody.toUpperCase();
+ if(twords != null){
+ Enumeration twordsE = twords.elements();
+ while(twordsE.hasMoreElements()){
+ int last = 0;
+ String word = twordsE.nextElement().toString();
+ String upperword = word.toUpperCase();
+ int wordLen = word.length();
+ StringBuffer sb = new StringBuffer();
+ int current = upperhtmlbody.indexOf(upperword);
+ if((current < first) || (first == -1)) first = current;
+ while(current > last){
+ sb.append(tmphtmlbody.substring(last, current));
+ sb.append("~").append(tmphtmlbody.substring(current, current + wordLen)).append("~");
+ last = current + wordLen;
+ current = upperhtmlbody.indexOf(upperword, last);
+ }
+ sb.append(tmphtmlbody.substring(last));
+ tmphtmlbody = sb.toString();
+ upperhtmlbody = tmphtmlbody.toUpperCase();
+ }
+ }
+ if(slfield.length() > excerptOffset){
+ int start = 0;
+ int end = excerptOffset;
+ int half = excerptOffset/2;
+ if(first < half){
+ end = tmphtmlbody.indexOf(' ', excerptOffset);
+ }else{
+ start = tmphtmlbody.indexOf(' ', first - half);
+ end = tmphtmlbody.indexOf(' ', start + excerptOffset);
+ }
+ tmphtmlbody = tmphtmlbody.substring(start, end);
+ }
+ StringTokenizer tokens = new StringTokenizer(tmphtmlbody, "~");
+ boolean needCloseHtmlBody = false;
+ if(tokens.hasMoreTokens()){
+ needCloseHtmlBody = true;
+</xsp:logic>
+ <htmlbody><xsp:expr>tokens.nextToken()</xsp:expr>
+<xsp:logic>
+ }
+ while(tokens.hasMoreTokens()){
+</xsp:logic>
+ <word><xsp:expr>tokens.nextToken()</xsp:expr></word>
+<xsp:logic>
+ if(tokens.hasMoreTokens()){
+</xsp:logic>
+ <xsp:expr>tokens.nextToken()</xsp:expr>
+<xsp:logic>
+ }
+ }
+ if(needCloseHtmlBody){
+</xsp:logic>
+ </htmlbody>
+<xsp:logic>
+ }
+ }else{
+
+</xsp:logic>
+ <xsp:element><xsp:param name="name"><xsp:expr>lfield.name()</xsp:expr></xsp:param><xsp:expr>slfield</xsp:expr></xsp:element>
+<xsp:logic>
+ }
+ }
+
+</xsp:logic>
+ </fields>
+ <score><xsp:attribute name="percent"><xsp:expr>getPercent(hits.score(i))</xsp:expr></xsp:attribute><xsp:expr>hits.score(i)</xsp:expr></score>
+ <uri>
+ <xsp:attribute name="parent"><xsp:expr>parent</xsp:expr></xsp:attribute>
+ <xsp:attribute name="filename"><xsp:expr>filename</xsp:expr></xsp:attribute>
+ <xsp:attribute name="querystring"><xsp:expr>querystring</xsp:expr></xsp:attribute>
+ <xsp:expr>lurl</xsp:expr>
+ </uri>
+<xsp:logic>
+ File excerptFile=new File(excerptDir+File.separator+lurl);
+ if((ltitle != null) && (ltitle.length() > 0)){
+ <title><xsp:expr>ltitle</xsp:expr></title>
+ }else{
+ <title><xsp:expr>excerptFile.getName()</xsp:expr></title>
+ <no-title/>
+ }
+ if((mime_type != null) && (mime_type.length() > 0)){
+ <mime-type><xsp:expr>mime_type</xsp:expr></mime-type>
+ }else{
+ <no-mime-type/>
+ }
+ try{
+ ReTokenizeFile rtf=new ReTokenizeFile();
+ rtf.setOffset(excerptOffset);
+ String excerpt=rtf.getExcerpt(excerptFile,words);
+ if(excerpt != null){
+ excerpt=rtf.emphasizeAsXML(rtf.tidy(excerpt),words);
+ <util:include-expr><util:expr><xsp:expr>excerpt</xsp:expr></util:expr></util:include-expr>
+ }else{
+ throw new Exception("excerpt == null. Maybe file does not contain the words!");
+ }
+ }
+ catch(FileNotFoundException e){
+</xsp:logic>
+ <no-excerpt>
+ <file><xsp:attribute name="src"><xsp:expr>excerptFile.getAbsolutePath()+" "+words[0]+" "+e</xsp:expr></xsp:attribute></file>
+ </no-excerpt>
+<xsp:logic>
+ }
+ catch(Exception e){
+ <excerpt-exception><xsp:expr>""+e</xsp:expr></excerpt-exception>
+ }
+</xsp:logic>
+ </hit>
+<xsp:logic>
+ }
+} // END - Within range (start-end)
+} // END - Check Restricted
+} // END - Check Language
+ }
+</xsp:logic>
+ </hits>
+<xsp:logic>
+ }else{
+</xsp:logic>
+ <no-hits/>
+<xsp:logic>
+ }
+ int number_of_pages=(validCount/hitsPerPage);
+ if(number_of_pages*hitsPerPage != validCount){
+ number_of_pages=number_of_pages+1;
+ }
+ if(number_of_pages > maxPages){
+ number_of_pages=maxPages;
+ }
+ if(validCount == 0){
+ number_of_pages=0;
+ <no-pages/>
+ }
+ else{
+</xsp:logic>
+ <pages>
+<xsp:logic>
+ for(int i=0;i<number_of_pages;i++){
+ int pstart=i*hitsPerPage+1;
+ int pend=(i+1)*hitsPerPage;
+ if(validCount < pend){
+ pend=validCount;
+ }
+ String type="other";
+ if(pstart == start){
+ type="current";
+ }
+ else if(pstart == start-hitsPerPage){
+ type="previous";
+ }
+ else if(pstart == start+hitsPerPage){
+ type="next";
+ }
+</xsp:logic>
+ <page>
+ <xsp:attribute name="start"><xsp:expr>pstart</xsp:expr></xsp:attribute>
+ <xsp:attribute name="end"><xsp:expr>pend</xsp:expr></xsp:attribute>
+ <xsp:attribute name="type"><xsp:expr>type</xsp:expr></xsp:attribute>
+ </page>
+<xsp:logic>
+ }
+</xsp:logic>
+ </pages>
+<xsp:logic>
+ }
+</xsp:logic>
+<total-hits><xsp:expr>validCount</xsp:expr></total-hits>
+ </results>
+<xsp:logic>
+ }
+</xsp:logic>
+ </search-and-results>
+</xsp:page>
+
Added: lenya/branches/revolution/1.3.x/src/webapp/lenya/pubs/default13/lenya/resources/i18n/cmsui.xml
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/pubs/default13/lenya/resources/i18n/cmsui.xml?rev=577177&view=auto
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/pubs/default13/lenya/resources/i18n/cmsui.xml (added)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/pubs/default13/lenya/resources/i18n/cmsui.xml Wed Sep 19 00:09:42 2007
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+
+ Copyright 2004 The Apache Software Foundation
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+
+ $Id: cmsui.xml 169213 2005-05-09 01:32:49Z gregor $
+
+-->
+
+<catalogue xml:lang="en">
+
+ <message key="default.createdoc.idtaken">The ID you've entered is already taken. Please choose another one.</message>
+ <message key="default.createdoc.visibleinnavigation">Document visible in navigation:</message>
+
+ <message key="Create new language version">Create new language version</message>
+ <message key="New language for existing Document">New language for existing Document</message>
+ <message key="default.createdoc.info.all-language-versions-exists">There are already versions of this document for all languages.</message>
+
+ <message key="last_published">Last Published</message>
+</catalogue>
Added: lenya/branches/revolution/1.3.x/src/webapp/lenya/pubs/default13/lenya/resources/i18n/cmsui_de.xml
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/pubs/default13/lenya/resources/i18n/cmsui_de.xml?rev=577177&view=auto
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/pubs/default13/lenya/resources/i18n/cmsui_de.xml (added)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/pubs/default13/lenya/resources/i18n/cmsui_de.xml Wed Sep 19 00:09:42 2007
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+
+ Copyright 2004 The Apache Software Foundation
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+
+ $Id: cmsui_de.xml 169213 2005-05-09 01:32:49Z gregor $
+
+-->
+
+<catalogue xml:lang="de">
+
+ <message key="default.doc.create.idtaken">Die eingebene ID ist schon vergeben. Bitte wä;hlen Sie eine andere ID.</message>
+ <message key="default.createdoc.visibleinnavigation">Dokument sichtbar in der Navigation:</message>
+
+ <message key="Create new language version">Neue Sprachversion anlegen</message>
+ <message key="New language for existing Document">Neue Sprachversion für existierendes Dokument anlegen</message>
+ <message key="default.createdoc.info.all-language-versions-exists">Das Dokument existiert bereits in allen notwendigen Sprachen.</message>
+
+ <message key="last_published">Letzte Aktualisierung</message>
+</catalogue>
+
Added: lenya/branches/revolution/1.3.x/src/webapp/lenya/pubs/default13/lenya/resources/i18n/cmsui_es.xml
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/pubs/default13/lenya/resources/i18n/cmsui_es.xml?rev=577177&view=auto
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/pubs/default13/lenya/resources/i18n/cmsui_es.xml (added)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/pubs/default13/lenya/resources/i18n/cmsui_es.xml Wed Sep 19 00:09:42 2007
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+
+ Copyright 2004 The Apache Software Foundation
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+
+ $Id: cmsui_es.xml 209982 2005-07-10 02:44:49Z antonio $
+
+ @translators Salvador Cobrero <salvador_cobrero_jimenez at dmr-consulting dot com>
+
+-->
+
+<catalogue xml:lang="es">
+
+ <message key="default.createdoc.idtaken">El ID introducido ya existe. Por favor, elija otro.</message>
+ <message key="default.createdoc.visibleinnavigation">Documento visible en navegación:</message>
+
+ <message key="Create new language version">Crear nueva versión de idioma</message>
+ <message key="New language for existing Document">Nuevo idioma para el documento existente</message>
+ <message key="default.createdoc.info.all-language-versions-exists">Ya existen versiones de este documento para todos los idiomas.</message>
+
+ <message key="last_published">Ãltima publicación</message>
+</catalogue>
+
Added: lenya/branches/revolution/1.3.x/src/webapp/lenya/pubs/default13/lenya/resources/i18n/cmsui_fr.xml
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/pubs/default13/lenya/resources/i18n/cmsui_fr.xml?rev=577177&view=auto
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/pubs/default13/lenya/resources/i18n/cmsui_fr.xml (added)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/pubs/default13/lenya/resources/i18n/cmsui_fr.xml Wed Sep 19 00:09:42 2007
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+
+ Copyright 2004 The Apache Software Foundation
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+
+ $Id: cmsui_fr.xml 153091 2005-02-09 17:27:19Z edith $
+
+ @translators Olivier Lange <wire at petit-atelier dot ch>
+
+-->
+
+<catalogue xml:lang="fr">
+
+ <message key="default.createdoc.idtaken">L'identifiant (ID) que vous avez choisi est déjà utilisé. Veuillez en choisir un autre.</message>
+ <message key="Create new language version">Créer une nouvelle traduction</message>
+ <message key="New language for existing Document">Nouvelle traduction d'un document existant</message>
+ <message key="default.createdoc.info.all-language-versions-exists">Les traductions de ce document existent déjà dans toutes les langues.</message>
+ <message key="last_published">Mise à jour</message>
+
+</catalogue>
Added: lenya/branches/revolution/1.3.x/src/webapp/lenya/pubs/default13/lenya/resources/i18n/cmsui_it.xml
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/pubs/default13/lenya/resources/i18n/cmsui_it.xml?rev=577177&view=auto
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/pubs/default13/lenya/resources/i18n/cmsui_it.xml (added)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/pubs/default13/lenya/resources/i18n/cmsui_it.xml Wed Sep 19 00:09:42 2007
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright 2004 The Apache Software Foundation
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+
+ $Id: cmsui_it.xml 413285 2006-06-10 11:10:23Z thorsten $
+ @translators Giampaolo Trapasso <trapo at trapo dot it>
+-->
+<catalogue xml:lang="it">
+ <message key="default.createdoc.idtaken">L'ID scelto è già utilizzato. Scegliere un altro ID.</message>
+ <message key="Create new language version">Crea nuova lingua</message>
+ <message key="New language for existing Document">Nuova lingua per un Documento esistente</message>
+ <message key="default.createdoc.info.all-language-versions-exists">Esistono già versioni di questo documento per tutte le lingue.</message>
+</catalogue>
Added: lenya/branches/revolution/1.3.x/src/webapp/lenya/pubs/default13/lenya/resources/i18n/cmsui_pt.xml
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/pubs/default13/lenya/resources/i18n/cmsui_pt.xml?rev=577177&view=auto
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/pubs/default13/lenya/resources/i18n/cmsui_pt.xml (added)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/pubs/default13/lenya/resources/i18n/cmsui_pt.xml Wed Sep 19 00:09:42 2007
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 1999-2005 The Apache Software Foundation
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ $Id: cmsui_pt.xml 111676 2005-06-15 23:50:43Z gregor $
+
+ @translators Rolando Isidoro <rli at uninova dot pt>
+
+-->
+
+<catalogue xml:lang="pt">
+
+ <message key="default.createdoc.idtaken">O ID introduzido já existe. Por favor introduza outro.</message>
+
+ <message key="Create new language version">Criar nova versão de idioma</message>
+ <message key="New language for existing Document">Novo idioma para o Documento existente</message>
+ <message key="default.createdoc.info.all-language-versions-exists">Já existem versões deste documento em todos os idiomas.</message>
+
+</catalogue>
+
Added: lenya/branches/revolution/1.3.x/src/webapp/lenya/pubs/default13/lenya/resources/i18n/cmsui_ru.xml
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/pubs/default13/lenya/resources/i18n/cmsui_ru.xml?rev=577177&view=auto
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/pubs/default13/lenya/resources/i18n/cmsui_ru.xml (added)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/pubs/default13/lenya/resources/i18n/cmsui_ru.xml Wed Sep 19 00:09:42 2007
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+
+ Copyright 2004 The Apache Software Foundation
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+
+ $Id: cmsui.xml 153091 2005-02-09 17:27:19Z edith $
+
+-->
+
+<catalogue xml:lang="ru">
+
+ <message key="default.createdoc.idtaken">ÐведÑннÑй иденÑиÑикаÑÐ¾Ñ Ð·Ð°Ð½ÑÑ. ÐÑбеÑеÑе дÑÑÑгой, пожалÑйÑÑа.</message>
+ <message key="Create new language version">СоздаÑÑ Ð²ÐµÑÑÐ¸Ñ Ð½Ð° дÑÑгом ÑзÑке</message>
+ <message key="New language for existing Document">ÐеÑевеÑÑи ÑÑÑеÑÑвÑÑÑий докÑменÑ</message>
+ <message key="default.createdoc.info.all-language-versions-exists">ÐеÑÑии ÑÑого докÑменÑа Ñже еÑÑÑ Ð½Ð° вÑеÑ
ÑзÑкаÑ
.</message>
+
+ <message key="last_published">ÐоÑледнÑÑ Ð¿ÑбликаÑиÑ</message>
+</catalogue>
\ No newline at end of file
Added: lenya/branches/revolution/1.3.x/src/webapp/lenya/pubs/default13/lenya/xslt/authoring/create-language.xsl
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/pubs/default13/lenya/xslt/authoring/create-language.xsl?rev=577177&view=auto
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/pubs/default13/lenya/xslt/authoring/create-language.xsl (added)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/pubs/default13/lenya/xslt/authoring/create-language.xsl Wed Sep 19 00:09:42 2007
@@ -0,0 +1,211 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 1999-2004 The Apache Software Foundation
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<!-- $Id: create-language.xsl 169217 2005-05-09 02:04:30Z gregor $ -->
+
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns="http://www.w3.org/1999/xhtml">
+
+ <xsl:output version="1.0" indent="yes" encoding="UTF-8"/>
+
+ <xsl:param name="lenya.usecase" select="'create-language'"/>
+ <xsl:param name="contextprefix"/>
+
+ <xsl:template match="/">
+ <page:page xmlns:page="http://apache.org/cocoon/lenya/cms-page/1.0">
+ <page:title>
+ <i18n:text>Create new language version</i18n:text>
+ </page:title>
+ <page:body>
+ <xsl:apply-templates/>
+ </page:body>
+ </page:page>
+ </xsl:template>
+
+ <xsl:template match="parent-child">
+
+ <xsl:apply-templates select="exception"/>
+
+ <xsl:if test="count(//dc:language) = 0">
+ <div class="lenya-box">
+ <div class="lenya-box-title">
+ <i18n:text>New language for existing Document</i18n:text>
+ </div>
+ <div class="lenya-box-body">
+ <form method="GET" action="{/parent-child/referer}">
+ <table class="lenya-table-noborder">
+ <tr>
+ <td>
+ <p>
+ <i18n:text key="default.createdoc.info.all-language-versions-exists"/>
+ </p>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <input i18n:attr="value" type="button" onClick="location.href='{/parent-child/referer}';" value="Cancel"/>
+ </td>
+ </tr>
+ </table>
+ </form>
+ </div>
+ </div>
+ </xsl:if>
+
+ <xsl:if test="not(exception) and count(//dc:language) > 0">
+ <div class="lenya-box">
+ <div class="lenya-box-title">
+ <i18n:text>New language for existing Document</i18n:text>
+ </div>
+ <div class="lenya-box-body">
+ <script type="text/javascript" src="{$contextprefix}/lenya/javascript/validation.js"> </script>
+ <script Language="JavaScript">
+function validateForm(theForm)
+{
+ if (!validRequired(theForm["properties.create.child-name"],"Navigation Title"))
+ return false;
+
+ if (!validRequired(theForm["properties.create.title"],"Document Title"))
+ return false;
+
+ return true;
+}
+ </script>
+ <form method="GET"
+ action="{/parent-child/referer}" onsubmit="return validateForm(this)">
+ <input type="hidden" name="lenya.usecase" value="{$lenya.usecase}"/>
+ <input type="hidden" name="lenya.step" value="create"/>
+ <input type="hidden" name="properties.create.document-id" value="{/parent-child/document-id}"/>
+ <input type="hidden" name="properties.create.old.language" value="{/parent-child/document-language}"/>
+ <input type="hidden" name="properties.create.userid" value="{/parent-child/user-id}"/>
+ <input type="hidden" name="properties.create.ipaddress" value="{/parent-child/ip-address}"/>
+ <table class="lenya-table-noborder">
+ <tr>
+ <td class="lenya-form-caption">
+ <i18n:text>Document ID</i18n:text>: </td>
+ <td>
+ <xsl:value-of select="/parent-child/document-id"/>
+ </td>
+ </tr>
+ <tr>
+ <td class="lenya-form-caption"><label for="properties.create.child-name">
+ <i18n:text>Navigation Title</i18n:text>*: </label></td>
+ <td>
+ <input class="lenya-form-element" type="text" name="properties.create.child-name"/>
+ </td>
+ </tr>
+ <tr>
+ <td class="lenya-form-caption"><label for="properties.create.new.language">
+ <i18n:text>Language</i18n:text>: </label></td>
+ <td>
+ <select class="lenya-form-element" name="properties.create.new.language">
+ <xsl:apply-templates select="dc:languages"/>
+ </select>
+ </td>
+ </tr>
+ <tr>
+ <td class="lenya-form-caption"><label for="properties.create.creator">
+ <i18n:text>Creator</i18n:text>: </label></td>
+ <td>
+ <input class="lenya-form-element" type="hidden" name="properties.create.creator" value="{/parent-child/dc:creator}"/>
+ <xsl:value-of select="/parent-child/dc:creator"/>
+ </td>
+ </tr>
+ <tr>
+ <td class="lenya-form-caption"><label for="properties.create.subject">
+ <i18n:text>Subject</i18n:text>:</label></td>
+ <td>
+ <input class="lenya-form-element" type="text" name="properties.create.subject"/>
+ </td>
+ </tr>
+ <tr>
+ <td class="lenya-form-caption"><label for="properties.create.publisher">
+ <i18n:text>Publisher</i18n:text>:</label></td>
+ <td>
+ <input class="lenya-form-element" type="text" name="properties.create.publisher" value="{/parent-child/dc:publisher}"/>
+ </td>
+ </tr>
+ <tr>
+ <td class="lenya-form-caption"><label for="properties.create.date">
+ <i18n:text>Date</i18n:text>: </label></td>
+ <td>
+ <input class="lenya-form-element" type="hidden" name="properties.create.date" value="{/parent-child/dc:date}"/>
+ <xsl:value-of select="/parent-child/dc:date"/>
+ </td>
+ </tr>
+ <tr>
+ <td class="lenya-form-caption"><label for="properties.create.rights">
+ <i18n:text>Rights</i18n:text>: </label></td>
+ <td>
+ <input class="lenya-form-element" type="text" name="properties.create.rights" value="{/parent-child/dc:rights}"/>
+ </td>
+ </tr>
+ <tr>
+ <td>* <i18n:text>required fields</i18n:text>
+ </td>
+ </tr>
+ <tr>
+ <td/>
+ <td>
+ <input i18n:attr="value" type="submit" value="Create"/> 
+ <input i18n:attr="value" type="button" onClick="location.href='{/parent-child/referer}';" value="Cancel"/>
+ </td>
+ </tr>
+ </table>
+ </form>
+ </div>
+ </div>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template match="dc:languages">
+ <xsl:for-each select="dc:language">
+ <option>
+ <xsl:value-of select="."/>
+ </option>
+ </xsl:for-each>
+ </xsl:template>
+
+
+ <xsl:template match="exception">
+ <font color="red">
+ <i18n:text>EXCEPTION</i18n:text>
+ </font>
+ <br />
+ <a href="{../referer}">
+ <i18n:text>Back</i18n:text>
+ </a>
+ <br />
+ <p>
+ <i18n:text>Please check the following possible causes of the exception</i18n:text>
+ <ol>
+ <li>
+ <i18n:text key="exception.cause.createdoc.whitespace-in-id"/>
+ </li>
+ <li>
+ <i18n:text key="exception.cause.createdoc.id-in-use"/>
+ </li>
+ </ol>
+ <i18n:text>Exception handling will be improved in the near future</i18n:text>
+ </p>
+ </xsl:template>
+
+
+</xsl:stylesheet>
Added: lenya/branches/revolution/1.3.x/src/webapp/lenya/pubs/default13/lenya/xslt/authoring/create.xsl
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/pubs/default13/lenya/xslt/authoring/create.xsl?rev=577177&view=auto
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/pubs/default13/lenya/xslt/authoring/create.xsl (added)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/pubs/default13/lenya/xslt/authoring/create.xsl Wed Sep 19 00:09:42 2007
@@ -0,0 +1,208 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 1999-2004 The Apache Software Foundation
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<!-- $Id: create.xsl 169217 2005-05-09 02:04:30Z gregor $ -->
+
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns="http://www.w3.org/1999/xhtml">
+
+ <xsl:output version="1.0" indent="yes" encoding="ISO-8859-1"/>
+
+ <xsl:param name="status"/>
+ <xsl:param name="lenya.usecase" select="'create'"/>
+ <xsl:param name="contextprefix"/>
+
+ <xsl:template match="/">
+ <page:page xmlns:page="http://apache.org/cocoon/lenya/cms-page/1.0">
+ <page:title>
+ <i18n:text>New Document</i18n:text>
+ </page:title>
+ <page:body>
+ <xsl:apply-templates/>
+ </page:body>
+ </page:page>
+ </xsl:template>
+
+ <xsl:template match="parent-child">
+
+ <xsl:apply-templates select="exception"/>
+
+ <xsl:if test="not(exception)">
+ <div class="lenya-box">
+ <div class="lenya-box-title">
+ <i18n:text>New Document</i18n:text>
+ </div>
+ <div class="lenya-box-body">
+ <script type="text/javascript" src="{$contextprefix}/lenya/javascript/validation.js"> </script>
+ <script Language="JavaScript">
+function validateForm(theForm)
+{
+ if (!validContent(theForm["properties.create.child-id"],"Document ID"))
+ return false;
+
+ if (!validRequired(theForm["properties.create.child-id"],"Document ID"))
+ return false;
+
+ if (!validRequired(theForm["properties.create.child-name"],"Navigation Title"))
+ return false;
+
+ if (!validRequired(theForm["properties.create.language"],"Language"))
+ return false;
+
+ return true;
+}
+ </script>
+
+ <form method="GET"
+ action="{/parent-child/referer}" onsubmit="return validateForm(this)">
+ <input type="hidden" name="properties.create.parent-id" value="{/parent-child/parentid}"/>
+ <input type="hidden" name="lenya.usecase" value="{$lenya.usecase}"/>
+ <input type="hidden" name="lenya.step" value="create"/>
+ <input type="hidden" name="properties.create.child-type" value="branch"/>
+ <input type="hidden" name="properties.create.doctype" value="{/parent-child/doctype}"/>
+ <table class="lenya-table-noborder">
+ <xsl:if test="$status != ''">
+ <tr>
+ <td class="lenya-form-message-error" colspan="2">
+ <i18n:text key="default.createdoc.idtaken"/>
+ </td>
+ </tr>
+ </xsl:if>
+ <tr>
+ <td class="lenya-entry-caption">
+ <i18n:text>Parent ID</i18n:text>:</td>
+ <td>
+ <xsl:value-of select="/parent-child/parentid"/>
+ </td>
+ </tr>
+ <tr>
+ <td class="lenya-entry-caption">
+ <label for="properties.create.child-id"><i18n:text>Document ID</i18n:text>*: </label></td>
+ <td>
+ <input class="lenya-form-element" type="text" name="properties.create.child-id"/>
+ <br/> (<i18n:text>No whitespace, no special characters</i18n:text>)</td>
+ </tr>
+ <tr>
+ <td class="lenya-entry-caption">
+ <label for="properties.create.child-name"><i18n:text>Navigation Title</i18n:text>*: </label></td>
+ <td>
+ <input class="lenya-form-element" type="text" name="properties.create.child-name"/>
+ </td>
+ </tr>
+ <tr>
+ <td class="lenya-entry-caption"><label for="properties.create.visible"><i18n:text>default.createdoc.visibleinnavigation</i18n:text></label></td>
+ <td>
+ <select class="lenya-form-element" name="properties.create.visible">
+ <option selected="true" value="yes"><i18n:text>true</i18n:text></option>
+ <option value="no"><i18n:text>false</i18n:text></option>
+ </select>
+ </td>
+ </tr>
+ <xsl:apply-templates select="allowedLanguages"/>
+ <tr>
+ <td class="lenya-entry-caption"><label for="properties.create.creator"><i18n:text>Creator</i18n:text>: </label></td>
+ <td>
+ <input class="lenya-form-element" type="text" name="properties.create.creator" value="{/parent-child/dc:creator}"/>
+ </td>
+ </tr>
+ <tr>
+ <td class="lenya-entry-caption"><label for="properties.create.subject"><i18n:text>Subject</i18n:text>: </label></td>
+ <td>
+ <input class="lenya-form-element" type="text" name="properties.create.subject"/>
+ </td>
+ </tr>
+ <tr>
+ <td class="lenya-entry-caption"><label for="properties.create.publisher"><i18n:text>Publisher</i18n:text>: </label></td>
+ <td>
+ <input class="lenya-form-element" type="text" name="properties.create.publisher" value="{/parent-child/dc:publisher}"/>
+ </td>
+ </tr>
+ <tr>
+ <td class="lenya-entry-caption"><label for="properties.create.date"><i18n:text>Date</i18n:text>: </label></td>
+ <td>
+ <input class="lenya-form-element" type="text" name="properties.create.date" value="{/parent-child/dc:date}"/>
+ </td>
+ </tr>
+ <tr>
+ <td class="lenya-entry-caption"><label for="properties.create.rights"><i18n:text>Rights</i18n:text>: </label></td>
+ <td>
+ <input class="lenya-form-element" type="text" name="properties.create.rights"/>
+ </td>
+ </tr>
+ <tr>
+ <td class="lenya-entry-caption">* <i18n:text>required fields</i18n:text>
+ </td>
+ </tr>
+ <tr>
+ <td/>
+ <td>
+ <input i18n:attr="value" type="submit" value="Create"/> 
+ <input i18n:attr="value" type="button" onClick="location.href='{/parent-child/referer}';" value="Cancel"/>
+ </td>
+ </tr>
+ </table>
+ </form>
+ </div>
+ </div>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template match="allowedLanguages">
+ <tr>
+ <td class="lenya-entry-caption">
+ <i18n:text>Language</i18n:text>*:</td>
+ <td>
+ <select class="lenya-form-element" name="properties.create.language">
+ <xsl:apply-templates select="allowedLanguage"/>
+ </select>
+ </td>
+ </tr>
+ </xsl:template>
+
+ <xsl:template match="allowedLanguage">
+ <option value="{.}">
+ <xsl:value-of select="."/>
+ </option>
+ </xsl:template>
+
+ <xsl:template match="exception">
+ <font color="red">
+ <i18n:text>EXCEPTION</i18n:text>
+ </font>
+ <br />
+ <a href="{../referer}">
+ <i18n:text>Back</i18n:text>
+ </a>
+ <br />
+ <p>
+ <i18n:text>Please check the following possible causes of the exception</i18n:text>
+ <ol>
+ <li>
+ <i18n:text key="exception.cause.createdoc.whitespace-in-id"/>
+ </li>
+ <li>
+ <i18n:text key="exception.cause.createdoc.id-in-use"/>
+ </li>
+ </ol>
+ <i18n:text>Exception handling will be improved in the near future</i18n:text>
+ </p>
+ </xsl:template>
+
+</xsl:stylesheet>
Added: lenya/branches/revolution/1.3.x/src/webapp/lenya/pubs/default13/lenya/xslt/formeditor/homepage.xsl
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/pubs/default13/lenya/xslt/formeditor/homepage.xsl?rev=577177&view=auto
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/pubs/default13/lenya/xslt/formeditor/homepage.xsl (added)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/pubs/default13/lenya/xslt/formeditor/homepage.xsl Wed Sep 19 00:09:42 2007
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!--
+ Copyright 1999-2004 The Apache Software Foundation
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<!-- $Id: xhtml.xsl 42703 2004-03-13 12:57:53Z gregor $ -->
+
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:xhtml="http://www.w3.org/1999/xhtml"
+ xmlns:lenya="http://apache.org/cocoon/lenya/page-envelope/1.0"
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+>
+
+<xsl:import href="xhtml.xsl"/>
+
+</xsl:stylesheet>
Added: lenya/branches/revolution/1.3.x/src/webapp/lenya/pubs/default13/lenya/xslt/formeditor/xhtml-common.xsl
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/pubs/default13/lenya/xslt/formeditor/xhtml-common.xsl?rev=577177&view=auto
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/pubs/default13/lenya/xslt/formeditor/xhtml-common.xsl (added)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/pubs/default13/lenya/xslt/formeditor/xhtml-common.xsl Wed Sep 19 00:09:42 2007
@@ -0,0 +1,208 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!--
+ Copyright 1999-2004 The Apache Software Foundation
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<!-- $Id: xhtml-common.xsl 153164 2005-02-10 06:00:46Z gregor $ -->
+
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:xhtml="http://www.w3.org/1999/xhtml"
+ xmlns:lenya="http://apache.org/cocoon/lenya/page-envelope/1.0"
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+>
+
+<xsl:template match="xhtml:body">
+<node name="Body" />
+<xsl:apply-templates mode="body"/>
+</xsl:template>
+
+<xsl:template name="insertmenu">
+<xsl:param name="path"/>
+<xsl:variable name="ns">namespace="http://www.w3.org/1999/xhtml"</xsl:variable>
+<insert-after select="{$path}[@tagID='{@tagID}']">
+ <element name="Paragraph" xupdate="<xupdate:insert-after select="{$path}[@tagID='{@tagID}']"><xupdate:element name="xhtml:p" {$ns}>New Paragraph</xupdate:element></xupdate:insert-after>"/>
+ <element name="Table" xupdate="<xupdate:insert-after select="{$path}[@tagID='{@tagID}']"><xupdate:element name="xhtml:table" {$ns}><tr><td>New Table</td></tr></xupdate:element></xupdate:insert-after>"/>
+ <element name="Unordered List" xupdate="<xupdate:insert-after select="{$path}[@tagID='{@tagID}']"><xupdate:element name="xhtml:ul" {$ns}><li>New Unordered List</li>;</xupdate:element></xupdate:insert-after>"/>
+ <element name="Ordered List" xupdate="<xupdate:insert-after select="{$path}[@tagID='{@tagID}']"><xupdate:element name="xhtml:ol" {$ns}><li>New Ordered List</li></xupdate:element></xupdate:insert-after>"/>
+ <element name="Headline 1" xupdate="<xupdate:insert-after select="{$path}[@tagID='{@tagID}']"><xupdate:element name="xhtml:h1" {$ns}>New Headline 1</xupdate:element></xupdate:insert-after>"/>
+ <element name="Headline 2" xupdate="<xupdate:insert-after select="{$path}[@tagID='{@tagID}']"><xupdate:element name="xhtml:h2" {$ns}>New Headline 2</xupdate:element></xupdate:insert-after>"/>
+ <element name="Headline 3" xupdate="<xupdate:insert-after select="{$path}[@tagID='{@tagID}']"><xupdate:element name="xhtml:h3" {$ns}>New Headline 3</xupdate:element></xupdate:insert-after>"/>
+ <element name="Headline 4" xupdate="<xupdate:insert-after select="{$path}[@tagID='{@tagID}']"><xupdate:element name="xhtml:h4" {$ns}>New Headline 4</xupdate:element></xupdate:insert-after>"/>
+</insert-after>
+</xsl:template>
+
+ <xsl:template match="xhtml:p" mode="body">
+ <xsl:choose >
+ <xsl:when test="xhtml:object">
+ <xsl:apply-templates select="xhtml:object" mode="body"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <node name="Paragraph" select="/*/xhtml:body/xhtml:p[@tagID='{@tagID}']">
+ <action><delete name="<xupdate:remove select="/*/xhtml:body/xhtml:p[@tagID='{@tagID}']"/>"/></action>
+ <content>
+ <textarea name="<xupdate:update select="/*/xhtml:body/xhtml:p[@tagID='{@tagID}']">" cols="40" rows="30">
+ <xsl:copy-of select="node()"/>
+ </textarea>
+ </content>
+ </node>
+
+ <xsl:call-template name="insertmenu"><xsl:with-param name="path">/*/xhtml:body/xhtml:p</xsl:with-param></xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+<xsl:template match="xhtml:table" mode="body">
+<node name="Table" select="/*/xhtml:body/xhtml:table[@tagID='{@tagID}']">
+ <action><delete name="<xupdate:remove select="/*/xhtml:body/xhtml:table[@tagID='{@tagID}']"/>"/></action>
+ <content>
+ <textarea name="<xupdate:update select="/*/xhtml:body/xhtml:table[@tagID='{@tagID}']">" cols="40" rows="30">
+ <xsl:copy-of select="."/>
+ </textarea>
+ </content>
+</node>
+
+<xsl:call-template name="insertmenu"><xsl:with-param name="path">/*/xhtml:body/xhtml:table</xsl:with-param></xsl:call-template>
+
+</xsl:template>
+
+<xsl:template match="xhtml:ul" mode="body">
+<node name="Unordered List" select="/*/xhtml:body/xhtml:ul[@tagID='{@tagID}']">
+ <action><delete name="<xupdate:remove select="/*/xhtml:body/xhtml:ul[@tagID='{@tagID}']"/>"/></action>
+ <content>
+ <textarea name="<xupdate:update select="/*/xhtml:body/xhtml:ul[@tagID='{@tagID}']">" cols="40" rows="30">
+ <xsl:copy-of select="node()"/>
+ </textarea>
+ </content>
+</node>
+
+<xsl:call-template name="insertmenu"><xsl:with-param name="path">/*/xhtml:body/xhtml:ul</xsl:with-param></xsl:call-template>
+
+</xsl:template>
+
+<xsl:template match="xhtml:ol" mode="body">
+<node name="Ordered List" select="/*/xhtml:body/xhtml:ol[@tagID='{@tagID}']">
+ <action><delete name="<xupdate:remove select="/*/xhtml:body/xhtml:ol[@tagID='{@tagID}']"/>"/></action>
+ <content>
+ <textarea name="<xupdate:update select="/*/xhtml:body/xhtml:ol[@tagID='{@tagID}']">" cols="40" rows="30">
+ <xsl:copy-of select="node()"/>
+ </textarea>
+ </content>
+</node>
+
+<xsl:call-template name="insertmenu"><xsl:with-param name="path">/*/xhtml:body/xhtml:ol</xsl:with-param></xsl:call-template>
+
+</xsl:template>
+
+<xsl:template match="xhtml:h1" mode="body">
+<node name="Headline 1" select="/*/xhtml:body/xhtml:h1[@tagID='{@tagID}']">
+ <action><delete name="<xupdate:remove select="/*/xhtml:body/xhtml:h1[@tagID='{@tagID}']"/>"/></action>
+ <content>
+ <textarea name="<xupdate:update select="/*/xhtml:body/xhtml:h1[@tagID='{@tagID}']">" cols="40" rows="3">
+ <xsl:copy-of select="node()"/>
+ </textarea>
+ </content>
+</node>
+
+<xsl:call-template name="insertmenu"><xsl:with-param name="path">/*/xhtml:body/xhtml:h1</xsl:with-param></xsl:call-template>
+
+</xsl:template>
+
+<xsl:template match="xhtml:h2" mode="body">
+<node name="Headline 2" select="/*/xhtml:body/xhtml:h2[@tagID='{@tagID}']">
+ <action><delete name="<xupdate:remove select="/*/xhtml:body/xhtml:h2[@tagID='{@tagID}']"/>"/></action>
+ <content>
+ <textarea name="<xupdate:update select="/*/xhtml:body/xhtml:h2[@tagID='{@tagID}']">" cols="40" rows="3">
+ <xsl:copy-of select="node()"/>
+ </textarea>
+ </content>
+</node>
+
+<xsl:call-template name="insertmenu"><xsl:with-param name="path">/*/xhtml:body/xhtml:h2</xsl:with-param></xsl:call-template>
+
+</xsl:template>
+
+<xsl:template match="xhtml:h3" mode="body">
+<node name="Headline 3" select="/*/xhtml:body/xhtml:h3[@tagID='{@tagID}']">
+ <action><delete name="<xupdate:remove select="/*/xhtml:body/xhtml:h3[@tagID='{@tagID}']"/>"/></action>
+ <content>
+ <textarea name="<xupdate:update select="/*/xhtml:body/xhtml:h3[@tagID='{@tagID}']">" cols="40" rows="3">
+ <xsl:copy-of select="node()"/>
+ </textarea>
+ </content>
+</node>
+
+<xsl:call-template name="insertmenu"><xsl:with-param name="path">/*/xhtml:body/xhtml:h3</xsl:with-param></xsl:call-template>
+
+</xsl:template>
+
+<xsl:template match="xhtml:h4" mode="body">
+<node name="Headline 4" select="/*/xhtml:body/xhtml:h4[@tagID='{@tagID}']">
+ <action><delete name="<xupdate:remove select="/*/xhtml:body/xhtml:h4[@tagID='{@tagID}']"/>"/></action>
+ <content>
+ <textarea name="<xupdate:update select="/*/xhtml:body/xhtml:h4[@tagID='{@tagID}']">" cols="40" rows="3">
+ <xsl:copy-of select="node()"/>
+ </textarea>
+ </content>
+</node>
+
+<xsl:call-template name="insertmenu"><xsl:with-param name="path">/*/xhtml:body/xhtml:h4</xsl:with-param></xsl:call-template>
+
+</xsl:template>
+
+<xsl:template match="xhtml:hr" mode="body">
+<node name="Horizontal Rule" select="/*/xhtml:body/xhtml:hr[@tagID='{@tagID}']">
+ <action><delete name="<xupdate:remove select="/*/xhtml:body/xhtml:hr[@tagID='{@tagID}']"/>"/></action>
+</node>
+
+<xsl:call-template name="insertmenu"><xsl:with-param name="path">/*/xhtml:body/xhtml:hr</xsl:with-param></xsl:call-template>
+
+</xsl:template>
+
+ <xsl:template match="xhtml:object" mode="body">
+ <node name="Object">
+ <action><delete name="<xupdate:remove select="/*/xhtml:body/xhtml:p/xhtml:object[@tagID='{@tagID}']"/>"/></action>
+ <content>
+ <input type="text" name="<xupdate:update select="/*/xhtml:body/xhtml:p/xhtml:object[@tagID='{@tagID}']">" size="40">
+ <xsl:attribute name="value">
+ <xsl:value-of select="@data"/>
+ </xsl:attribute>
+ </input>
+ </content>
+ </node>
+
+ <xsl:call-template name="insertmenu"><xsl:with-param name="path">/*/xhtml:body</xsl:with-param></xsl:call-template>
+
+ </xsl:template>
+
+ <xsl:template match="lenya:asset" mode="body">
+ <node name="Asset">
+ <action>
+ <delete name="<xupdate:remove select="/*/xhtml:body/lenya:asset[@tagID='{@tagID}']"/>"/>
+ </action>
+ <content>
+ <input type="text" name="<xupdate:update select="/*/xhtml:body/lenya:asset[@tagID='{@tagID}']">" size="40">
+ <xsl:attribute name="value">
+ <xsl:value-of select="@src"/>
+ </xsl:attribute>
+ </input>
+ </content>
+ </node>
+
+ <xsl:call-template name="insertmenu"><xsl:with-param name="path">/*/xhtml:body</xsl:with-param></xsl:call-template>
+
+ </xsl:template>
+
+</xsl:stylesheet>
\ No newline at end of file
Added: lenya/branches/revolution/1.3.x/src/webapp/lenya/pubs/default13/lenya/xslt/formeditor/xhtml.xsl
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/pubs/default13/lenya/xslt/formeditor/xhtml.xsl?rev=577177&view=auto
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/pubs/default13/lenya/xslt/formeditor/xhtml.xsl (added)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/pubs/default13/lenya/xslt/formeditor/xhtml.xsl Wed Sep 19 00:09:42 2007
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!--
+ Copyright 1999-2004 The Apache Software Foundation
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<!-- $Id: xhtml.xsl 413285 2006-06-10 11:10:23Z thorsten $ -->
+
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:xhtml="http://www.w3.org/1999/xhtml"
+ xmlns:lenya="http://apache.org/cocoon/lenya/page-envelope/1.0"
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+>
+
+<xsl:import href="../../../../../xslt/authoring/edit/form.xsl"/>
+<xsl:import href="xhtml-common.xsl"/>
+
+<xsl:template match="xhtml:html">
+<node name="Title" select="/xhtml:html/lenya:meta/dc:title[@tagID='{lenya:meta/dc:title/@tagID}']">
+ <content><input type="text" name="<xupdate:update select="/xhtml:html/lenya:meta/dc:title[@tagID='{lenya:meta/dc:title/@tagID}']">" size="40"><xsl:attribute name="value"><xsl:value-of select="lenya:meta/dc:title"/></xsl:attribute></input></content>
+</node>
+
+<xsl:apply-templates select="xhtml:body"/>
+
+</xsl:template>
+
+</xsl:stylesheet>
Added: lenya/branches/revolution/1.3.x/src/webapp/lenya/pubs/default13/lenya/xslt/navigation/search.xsl
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/pubs/default13/lenya/xslt/navigation/search.xsl?rev=577177&view=auto
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/pubs/default13/lenya/xslt/navigation/search.xsl (added)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/pubs/default13/lenya/xslt/navigation/search.xsl Wed Sep 19 00:09:42 2007
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+ Copyright 1999-2004 The Apache Software Foundation
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<!-- $Id: search.xsl 76018 2004-11-16 20:12:54Z gregor $ -->
+
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:nav="http://apache.org/cocoon/lenya/navigation/1.0"
+ xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
+ xmlns="http://www.w3.org/1999/xhtml"
+ exclude-result-prefixes="nav"
+ >
+
+<xsl:param name="area"/>
+<xsl:param name="root"/>
+<xsl:param name="chosenlanguage"/>
+
+<xsl:template match="nav:site">
+ <div id="search">
+ <form><input type="hidden" name="lenya.usecase" value="search"/><input type="hidden" name="language" value="{$chosenlanguage}"/><input class="searchfield" type="text" name="query" alt="Search field"/><input class="searchsubmit" i18n:attr="value" type="submit" value="Search" name="find"/></form>
+ </div>
+</xsl:template>
+
+<xsl:template match="@*|node()">
+ <xsl:copy>
+ <xsl:apply-templates select="@*|node()"/>
+ </xsl:copy>
+</xsl:template>
+
+</xsl:stylesheet>
Added: lenya/branches/revolution/1.3.x/src/webapp/lenya/pubs/default13/lenya/xslt/navigation/tabs.xsl
URL: http://svn.apache.org/viewvc/lenya/branches/revolution/1.3.x/src/webapp/lenya/pubs/default13/lenya/xslt/navigation/tabs.xsl?rev=577177&view=auto
==============================================================================
--- lenya/branches/revolution/1.3.x/src/webapp/lenya/pubs/default13/lenya/xslt/navigation/tabs.xsl (added)
+++ lenya/branches/revolution/1.3.x/src/webapp/lenya/pubs/default13/lenya/xslt/navigation/tabs.xsl Wed Sep 19 00:09:42 2007
@@ -0,0 +1,84 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+ Copyright 1999-2004 The Apache Software Foundation
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<!-- $Id: tabs.xsl 189879 2005-06-10 02:36:04Z gregor $ -->
+
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:nav="http://apache.org/cocoon/lenya/navigation/1.0"
+ xmlns="http://www.w3.org/1999/xhtml"
+ exclude-result-prefixes="nav"
+ >
+
+<xsl:import href="../../../../../xslt/navigation/tabs.xsl"/>
+
+<xsl:template match="nav:site">
+
+ <div id="tabs">
+ <table border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <xsl:call-template name="pre-separator"/>
+ <xsl:for-each select="nav:node">
+ <xsl:if test="position() > 1">
+ <xsl:call-template name="separator"/>
+ </xsl:if>
+
+ <xsl:choose>
+ <xsl:when test="@visibleinnav = 'false'"/>
+ <xsl:when test="descendant-or-self::nav:node[@current = 'true']">
+ <xsl:call-template name="tab-selected"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="tab"/>
+ </xsl:otherwise>
+ </xsl:choose>
+
+ </xsl:for-each>
+ <xsl:call-template name="post-separator"/>
+ </tr>
+ </table>
+ </div>
+
+</xsl:template>
+
+
+<xsl:template name="tab">
+ <td><div class="tab"><xsl:call-template name="label"/></div></td>
+</xsl:template>
+
+
+<xsl:template name="tab-selected">
+ <td><div class="tab-selected"><xsl:call-template name="label"/></div></td>
+</xsl:template>
+
+
+<xsl:template name="separator">
+ <td><div class="tab-separator"> </div></td>
+</xsl:template>
+
+
+<xsl:template name="pre-separator">
+ <td><div class="tab-pre-separator"> </div></td>
+</xsl:template>
+
+
+<xsl:template name="post-separator">
+ <td class="tab-post-separator"><div class="tab-separator"> </div></td>
+</xsl:template>
+
+
+</xsl:stylesheet>
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@lenya.apache.org
For additional commands, e-mail: commits-help@lenya.apache.org