View | Details | Raw Unified | Return to bug 34088
Collapse All | Expand All

(-)java/src/org/apache/lenya/defaultpub/cms/usecases/Delete.java (+90 lines)
Line 0 Link Here
1
/*
2
 * Copyright  1999-2004 The Apache Software Foundation
3
 *
4
 *  Licensed under the Apache License, Version 2.0 (the "License");
5
 *  you may not use this file except in compliance with the License.
6
 *  You may obtain a copy of the License at
7
 *
8
 *      http://www.apache.org/licenses/LICENSE-2.0
9
 *
10
 *  Unless required by applicable law or agreed to in writing, software
11
 *  distributed under the License is distributed on an "AS IS" BASIS,
12
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
 *  See the License for the specific language governing permissions and
14
 *  limitations under the License.
15
 *
16
 */
17
package org.apache.lenya.defaultpub.cms.usecases;
18
19
import org.apache.lenya.cms.publication.Document;
20
import org.apache.lenya.cms.publication.util.DocumentSet;
21
import org.apache.lenya.cms.site.SiteException;
22
import org.apache.lenya.cms.site.SiteManager;
23
import org.apache.lenya.cms.workflow.WorkflowManager;
24
25
/**
26
 * Delete usecase handler.
27
 * 
28
 * @version $Id:$
29
 */
30
public class Delete extends org.apache.lenya.cms.site.usecases.Delete {
31
32
    /**
33
     * @see org.apache.lenya.cms.usecase.AbstractUsecase#doCheckPreconditions()
34
     */
35
    protected void doCheckPreconditions() throws Exception {
36
        super.doCheckPreconditions();
37
        DocumentSet set = getSubset();
38
        WorkflowManager wfManager = null;
39
        try {
40
            wfManager = (WorkflowManager) this.manager.lookup(WorkflowManager.ROLE);
41
            if (!wfManager.canInvoke(set, getEvent())) {
42
                addErrorMessage("The workflow event cannot be invoked on all documents.");
43
            }
44
        } finally {
45
            if (wfManager != null) {
46
                this.manager.release(wfManager);
47
            }
48
        }
49
    }
50
    
51
    /**
52
     * @return The workflow event.
53
     */
54
    protected String getEvent() {
55
        return "delete";
56
    }
57
58
    /**
59
     * @see org.apache.lenya.cms.usecase.AbstractUsecase#doExecute()
60
     */
61
    protected void doExecute() throws Exception {
62
63
        DocumentSet set = getSubset();
64
        WorkflowManager wfManager = null;
65
        try {
66
            wfManager = (WorkflowManager) this.manager.lookup(WorkflowManager.ROLE);
67
            wfManager.invoke(set, getEvent(), true);
68
        } finally {
69
            if (wfManager != null) {
70
                this.manager.release(wfManager);
71
            }
72
        }
73
74
        super.doExecute();
75
    }
76
77
    /**
78
     * @return A document set containing all requiring resources and the source
79
     * document itself.
80
     * @throws SiteException if an error occurs.
81
     */
82
    protected DocumentSet getSubset() throws SiteException {
83
        Document document = getSourceDocument();
84
        SiteManager manager = document.getPublication().getSiteManager();
85
        DocumentSet set = new DocumentSet(manager.getRequiringResources(document));
86
        set.add(document);
87
        return set;
88
    }
89
90
}
(-)java/src/org/apache/lenya/defaultpub/cms/usecases/Publish.java (+270 lines)
Line 0 Link Here
1
/*
2
 * Copyright  1999-2004 The Apache Software Foundation
3
 *
4
 *  Licensed under the Apache License, Version 2.0 (the "License");
5
 *  you may not use this file except in compliance with the License.
6
 *  You may obtain a copy of the License at
7
 *
8
 *      http://www.apache.org/licenses/LICENSE-2.0
9
 *
10
 *  Unless required by applicable law or agreed to in writing, software
11
 *  distributed under the License is distributed on an "AS IS" BASIS,
12
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
 *  See the License for the specific language governing permissions and
14
 *  limitations under the License.
15
 *
16
 */
17
package org.apache.lenya.defaultpub.cms.usecases;
18
19
import java.text.DateFormat;
20
import java.text.ParseException;
21
import java.text.SimpleDateFormat;
22
import java.util.ArrayList;
23
import java.util.Date;
24
import java.util.GregorianCalendar;
25
import java.util.List;
26
27
import org.apache.lenya.cms.publication.Document;
28
import org.apache.lenya.cms.publication.DocumentFactory;
29
import org.apache.lenya.cms.publication.Publication;
30
import org.apache.lenya.cms.publication.PublicationException;
31
import org.apache.lenya.cms.publication.util.DocumentVisitor;
32
import org.apache.lenya.cms.publication.util.OrderedDocumentSet;
33
import org.apache.lenya.cms.site.SiteManager;
34
import org.apache.lenya.cms.usecase.DocumentUsecase;
35
import org.apache.lenya.cms.usecase.scheduling.UsecaseScheduler;
36
import org.apache.lenya.cms.workflow.WorkflowManager;
37
import org.apache.lenya.workflow.WorkflowException;
38
39
/**
40
 * Publish usecase handler.
41
 * 
42
 * @version $Id$
43
 */
44
public class Publish extends DocumentUsecase implements DocumentVisitor {
45
46
    protected static final String MISSING_DOCUMENTS = "missingDocuments";
47
    protected static final String SUBTREE = "subtree";
48
    protected static final String ALLOW_SINGLE_DOCUMENT = "allowSingleDocument";
49
    protected static final String SCHEDULE = "schedule";
50
    protected static final String SCHEDULE_TIME = "schedule.time";
51
52
    /**
53
     * @see org.apache.lenya.cms.usecase.AbstractUsecase#initParameters()
54
     */
55
    protected void initParameters() {
56
        super.initParameters();
57
58
        Date now = new GregorianCalendar().getTime();
59
        DateFormat format = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
60
        setParameter(SCHEDULE_TIME, format.format(now));
61
    }
62
63
    /**
64
     * Checks if the workflow event is supported and the parent of the document exists in the live
65
     * area.
66
     * 
67
     * @see org.apache.lenya.cms.usecase.AbstractUsecase#doCheckPreconditions()
68
     */
69
    protected void doCheckPreconditions() throws Exception {
70
        super.doCheckPreconditions();
71
        if (getErrorMessages().isEmpty()) {
72
73
            String event = getEvent();
74
            Document document = getSourceDocument();
75
76
            if (!document.getArea().equals(Publication.AUTHORING_AREA)) {
77
                addErrorMessage("This usecase can only be invoked from the authoring area.");
78
                return;
79
            }
80
81
            WorkflowManager wfManager = null;
82
            try {
83
                wfManager = (WorkflowManager) this.manager.lookup(WorkflowManager.ROLE);
84
                if (!wfManager.canInvoke(getSourceDocument(), event)) {
85
                    setParameter(ALLOW_SINGLE_DOCUMENT, Boolean.toString(false));
86
                    addInfoMessage("The single document cannot be published because the workflow event cannot be invoked.");
87
                } else {
88
                    setParameter(ALLOW_SINGLE_DOCUMENT, Boolean.toString(true));
89
                }
90
            } finally {
91
                if (wfManager != null) {
92
                    this.manager.release(wfManager);
93
                }
94
            }
95
96
            Publication publication = document.getPublication();
97
98
            Document liveDocument = publication.getAreaVersion(document, Publication.LIVE_AREA);
99
100
            List missingDocuments = new ArrayList();
101
102
            SiteManager manager = publication.getSiteManager();
103
            Document[] requiredDocuments = manager.getRequiredResources(liveDocument);
104
            for (int i = 0; i < requiredDocuments.length; i++) {
105
                if (!manager.containsInAnyLanguage(requiredDocuments[i])) {
106
                    Document authoringVersion = publication.getAreaVersion(requiredDocuments[i],
107
                            Publication.AUTHORING_AREA);
108
                    missingDocuments.add(authoringVersion);
109
                }
110
            }
111
112
            if (!missingDocuments.isEmpty()) {
113
                addErrorMessage("Cannot publish document unless the following documents are published:");
114
                setParameter(MISSING_DOCUMENTS, missingDocuments);
115
            }
116
        }
117
    }
118
119
    /**
120
     * @see org.apache.lenya.cms.usecase.AbstractUsecase#doExecute()
121
     */
122
    protected void doExecute() throws Exception {
123
124
        boolean schedule = Boolean.valueOf(getBooleanCheckboxParameter(SCHEDULE)).booleanValue();
125
        if (schedule) {
126
            deleteParameter(SCHEDULE);
127
            String dateString = getParameterAsString(SCHEDULE_TIME);
128
            DateFormat format = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
129
            UsecaseScheduler scheduler = null;
130
            try {
131
                Date date = null;
132
                try {
133
                    date = format.parse(dateString);
134
                } catch (ParseException e) {
135
                    addErrorMessage("The scheduler date must be of the form 'yyyy-MM-dd hh:mm:ss'.");
136
                }
137
                if (date != null) {
138
                    scheduler = (UsecaseScheduler) this.manager.lookup(UsecaseScheduler.ROLE);
139
                    scheduler.schedule(this, date);
140
                }
141
            } finally {
142
                if (scheduler != null) {
143
                    this.manager.release(scheduler);
144
                }
145
            }
146
        } else {
147
            super.doExecute();
148
            if (isSubtreeEnabled()) {
149
                publishAll(getSourceDocument());
150
            } else {
151
                publish(getSourceDocument());
152
            }
153
        }
154
    }
155
156
    /**
157
     * Publishes a document.
158
     * @param authoringDocument The authoring document.
159
     */
160
    protected void publish(Document authoringDocument) {
161
162
        WorkflowManager wfManager = null;
163
        try {
164
            wfManager = (WorkflowManager) this.manager.lookup(WorkflowManager.ROLE);
165
            getDocumentManager().copyDocumentToArea(authoringDocument, Publication.LIVE_AREA);
166
            wfManager.invoke(authoringDocument, getEvent());
167
        } catch (Exception e) {
168
            throw new RuntimeException(e);
169
        } finally {
170
            if (wfManager != null) {
171
                this.manager.release(wfManager);
172
            }
173
        }
174
    }
175
176
    /**
177
     * @return The event to invoke.
178
     */
179
    private String getEvent() {
180
        return "publish";
181
    }
182
183
    /**
184
     * Publishes a document or the subtree below a document, based on the parameter SUBTREE.
185
     * @param document The document.
186
     */
187
    protected void publishAll(Document document) {
188
189
        if (getLogger().isDebugEnabled()) {
190
            getLogger().debug("Publishing document [" + document + "]");
191
            getLogger().debug("Subtree publishing: [" + isSubtreeEnabled() + "]");
192
        }
193
194
        try {
195
196
            OrderedDocumentSet set = new OrderedDocumentSet();
197
            SiteManager manager = document.getPublication().getSiteManager();
198
            Document[] descendants = manager.getRequiringResources(document);
199
200
            set = new OrderedDocumentSet(descendants);
201
            set.add(document);
202
            set.visitAscending(this);
203
        } catch (Exception e) {
204
            throw new RuntimeException(e);
205
        }
206
207
        if (getLogger().isDebugEnabled()) {
208
            getLogger().debug("Publishing completed.");
209
        }
210
    }
211
212
    /**
213
     * Returns whether subtree publishing is enabled.
214
     * @return A boolean value.
215
     */
216
    protected boolean isSubtreeEnabled() {
217
        String value = getParameterAsString(SUBTREE);
218
        return value != null;
219
    }
220
221
    /**
222
     * @throws PublicationException
223
     * @see org.apache.lenya.cms.publication.util.DocumentVisitor#visitDocument(org.apache.lenya.cms.publication.Document)
224
     */
225
    public void visitDocument(Document document) throws PublicationException {
226
227
        if (getLogger().isDebugEnabled()) {
228
            getLogger().debug("Visiting resource [" + document + "]");
229
        }
230
231
        try {
232
            publishAllLanguageVersions(document);
233
        } catch (WorkflowException e) {
234
            throw new PublicationException(e);
235
        }
236
    }
237
238
    /**
239
     * Publishes all existing language versions of a document.
240
     * @param document The document.
241
     * @throws PublicationException if an error occurs.
242
     * @throws WorkflowException
243
     */
244
    protected void publishAllLanguageVersions(Document document) throws PublicationException,
245
            WorkflowException {
246
        String[] languages = document.getPublication().getLanguages();
247
        DocumentFactory factory = document.getIdentityMap().getFactory();
248
249
        WorkflowManager wfManager = null;
250
        try {
251
            wfManager = (WorkflowManager) this.manager.lookup(WorkflowManager.ROLE);
252
            for (int i = 0; i < languages.length; i++) {
253
                Document version = factory.getLanguageVersion(document, languages[i]);
254
                if (version.exists()) {
255
                    if (wfManager.canInvoke(version, getEvent())) {
256
                        publish(version);
257
                    }
258
                }
259
            }
260
        } catch (Exception e) {
261
            throw new RuntimeException(e);
262
        } finally {
263
            if (wfManager != null) {
264
                this.manager.release(wfManager);
265
            }
266
        }
267
268
    }
269
270
}
0
  + Id
271
  + Id
1
  + native
272
  + native
(-)java/src/org/apache/lenya/defaultpub/cms/usecases/Deactivate.java (+211 lines)
Line 0 Link Here
1
/*
2
 * Copyright  1999-2004 The Apache Software Foundation
3
 *
4
 *  Licensed under the Apache License, Version 2.0 (the "License");
5
 *  you may not use this file except in compliance with the License.
6
 *  You may obtain a copy of the License at
7
 *
8
 *      http://www.apache.org/licenses/LICENSE-2.0
9
 *
10
 *  Unless required by applicable law or agreed to in writing, software
11
 *  distributed under the License is distributed on an "AS IS" BASIS,
12
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
 *  See the License for the specific language governing permissions and
14
 *  limitations under the License.
15
 *
16
 */
17
package org.apache.lenya.defaultpub.cms.usecases;
18
19
import org.apache.avalon.framework.service.ServiceException;
20
import org.apache.lenya.cms.publication.Document;
21
import org.apache.lenya.cms.publication.DocumentFactory;
22
import org.apache.lenya.cms.publication.Publication;
23
import org.apache.lenya.cms.publication.PublicationException;
24
import org.apache.lenya.cms.publication.util.DocumentVisitor;
25
import org.apache.lenya.cms.publication.util.OrderedDocumentSet;
26
import org.apache.lenya.cms.site.SiteManager;
27
import org.apache.lenya.cms.usecase.DocumentUsecase;
28
import org.apache.lenya.cms.workflow.WorkflowManager;
29
import org.apache.lenya.workflow.WorkflowException;
30
31
/**
32
 * Deactivate usecase handler.
33
 * 
34
 * @version $Id:$
35
 */
36
public class Deactivate extends DocumentUsecase implements DocumentVisitor {
37
38
    /**
39
     * Checks if the workflow event is supported and the parent of the document
40
     * exists in the live area.
41
     * 
42
     * @see org.apache.lenya.cms.usecase.AbstractUsecase#doCheckPreconditions()
43
     */
44
    protected void doCheckPreconditions() throws Exception {
45
        super.doCheckPreconditions();
46
        if (getErrorMessages().isEmpty()) {
47
48
            if (!getSourceDocument().getArea().equals(Publication.AUTHORING_AREA)) {
49
                addErrorMessage("This usecase can only be invoked from the authoring area.");
50
                return;
51
            }
52
53
            String event = getEvent();
54
55
            WorkflowManager wfManager = null;
56
            try {
57
                wfManager = (WorkflowManager) this.manager.lookup(WorkflowManager.ROLE);
58
                if (!wfManager.canInvoke(getSourceDocument(), event)) {
59
                    setParameter(Publish.ALLOW_SINGLE_DOCUMENT, Boolean.toString(false));
60
                    addInfoMessage("The single document cannot be deactivated because the workflow event cannot be invoked.");
61
                } else {
62
                    setParameter(Publish.ALLOW_SINGLE_DOCUMENT, Boolean.toString(true));
63
                }
64
            } finally {
65
                if (wfManager != null) {
66
                    this.manager.release(wfManager);
67
                }
68
            }
69
70
        }
71
    }
72
73
    /**
74
     * @see org.apache.lenya.cms.usecase.AbstractUsecase#doExecute()
75
     */
76
    protected void doExecute() throws Exception {
77
        super.doExecute();
78
        if (isSubtreeEnabled()) {
79
            deactivateAll(getSourceDocument());
80
        } else {
81
            deactivate(getSourceDocument());
82
        }
83
    }
84
85
    /**
86
     * Deactivates a document.
87
     * @param authoringDocument The authoring document.
88
     */
89
    protected void deactivate(Document authoringDocument) {
90
91
        Publication publication = authoringDocument.getPublication();
92
        boolean success = false;
93
94
        WorkflowManager wfManager = null;
95
        try {
96
            wfManager = (WorkflowManager) this.manager.lookup(WorkflowManager.ROLE);
97
            Document liveDocument = publication.getAreaVersion(authoringDocument,
98
                    Publication.LIVE_AREA);
99
            getDocumentManager().deleteDocument(liveDocument);
100
101
            wfManager.invoke(authoringDocument, getEvent());
102
            success = true;
103
        } catch (Exception e) {
104
            throw new RuntimeException(e);
105
        } finally {
106
            if (getLogger().isDebugEnabled()) {
107
                getLogger().debug("Deactivate document [" + authoringDocument + "]. Success: ["
108
                        + success + "]");
109
            }
110
            if (wfManager != null) {
111
                this.manager.release(wfManager);
112
            }
113
        }
114
115
    }
116
117
    /**
118
     * @return The event to invoke.
119
     */
120
    private String getEvent() {
121
        return "deactivate";
122
    }
123
124
    /**
125
     * Deactivates a document or the subtree below a document, based on the
126
     * parameter SUBTREE.
127
     * @param document The document.
128
     */
129
    protected void deactivateAll(Document document) {
130
131
        if (getLogger().isDebugEnabled()) {
132
            getLogger().debug("Deactivating document [" + document + "]");
133
            getLogger().debug("Subtree deactivation: [" + isSubtreeEnabled() + "]");
134
        }
135
136
        try {
137
138
            OrderedDocumentSet set = new OrderedDocumentSet();
139
            SiteManager manager = document.getPublication().getSiteManager();
140
            Document[] descendants = manager.getRequiringResources(document);
141
142
            set = new OrderedDocumentSet(descendants);
143
            set.add(document);
144
            set.visitDescending(this);
145
        } catch (Exception e) {
146
            throw new RuntimeException(e);
147
        }
148
149
        if (getLogger().isDebugEnabled()) {
150
            getLogger().debug("Publishing completed.");
151
        }
152
    }
153
154
    /**
155
     * Returns whether subtree publishing is enabled.
156
     * @return A boolean value.
157
     */
158
    protected boolean isSubtreeEnabled() {
159
        String value = getParameterAsString(Publish.SUBTREE);
160
        return value != null;
161
    }
162
163
    /**
164
     * @throws PublicationException
165
     * @see org.apache.lenya.cms.publication.util.DocumentVisitor#visitDocument(org.apache.lenya.cms.publication.Document)
166
     */
167
    public void visitDocument(Document document) throws PublicationException {
168
169
        if (getLogger().isDebugEnabled()) {
170
            getLogger().debug("Visiting resource [" + document + "]");
171
        }
172
173
        try {
174
            deactivateAllLanguageVersions(document);
175
        } catch (WorkflowException e) {
176
            throw new PublicationException(e);
177
        }
178
    }
179
180
    /**
181
     * Publishes all existing language versions of a document.
182
     * @param document The document.
183
     * @throws PublicationException if an error occurs.
184
     * @throws WorkflowException
185
     */
186
    protected void deactivateAllLanguageVersions(Document document) throws PublicationException,
187
            WorkflowException {
188
        String[] languages = document.getPublication().getLanguages();
189
        DocumentFactory factory = document.getIdentityMap().getFactory();
190
        WorkflowManager wfManager = null;
191
        try {
192
            wfManager = (WorkflowManager) this.manager.lookup(WorkflowManager.ROLE);
193
            for (int i = 0; i < languages.length; i++) {
194
                Document version = factory.getLanguageVersion(document, languages[i]);
195
                if (version.exists()) {
196
                    if (wfManager.canInvoke(getSourceDocument(), getEvent())) {
197
                        deactivate(version);
198
                    }
199
                }
200
            }
201
        } catch (ServiceException e) {
202
            throw new RuntimeException(e);
203
        } finally {
204
            if (wfManager != null) {
205
                this.manager.release(wfManager);
206
            }
207
        }
208
209
    }
210
211
}
(-)parameter-doctype.xmap (-21 / +12 lines)
Lines 20-30 Link Here
20
<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
20
<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
21
21
22
  <map:components>
22
  <map:components>
23
    <map:generators default="file"/>
24
    <map:transformers default="xslt"/>
25
    <map:readers default="resource"/>
26
    <map:serializers default="html"/>
27
    <map:matchers default="wildcard"/>
28
    <map:actions>
23
    <map:actions>
29
      <map:action logger="sitemap.action.sourcetype" name="sourcetype" src="org.apache.cocoon.acting.sourcetype.SourceTypeAction">
24
      <map:action logger="sitemap.action.sourcetype" name="sourcetype" src="org.apache.cocoon.acting.sourcetype.SourceTypeAction">
30
        <sourcetype name="xhtml">
25
        <sourcetype name="xhtml">
Lines 37-46 Link Here
37
    </map:actions>
32
    </map:actions>
38
  </map:components>
33
  </map:components>
39
34
40
  <map:views/>
41
42
  <map:resources/>
43
44
  <map:pipelines>
35
  <map:pipelines>
45
36
46
    <map:pipeline>
37
    <map:pipeline>
Lines 56-79 Link Here
56
    <map:pipeline>
47
    <map:pipeline>
57
      <!-- {area}/{uri} -->
48
      <!-- {area}/{uri} -->
58
      <map:match pattern="*/**.html">
49
      <map:match pattern="*/**.html">
59
	<map:act type="sourcetype" src="content/{1}/{page-envelope:document-path}">
50
        <map:act type="sourcetype" src="fallback://content/{1}/{page-envelope:document-path}">
60
	  <map:generate type="serverpages" src="../../config/parameters/default.xsp">
51
          <map:generate type="serverpages" src="../../config/parameters/default.xsp">
61
	    <map:parameter name="value" value="{sourcetype}"/>
52
            <map:parameter name="value" value="{sourcetype}"/>
62
	  </map:generate>
53
          </map:generate>
63
	  <map:serialize type="xml"/>
54
          <map:serialize type="xml"/>
64
	</map:act>
55
        </map:act>
65
      </map:match>
56
      </map:match>
66
    </map:pipeline>
57
    </map:pipeline>
67
    
58
    
68
    <map:pipeline>
59
    <map:pipeline>
69
      <!-- {area}/{uri} -->
60
      <!-- {area}/{uri} -->
70
      <map:match pattern="*/**.xml">
61
      <map:match pattern="*/**.xml">
71
	<map:act type="sourcetype" src="content/{1}/{2}.xml">
62
        <map:act type="sourcetype" src="fallback://content/{1}/{2}.xml">
72
	  <map:generate type="serverpages" src="../../config/parameters/default.xsp">
63
          <map:generate type="serverpages" src="../../config/parameters/default.xsp">
73
	    <map:parameter name="value" value="{sourcetype}"/>
64
            <map:parameter name="value" value="{sourcetype}"/>
74
	  </map:generate>
65
          </map:generate>
75
	  <map:serialize type="xml"/>
66
          <map:serialize type="xml"/>
76
	</map:act>
67
        </map:act>
77
      </map:match>
68
      </map:match>
78
    </map:pipeline>
69
    </map:pipeline>
79
70
(-)xslt/page2xhtml.xsl (-42 / +13 lines)
Lines 24-32 Link Here
24
    xmlns:page="http://apache.org/cocoon/lenya/cms-page/1.0"
24
    xmlns:page="http://apache.org/cocoon/lenya/cms-page/1.0"
25
    xmlns:lenya="http://apache.org/cocoon/lenya/page-envelope/1.0" 
25
    xmlns:lenya="http://apache.org/cocoon/lenya/page-envelope/1.0" 
26
    xmlns:dc="http://purl.org/dc/elements/1.1/"
26
    xmlns:dc="http://purl.org/dc/elements/1.1/"
27
    xmlns:dcterms="http://purl.org/dc/terms/"
27
    exclude-result-prefixes="page xhtml dc lenya"
28
    xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
29
    exclude-result-prefixes="page xhtml"
30
    >
28
    >
31
    
29
    
32
    
30
    
Lines 39-51 Link Here
39
<!-- The rquest url i.e. /lenya/doctypes/xhtml-document_en.html -->
37
<!-- The rquest url i.e. /lenya/doctypes/xhtml-document_en.html -->
40
<xsl:param name="url"/>
38
<xsl:param name="url"/>
41
39
40
<xsl:param name="document-type"/>
42
41
43
<xsl:template match="cmsbody">
42
<xsl:template match="cmsbody">
44
  <html>
43
  <html>
45
    <head>
44
    <head>
46
      <link rel="stylesheet" href="{$root}/css/page.css" type="text/css"/>
45
      <link rel="stylesheet" href="{$root}/css/page.css" type="text/css"/>
46
      <!-- Load doctype-specific CSS -->
47
      <xsl:choose>
48
        <xsl:when test="$document-type">
49
            <link rel="stylesheet" href="{$root}/css/{$document-type}.css" type="text/css"/>
50
        </xsl:when>
51
        <xsl:otherwise>
52
            <!-- do nothing -->
53
        </xsl:otherwise>
54
      </xsl:choose>
47
      <meta content="Apache Lenya" name="generator"/>
55
      <meta content="Apache Lenya" name="generator"/>
48
      <title><xsl:value-of select="//lenya:meta/dc:title"/></title>
56
      <title><xsl:value-of select="//lenya:meta/dc:title"/></title>
57
      <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8"/>
49
    </head>	
58
    </head>	
50
    <body>
59
    <body>
51
      <div id="page">
60
      <div id="page">
Lines 58-64 Link Here
58
      <xsl:apply-templates select="xhtml:div[@id = 'tabs']"/>
67
      <xsl:apply-templates select="xhtml:div[@id = 'tabs']"/>
59
      <table width="100%" border="0" cellpadding="0" cellspacing="0">
68
      <table width="100%" border="0" cellpadding="0" cellspacing="0">
60
        <tr>
69
        <tr>
61
          <td valign="top" width="230px">
70
          <td valign="top" style="width: 230px">
62
            <xsl:apply-templates select="xhtml:div[@id = 'menu']"/>
71
            <xsl:apply-templates select="xhtml:div[@id = 'menu']"/>
63
          </td>
72
          </td>
64
          <td valign="top">
73
          <td valign="top">
Lines 69-118 Link Here
69
            </div>
78
            </div>
70
          </td>
79
          </td>
71
        </tr>
80
        </tr>
72
        <tr>
73
          <td colspan="2" valign="top">
74
            <div id="footer">
75
              <xsl:apply-templates select="lenya:meta/dcterms:modified"/>
76
              <xsl:apply-templates select="lenya:meta/dc:publisher"/>
77
            </div>
78
          </td>
79
        </tr>
80
      </table>
81
      </table>
81
      </div>
82
      </div>
82
    </body>
83
    </body>
83
  </html>
84
  </html>
84
</xsl:template>
85
</xsl:template>
85
86
86
<xsl:template match="dcterms:modified">
87
  <xsl:variable name="date"><xsl:value-of select="."/></xsl:variable>
88
  <i18n:text>last_published</i18n:text>:
89
    <xsl:if test="$date!=''">
90
    <i18n:date-time src-pattern="yyyy-MM-dd HH:mm:ss" pattern="EEE, d MMM yyyy HH:mm:ss z" value="{$date}"/> 
91
  </xsl:if>
92
</xsl:template>
93
94
<xsl:template match="dc:publisher">
95
  <xsl:variable name="user"><xsl:value-of select="."/></xsl:variable>
96
  <xsl:variable name="user-id"><xsl:value-of select="substring-before($user,'|')"/></xsl:variable>
97
  <xsl:variable name="rest"><xsl:value-of select="substring-after($user,'|')"/></xsl:variable>
98
  <xsl:variable name="user-name"><xsl:value-of select="substring-before($rest,'|')"/></xsl:variable>
99
  <xsl:variable name="user-email"><xsl:value-of select="substring-after($rest,'|')"/></xsl:variable>
100
101
  <xsl:if test="$user != ''">
102
    <xsl:choose>
103
      <xsl:when test="$user-email != ''">
104
      / <a>
105
          <xsl:attribute name="href"><xsl:value-of select="concat('mailto:',$user-email)"/></xsl:attribute> 
106
          <xsl:value-of select="$user-name"/>
107
        </a>
108
      </xsl:when>
109
      <xsl:otherwise>
110
       / <xsl:value-of select="$user-name"/>
111
      </xsl:otherwise>
112
    </xsl:choose>
113
  </xsl:if>
114
</xsl:template>
115
116
<xsl:template match="@*|node()" priority="-1">
87
<xsl:template match="@*|node()" priority="-1">
117
  <xsl:copy>
88
  <xsl:copy>
118
    <xsl:apply-templates select="@*|node()"/>
89
    <xsl:apply-templates select="@*|node()"/>
(-)xslt/xhtml2xhtml.xsl (-4 lines)
Lines 83-91 Link Here
83
83
84
   <!-- this template converts the object tag to img (for compatiblity with older browsers 
84
   <!-- this template converts the object tag to img (for compatiblity with older browsers 
85
    for more, see http://www.xml.com/pub/a/2003/07/02/dive.html -->
85
    for more, see http://www.xml.com/pub/a/2003/07/02/dive.html -->
86
87
   <!-- TODO: Extract all object templates into a separate xslt,
88
	     since we have dublicated code in content2edit.xsl in kupu /roku -->
89
   <xsl:template name="object2img">
86
   <xsl:template name="object2img">
90
      <img border="0">
87
      <img border="0">
91
        <xsl:attribute name="src">
88
        <xsl:attribute name="src">
Lines 98-104 Link Here
98
            </xsl:otherwise>
95
            </xsl:otherwise>
99
          </xsl:choose>
96
          </xsl:choose>
100
        </xsl:attribute>
97
        </xsl:attribute>
101
102
        <xsl:attribute name="alt">
98
        <xsl:attribute name="alt">
103
          <!-- the overwritten title (stored in @name) has precedence over dc:title -->
99
          <!-- the overwritten title (stored in @name) has precedence over dc:title -->
104
          <xsl:choose>
100
          <xsl:choose>
(-)xslt/page2xhtml-homepage.xsl (-1 / +1 lines)
Lines 19-24 Link Here
19
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
19
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
20
>
20
>
21
  
21
  
22
<xsl:import href="page2xhtml.xsl"/>
22
<xsl:import href="fallback://xslt/page2xhtml.xsl"/>
23
  
23
  
24
</xsl:stylesheet>
24
</xsl:stylesheet>
(-)xslt/links2xhtml.xsl (-16 / +17 lines)
Lines 1-4 Link Here
1
<?xml version="1.0"?>
1
<?xml version="1.0" encoding="UTF-8"?>
2
2
3
<xsl:stylesheet version="1.0"
3
<xsl:stylesheet version="1.0"
4
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
Lines 6-26 Link Here
6
  xmlns="http://www.w3.org/1999/xhtml"
6
  xmlns="http://www.w3.org/1999/xhtml"
7
>
7
>
8
8
9
<xsl:template match="default:links">
9
  <!-- default parameter value -->
10
<div id="body">
10
  <xsl:param name="rendertype" select="''"/>
11
<h1><xsl:value-of select="default:title"/></h1>
12
<ul>
13
<xsl:apply-templates select="default:link"/>
14
</ul>
15
</div>
16
</xsl:template>
17
11
18
<xsl:template match="default:link">
12
  <xsl:template match="default:links">
19
<li>
13
    <div id="body">
20
<a href="{@href}">
14
      <h1><xsl:value-of select="default:title"/></h1>
21
<xsl:value-of select="."/>
15
      <ul>
22
</a>
16
        <xsl:apply-templates select="default:link"/>
23
</li>
17
      </ul>
24
</xsl:template>
18
    </div>
19
  </xsl:template>
20
21
  <xsl:template match="default:link">
22
    <li>
23
      <a href="{@href}"><xsl:value-of select="."/></a>
24
    </li>
25
  </xsl:template>
25
  
26
  
26
</xsl:stylesheet>
27
</xsl:stylesheet>
(-)xslt/upload.xsl (+2 lines)
Lines 5-10 Link Here
5
  
5
  
6
  <xsl:import href="upload-generic.xsl"/>
6
  <xsl:import href="upload-generic.xsl"/>
7
  
7
  
8
  <!--<xsl:template name="title">Import Article (SGML)</xsl:template>-->
9
  
8
<xsl:template name="fields">
10
<xsl:template name="fields">
9
  <form method="POST" enctype="multipart/form-data">
11
  <form method="POST" enctype="multipart/form-data">
10
12
(-)xslt/homepage2xhtml.xsl (-1 / +1 lines)
Lines 19-24 Link Here
19
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
19
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
20
>
20
>
21
  
21
  
22
<xsl:import href="xhtml2xhtml.xsl"/>
22
<xsl:import href="fallback://xslt/xhtml2xhtml.xsl"/>
23
  
23
  
24
</xsl:stylesheet>
24
</xsl:stylesheet>
(-)xslt/page2xhtml-xhtml.xsl (-2 / +2 lines)
Lines 4-9 Link Here
4
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
5
>
5
>
6
  
6
  
7
<xsl:import href="page2xhtml.xsl"/>
7
<xsl:import href="fallback://xslt/page2xhtml.xsl"/>
8
  
8
9
</xsl:stylesheet>
9
</xsl:stylesheet>
(-)xslt/page2xhtml-links.xsl (-1 / +1 lines)
Lines 19-24 Link Here
19
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
19
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
20
>
20
>
21
  
21
  
22
<xsl:import href="page2xhtml.xsl"/>
22
<xsl:import href="fallback://xslt/page2xhtml.xsl"/>
23
  
23
  
24
</xsl:stylesheet>
24
</xsl:stylesheet>
(-)menus.xmap (-2 / +4 lines)
Lines 15-21 Link Here
15
  limitations under the License.
15
  limitations under the License.
16
-->
16
-->
17
17
18
<!-- $Id: menus.xmap,v 1.6 2004/09/01 17:25:07 michi Exp $ -->
18
<!-- $Id$ -->
19
19
20
<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
20
<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
21
21
Lines 39-52 Link Here
39
      </map:match>
39
      </map:match>
40
      
40
      
41
      <!-- document type: links -->
41
      <!-- document type: links -->
42
      <!--
42
      <map:match type="doctype" pattern="links">
43
      <map:match type="doctype" pattern="links">
43
        <map:generate type="serverpages" src="config/menus/links.xsp"/>
44
        <map:generate type="serverpages" src="config/menus/links.xsp"/>
44
        <map:serialize type="xml"/>
45
        <map:serialize type="xml"/>
45
      </map:match>
46
      </map:match>
47
      -->
46
      
48
      
47
      <!-- all other document types: xhtml, ... -->
49
      <!-- all other document types: xhtml, ... -->
48
      <map:match pattern="**">
50
      <map:match pattern="**">
49
        <map:generate type="serverpages" src="config/menus/generic.xsp"/>
51
        <map:generate type="serverpages" src="fallback://lenya/cmsmenus.xsp"/>
50
        <map:serialize type="xml"/>
52
        <map:serialize type="xml"/>
51
      </map:match>
53
      </map:match>
52
      
54
      
(-)doctypes.xmap (-13 / +6 lines)
Lines 19-43 Link Here
19
19
20
<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
20
<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
21
21
22
  <map:components/>
23
24
  <map:views>
25
  </map:views>
26
27
  <map:resources/>
28
29
  <map:pipelines>
22
  <map:pipelines>
30
23
31
    <!-- View Revision? -->
32
    <map:pipeline>
24
    <map:pipeline>
25
      <!-- View Revision? -->
33
      <map:match pattern="*/*/*/**.xml">
26
      <map:match pattern="*/*/*/**.xml">
34
        <map:match type="step" pattern="view-revision">
27
        <map:match type="step" pattern="view-revision">
35
          <map:generate type="serverpages" src="../../content/rc/view.xsp">
28
          <map:generate type="serverpages" src="../../content/rc/view.xsp">
36
          </map:generate>
29
          </map:generate>
37
          <map:transform src="../../xslt/rc/toDoc.xsl"/>
30
          <map:transform src="../../xslt/rc/toDoc.xsl"/>
38
        <map:transform src="xslt/{../3}2xhtml.xsl">
31
        <map:transform src="fallback://xslt/{../3}2xhtml.xsl">
39
          <map:parameter name="rendertype" value="{1}"/>
32
          <map:parameter name="rendertype" value="{1}"/>
40
          <map:parameter name="nodeid" value="{page-envelope:document-node-id}"/>
33
          <map:parameter name="nodeid" value="{page-envelope:document-name}"/>
41
          <map:parameter name="language" value="{page-envelope:document-language}"/>
34
          <map:parameter name="language" value="{page-envelope:document-language}"/>
42
        </map:transform>
35
        </map:transform>
43
          <map:serialize type="xml"/>
36
          <map:serialize type="xml"/>
Lines 47-56 Link Here
47
      <!-- parametrized doctype matcher -->
40
      <!-- parametrized doctype matcher -->
48
      <!-- pattern="{rendertype}/{area}/{doctype}/{document-path}" -->
41
      <!-- pattern="{rendertype}/{area}/{doctype}/{document-path}" -->
49
      <map:match pattern="*/*/*/**.xml">
42
      <map:match pattern="*/*/*/**.xml">
50
        <map:generate src="content/{2}/{4}.xml"/>
43
        <map:generate src="lenya:/{4}.xml"/>
51
        <map:transform src="xslt/{3}2xhtml.xsl">
44
        <map:transform src="fallback://xslt/{3}2xhtml.xsl">
52
          <map:parameter name="rendertype" value="{1}"/>
45
          <map:parameter name="rendertype" value="{1}"/>
53
          <map:parameter name="nodeid" value="{page-envelope:document-node-id}"/>
46
          <map:parameter name="nodeid" value="{page-envelope:document-name}"/>
54
          <map:parameter name="language" value="{page-envelope:document-language}"/>
47
          <map:parameter name="language" value="{page-envelope:document-language}"/>
55
        </map:transform>
48
        </map:transform>
56
        <map:serialize type="xml"/>
49
        <map:serialize type="xml"/>
(-)config/ac/passwd/ldap.properties.sample (-6 / +1 lines)
Lines 1-6 Link Here
1
#############################################################################
1
#############################################################################
2
# File: ldap.properties.sample
2
# File: ldap.properties.sample
3
# $Id: $
3
# $Id$
4
#############################################################################
4
#############################################################################
5
5
6
#############################################################################
6
#############################################################################
Lines 52-59 Link Here
52
mgr-pw=
52
mgr-pw=
53
key-store=.keystore
53
key-store=.keystore
54
security-protocol=ssl
54
security-protocol=ssl
55
56
57
# this property is no longer used (deprecated) !
58
# partial-user-dn=ou=Others,dc=interactivesystems,dc=info
59
60
  + Id
55
  + Id
61
  + native
56
  + native
(-)config/ac/usecase-policies.xml (-1 / +1 lines)
Lines 30-36 Link Here
30
    <usecase id="restore">
30
    <usecase id="restore">
31
        <role id="edit"/>
31
        <role id="edit"/>
32
    </usecase>
32
    </usecase>
33
    
33
34
	<usecase id="userChangeProfile"><role id="edit"/><role id="admin"/></usecase>
34
	<usecase id="userChangeProfile"><role id="edit"/><role id="admin"/></usecase>
35
	<usecase id="userChangePasswordUser"><role id="edit"/></usecase>
35
	<usecase id="userChangePasswordUser"><role id="edit"/></usecase>
36
	<usecase id="userChangePasswordAdmin"><role id="admin"/></usecase>
36
	<usecase id="userChangePasswordAdmin"><role id="admin"/></usecase>
(-)config/tasks/tasks.xconf (-58 lines)
Lines 25-78 Link Here
25
    <parameter name="properties.text" value="The test was successful."/>
25
    <parameter name="properties.text" value="The test was successful."/>
26
  </task>
26
  </task>
27
27
28
  <task id="publish">
29
    <label>Publish and Export</label>
30
    <task id="publish" class="org.apache.lenya.defaultpub.cms.task.Publish"/>
31
    <task id="delect-cache" class="org.apache.lenya.cms.task.AntTask">
32
      <label>Delete Cache</label>
33
      <parameter name="target" value="deletecache"/>
34
      <parameter name="properties.cachedir" value="work/cache"/>
35
    </task>
36
<!--
37
    <task id="export" class="org.apache.lenya.cms.publishing.StaticHTMLExporter">
38
      <parameter name="export-path" value="work/export/pending"/>
39
      <parameter name="substitute-regexp" value="/lenya/live/"/>
40
      <parameter name="substitute-replacement" value="/"/>
41
      <parameter name="my-server-port" value="1313"/>
42
    </task>
43
-->
44
  </task>
45
46
  <task id="deactivateDocument" class="org.apache.lenya.defaultpub.cms.task.Deactivate">
47
    <label>Deactivate</label>
48
  </task>
49
50
51
  <task id="create" class="org.apache.lenya.cms.task.AntTask">
52
    <label>Create</label>
53
    <parameter name="target" value="create"/>
54
  </task>
55
56
  <task id="create-language" class="org.apache.lenya.cms.task.AntTask">
57
    <label>CreateLanguage</label>
58
    <parameter name="target" value="create-language"/>
59
  </task>
60
61
  <task id="remove-language" class="org.apache.lenya.cms.task.AntTask">
62
    <label>RemoveLanguage</label>
63
    <parameter name="target" value="remove-language"/>
64
  </task>
65
66
  <task id="rename-label" class="org.apache.lenya.cms.task.AntTask">
67
    <label>Edit Navigation Title</label>
68
    <parameter name="target" value="rename-label"/>
69
  </task>
70
71
  <task id="change-visibility" class="org.apache.lenya.cms.task.AntTask">
72
    <label>Change Node Visibility</label>
73
    <parameter name="target" value="change-visibility"/>
74
  </task>
75
76
  <task id="save-meta-data" class="org.apache.lenya.cms.task.AntTask">
28
  <task id="save-meta-data" class="org.apache.lenya.cms.task.AntTask">
77
    <label>SaveMetaData</label>
29
    <label>SaveMetaData</label>
78
    <parameter name="target" value="save-meta-data"/>
30
    <parameter name="target" value="save-meta-data"/>
Lines 88-103 Link Here
88
    <parameter name="target" value="moveDocument"/>
40
    <parameter name="target" value="moveDocument"/>
89
  </task>
41
  </task>
90
42
91
  <task id="renameDocument" class="org.apache.lenya.cms.task.AntTask">
92
    <label>RenameDocument</label>
93
    <parameter name="target" value="renameDocument"/>
94
  </task>
95
96
  <task id="movenode" class="org.apache.lenya.cms.task.AntTask">
97
    <label>Move Node</label>
98
    <parameter name="target" value="movenode"/>
99
  </task>
100
101
  <task id="deleteDocument" class="org.apache.lenya.cms.task.AntTask">
43
  <task id="deleteDocument" class="org.apache.lenya.cms.task.AntTask">
102
    <label>DeleteDocument</label>
44
    <label>DeleteDocument</label>
103
    <parameter name="target" value="deleteDocument"/>
45
    <parameter name="target" value="deleteDocument"/>
(-)config/tasks/targets.xml (-237 / +2 lines)
Lines 77-82 Link Here
77
77
78
  <target name="test">
78
  <target name="test">
79
    <echo>This is a test of the AntTask: ${text}</echo>
79
    <echo>This is a test of the AntTask: ${text}</echo>
80
    <taskdef name="ant-test" classname="org.apache.lenya.cms.ant.TestTask"/>
81
    <ant-test/>
80
  </target>
82
  </target>
81
83
82
84
Lines 103-287 Link Here
103
		/>
105
		/>
104
</target>
106
</target>
105
107
106
  <taskdef name="init-history" classname="org.apache.lenya.cms.ant.InitWorkflowHistoryTask"/>
107
  <target name="create">
108
    
109
    <property name="create.parent-id" value=""/>
110
    <property name="create.child-id" value=""/>
111
    <property name="create.child-name" value=""/>
112
    <property name="create.child-type" value=""/>
113
    <property name="create.doctype" value=""/>
114
    <property name="create.language" value=""/>
115
    <property name="create.title" value=""/>
116
    <property name="create.creator" value=""/>
117
    <property name="create.description" value=""/>
118
    <property name="create.subject" value=""/>
119
    <property name="create.publisher" value=""/>
120
    <property name="create.date" value=""/>
121
    <property name="create.rights" value=""/>
122
    <property name="create.columns" value=""/>
123
    <property name="create.userid" value=""/>
124
    <property name="create.ipaddress" value=""/>
125
    <property name="create.visible" value=""/>
126
    
127
    <taskdef name="create" classname="org.apache.lenya.cms.ant.DocumentCreatorTask"/>
128
    <create
129
      authoringpath="${authoring.dir}"
130
      area="${authoring.area}"
131
      parentid="${create.parent-id}"
132
      childid="${create.child-id}"
133
      childname="${create.child-name}"
134
      childtype="${create.child-type}"
135
      documenttype="${create.doctype}"
136
      language="${create.language}"
137
      visibleinnav="${create.visible}"
138
      />
139
    
140
    <!-- Init the workflow history -->
141
    <echo>init the workflow history with document-id: ${create.parent-id}/${create.child-id}</echo>      
142
    <echo>with document-type: ${create.doctype}</echo>      
143
    <echo>with language: ${create.language}</echo>      
144
    <echo>with user ID: ${create.userid}</echo>      
145
    <echo>with IP address: ${create.ipaddress}</echo>      
146
    <init-history
147
      documentid="${create.parent-id}/${create.child-id}"
148
      documenttype="${create.doctype}"
149
      language="${create.language}"
150
      userid="${create.userid}"
151
      machineip="${create.ipaddress}"
152
      />
153
    
154
    <!-- Add the meta data to the newly created file. -->
155
    <property name="document.file" value=""/>
156
    <mapdocumentidtofile
157
      area="${authoring.area}" 
158
      documentid="${create.parent-id}/${create.child-id}"
159
      language="${create.language}"
160
      propertyname="document.file" 
161
      />
162
    <tempfile property="temp.file" destDir="work"/>
163
    <xslt in="${document.file}"
164
      out="${temp.file}" 
165
      force="true"
166
      style="${pub.dir}/../../xslt/authoring/addMetaData.xsl">
167
      <param name="title" expression="${create.title}"/>
168
      <param name="creator" expression="${create.creator}"/>
169
      <param name="subject" expression="${create.subject}"/>
170
      <param name="description" expression="${create.description}"/>
171
      <param name="language" expression="${create.language}"/>
172
      <param name="publisher" expression="${create.publisher}"/>
173
      <param name="date" expression="${create.date}"/>
174
      <param name="rights" expression="${create.rights}"/>
175
      <param name="columns" expression="${create.columns}"/>
176
    </xslt>
177
    <move file="${temp.file}" tofile="${document.file}"/>
178
  </target>
179
  
180
  <!-- Create a copy of an existing document for a new language -->
181
  <target name="create-language">
182
    
183
    <property name="create.document-id" value=""/>
184
    <property name="create.doctype" value=""/>
185
    <property name="create.child-name" value=""/>
186
    <property name="create.old.language" value=""/>
187
    <property name="create.new.language" value=""/>
188
    <property name="create.title" value=""/>
189
    <property name="create.creator" value=""/>
190
    <property name="create.description" value=""/>
191
    <property name="create.subject" value=""/>
192
    <property name="create.publisher" value=""/>
193
    <property name="create.date" value=""/>
194
    <property name="create.rights" value=""/>
195
    <property name="create.userid" value=""/>
196
    <property name="create.ipaddress" value=""/>
197
    
198
    <!-- Add a node to the tree -->
199
    <taskdef name="insertlabel" classname="org.apache.lenya.cms.ant.InsertLabelTask"/>
200
    <insertlabel
201
      documentid="${create.document-id}"
202
      labelName="${create.child-name}"
203
      language="${create.new.language}"
204
      area="${authoring.area}"
205
      />
206
108
207
    <!-- Init the workflow history -->
208
    <echo>init the workflow history with document-id: ${create.document-id}</echo>      
209
    <echo>with document-type: ${create.doctype}</echo>      
210
    <echo>with language: ${create.new.language}</echo>      
211
    <init-history
212
      documentid="${create.document-id}"
213
      documenttype="${create.doctype}"
214
      language="${create.new.language}"
215
      userid="${create.userid}"
216
      machineip="${create.ipaddress}"
217
      />
218
    
219
    <!-- Copy the existing file over -->
220
    <property name="document.old.file" value=""/>
221
    <mapdocumentidtofile
222
      area="${authoring.area}" 
223
      documentid="${create.document-id}"
224
      language="${create.old.language}"
225
      propertyname="document.old.file" 
226
      />
227
    <echo>Old file: ${document.old.file}</echo>
228
    <property name="document.new.file" value=""/>
229
    <mapdocumentidtofile
230
      area="${authoring.area}" 
231
      documentid="${create.document-id}"
232
      language="${create.new.language}"
233
      propertyname="document.new.file" 
234
      />
235
    <echo>New file: ${document.new.file}</echo>
236
237
    <echo>Add the meta data to the newly created file: ${document.new.file}</echo>
238
    <!-- Add the meta data to the newly created file. -->
239
    <xslt in="${document.old.file}"
240
      out="${document.new.file}" 
241
      force="true"
242
      style="${pub.dir}/../../xslt/authoring/addMetaData.xsl">
243
      <param name="title" expression="${create.title}"/>
244
      <param name="creator" expression="${create.creator}"/>
245
      <param name="subject" expression="${create.subject}"/>
246
      <param name="description" expression="${create.description}"/>
247
      <param name="language" expression="${create.new.language}"/>
248
      <param name="publisher" expression="${create.publisher}"/>
249
      <param name="date" expression="${create.date}"/>
250
      <param name="rights" expression="${create.rights}"/>
251
    </xslt>
252
  </target>
253
  
254
  <!-- Remove a language from an existing document -->
255
  <target name="remove-language">
256
    
257
    <property name="remove.label.document-id" value=""/>
258
    <property name="remove.label.label-name" value=""/>
259
    <property name="remove.label.language" value=""/>
260
    
261
    <!-- Remove a label from a node in the tree -->
262
    <echo>Remove label: ${remove.label.label-name}</echo>
263
    <echo>for language: ${remove.label.language}</echo>
264
    <echo>from document: ${remove.label.document-id}</echo>
265
    <echo>in area: ${authoring.area}</echo>
266
    <taskdef name="removelabel" classname="org.apache.lenya.cms.ant.RemoveLabelTask"/>
267
    <removelabel
268
      documentid="${remove.label.document-id}"
269
      labelName="${remove.label.label-name}"
270
      language="${remove.label.language}"
271
      area="${authoring.area}"
272
      />
273
    <!-- Remove the language document -->
274
    <property name="document.file" value=""/>
275
    <mapdocumentidtofile
276
      area="${authoring.area}" 
277
      documentid="${remove.label.document-id}"
278
      language="${remove.label.language}"
279
      propertyname="document.file" 
280
      />
281
    <echo>Remove file: ${document.file}</echo>
282
    <delete file="${document.file}"/>
283
  </target>
284
285
  <!-- Save the dublin core meta data -->
109
  <!-- Save the dublin core meta data -->
286
  <target name="save-meta-data">
110
  <target name="save-meta-data">
287
    
111
    
Lines 396-411 Link Here
396
    <echo>the document id for the copy is now ${node.newdocumentid}</echo>
220
    <echo>the document id for the copy is now ${node.newdocumentid}</echo>
397
  </target>
221
  </target>
398
222
399
  <target name = "newnamedocumentid">
400
    <taskdef name="computerenamedocumentid" classname="org.apache.lenya.cms.ant.ComputeRenameDocumentId"/>
401
    <computerenamedocumentid
402
      area="authoring"
403
      firstdocumentid="${node.firstdocumentid}"
404
      secdocumentid="${node.secdocumentid}"
405
      />
406
    <echo>the document id for the renamed file is now ${node.newdocumentid}</echo>
407
  </target>
408
  
409
  <taskdef name="computearchivedocumentid" classname="org.apache.lenya.cms.ant.ComputeArchiveDocumentId"/>
223
  <taskdef name="computearchivedocumentid" classname="org.apache.lenya.cms.ant.ComputeArchiveDocumentId"/>
410
  
224
  
411
  <target name = "newarchivedocumentid">
225
  <target name = "newarchivedocumentid">
Lines 623-670 Link Here
623
    
437
    
624
  </target>
438
  </target>
625
  
439
  
626
  <taskdef name="renameLabel" classname="org.apache.lenya.cms.ant.RenameLabelTask"/>
627
  
628
  <target name = "rename-label">
629
    <property name="rename.label.document-id" value=""/>
630
    <property name="rename.label.label-name" value=""/>
631
    <property name="rename.label.language" value=""/>
632
    <property name="rename.label.area" value=""/>
633
    
634
    <echo>Rename Label</echo>
635
    <renameLabel
636
      documentid="${rename.label.document-id}"
637
      labelName="${rename.label.label-name}"
638
      language="${rename.label.language}"
639
      area="${rename.label.area}"
640
      />
641
  </target>
642
440
643
  <taskdef name="changeVisibility" classname="org.apache.lenya.cms.ant.ChangeVisibilityTask"/>
644
  
645
  <target name = "change-visibility">
646
    <property name="change.visibility.document-id" value=""/>
647
    <property name="change.visibility.area" value=""/>
648
    
649
    <echo>Change Visibility</echo>
650
    <changeVisibility
651
      documentid="${change.visibility.document-id}"
652
      area="${change.visibility.area}"
653
      />
654
  </target>
655
656
<target name = "moveDocument" depends="firstareaproperties,
441
<target name = "moveDocument" depends="firstareaproperties,
657
    secareaproperties, newcopydocumentid, firstdocumentpath,
442
    secareaproperties, newcopydocumentid, firstdocumentpath,
658
    secdocumentpath, move, rewrite-links">
443
    secdocumentpath, move, rewrite-links">
659
  <echo>moveDocument</echo> 
444
  <echo>moveDocument</echo> 
660
</target>
445
</target>
661
446
662
<target name = "renameDocument" depends="firstareaproperties,
663
    secareaproperties, newnamedocumentid, firstdocumentpath,
664
    secdocumentpath, move, rewrite-links">
665
  <echo>renameDocument</echo> 
666
</target>
667
668
<target name = "setIdentifier">
447
<target name = "setIdentifier">
669
  <taskdef name="setidentifier" classname="org.apache.lenya.cms.ant.SetIdentifier"/>
448
  <taskdef name="setidentifier" classname="org.apache.lenya.cms.ant.SetIdentifier"/>
670
  <setidentifier
449
  <setidentifier
Lines 713-732 Link Here
713
492
714
</target>
493
</target>
715
494
716
<target name="movenode">
717
	<property name="movenode.documentid" value=""/>
718
	<property name="movenode.direction" value=""/>
719
	
720
	<echo>Moving sitetree node</echo>
721
	<echo>Document ID: ${movenode.documentid}</echo>
722
	<echo>Direction: ${movenode.direction}</echo>
723
	
724
  <taskdef name="movenodeupdown" classname="org.apache.lenya.cms.ant.MoveSiteTreeNodeTask"/>
725
  <movenodeupdown
726
    documentid="${movenode.documentid}"
727
    direction="${movenode.direction}"
728
  />
729
</target>
730
495
731
  <target name="deletecache">
496
  <target name="deletecache">
732
    <delete dir="${cachedir}"/>
497
    <delete dir="${cachedir}"/>
(-)config/publication.xconf (-4 / +2 lines)
Lines 17-23 Link Here
17
17
18
<!-- $Id$ -->
18
<!-- $Id$ -->
19
19
20
<publication>
20
<publication supports-templating="true">
21
  <languages>
21
  <languages>
22
    <language default="true">en</language>
22
    <language default="true">en</language>
23
    <language>de</language>
23
    <language>de</language>
Lines 26-32 Link Here
26
  <document-builder>org.apache.lenya.cms.publication.DefaultDocumentBuilder</document-builder>
26
  <document-builder>org.apache.lenya.cms.publication.DefaultDocumentBuilder</document-builder>
27
  <breadcrumb-prefix/>
27
  <breadcrumb-prefix/>
28
  
28
  
29
  <!-- 
29
  <!--
30
       For information about these settings, read 
30
       For information about these settings, read 
31
       http://lenya.apache.org/docs/1_2_x/components/deployment/proxying.html
31
       http://lenya.apache.org/docs/1_2_x/components/deployment/proxying.html
32
32
Lines 36-41 Link Here
36
  <proxy area="authoring" ssl="false" url="http://www.host.com/lenya/authoring"/>
36
  <proxy area="authoring" ssl="false" url="http://www.host.com/lenya/authoring"/>
37
  -->
37
  -->
38
  
38
  
39
  <link-attribute xpath="//*[namespace-uri() = 'http://www.w3.org/1999/xhtml']/@href"/>
40
  
41
</publication>
39
</publication>
(-)config/menus/links.xsp (-19 / +14 lines)
Lines 36-43 Link Here
36
  <menu>
36
  <menu>
37
  	
37
  	
38
    <xsp:logic>
38
    <xsp:logic>
39
      String projectid = parameters.getParameter("projectid","null");
40
      
41
      String xmlSource = <input:get-attribute module="page-envelope" as="string" name="document-path"/>;
39
      String xmlSource = <input:get-attribute module="page-envelope" as="string" name="document-path"/>;
42
      String documentId = <input:get-attribute module="page-envelope" as="string" name="context-prefix"/> + "/" + <input:get-attribute module="page-envelope" as="string" name="publication-id"/> + "/authoring" + <input:get-attribute module="page-envelope" as="string" name="document-id"/> + "_" + <input:get-attribute module="page-envelope" as="string" name="document-language"/>;
40
      String documentId = <input:get-attribute module="page-envelope" as="string" name="context-prefix"/> + "/" + <input:get-attribute module="page-envelope" as="string" name="publication-id"/> + "/authoring" + <input:get-attribute module="page-envelope" as="string" name="document-id"/> + "_" + <input:get-attribute module="page-envelope" as="string" name="document-language"/>;
43
      String urisParameter = "uris=" + <input:get-attribute module="page-envelope" as="string" name="context-prefix"/> + "/" + <input:get-attribute module="page-envelope" as="string" name="publication-id"/> + "/live" + <input:get-attribute module="page-envelope" as="string" name="document-url"/>;
41
      String urisParameter = "uris=" + <input:get-attribute module="page-envelope" as="string" name="context-prefix"/> + "/" + <input:get-attribute module="page-envelope" as="string" name="publication-id"/> + "/live" + <input:get-attribute module="page-envelope" as="string" name="document-url"/>;
Lines 69-105 Link Here
69
    </xsp:logic>
67
    </xsp:logic>
70
68
71
    <menus>
69
    <menus>
72
      <menu i18n:attr="name" name="File" label="File">
70
      <menu i18n:attr="name" name="File">
73
	<block>
71
	<block>
74
	  <item uc:usecase="logout" href="?"><i18n:text>Logout</i18n:text></item>
72
	  <item uc:usecase="ac.logout" href="?"><i18n:text>Logout</i18n:text></item>
75
	</block>
73
	</block>
76
      </menu>
74
      </menu>
77
      
75
      
78
      <menu i18n:attr="name" name="Edit" label="Search">
76
      <menu i18n:attr="name" name="Edit">
79
        
77
        
80
        <block info="false">
78
        <block info="false">
81
	  <!-- XSLT not finished yet -->
82
          <!--<item uc:usecase="edit" uc:step="open"><xsp:attribute name="href"><xsp:expr>"?form=" + docType</xsp:expr></xsp:attribute><i18n:text>Edit with Forms</i18n:text></item>-->
83
          <item uc:usecase="1formedit" uc:step="open" href="?"><i18n:text>Edit with one Form</i18n:text></item>
79
          <item uc:usecase="1formedit" uc:step="open" href="?"><i18n:text>Edit with one Form</i18n:text></item>
84
        </block>
80
        </block>
85
      </menu>
81
      </menu>
86
      
82
      
87
      <menu i18n:attr="name" name="Workflow" label="Help">
83
      <menu i18n:attr="name" name="Workflow">
88
      </menu>
84
      </menu>
89
85
90
      <menu i18n:attr="name" name="Help" label="Debug">
86
      <menu i18n:attr="name" name="Help">
91
	<block>
92
	  <item><xsp:attribute name="href">http://lenya.apache.org/docs/index.html</xsp:attribute><i18n:text>System&#160;Documentation</i18n:text></item>
93
	  <item href="http://wiki.apache.org/lenya/"><i18n:text>Wiki</i18n:text></item>
94
	</block>
95
  <block>
96
	  <item><xsp:attribute name="href"><xsp-request:get-context-path/>/index.html</xsp:attribute><i18n:text>Apache Lenya Homepage</i18n:text></item>
97
	  <item><xsp:attribute name="href"><xsp-request:get-context-path/>/about.html</xsp:attribute><i18n:text>About Apache Lenya</i18n:text></item>
98
	</block>
99
100
        <block>
87
        <block>
88
          <item href="http://lenya.apache.org/docs/index.html"><i18n:text>Documentation</i18n:text></item>
89
          <item href="http://wiki.apache.org/lenya/"><i18n:text>Wiki</i18n:text></item>
90
        </block>
91
        <block>
92
          <item><xsp:attribute name="href"><xsp-request:get-context-path/>/index.html</xsp:attribute><i18n:text>Apache Lenya Homepage</i18n:text></item>
93
          <item><xsp:attribute name="href"><xsp-request:get-context-path/>/about.html</xsp:attribute><i18n:text>About Apache Lenya</i18n:text></item>
94
        </block>
95
        <block>
101
          <item uc:usecase="view-logs" uc:step="overview" href="?"><i18n:text>View Task Logs</i18n:text></item>
96
          <item uc:usecase="view-logs" uc:step="overview" href="?"><i18n:text>View Task Logs</i18n:text></item>
102
	</block>
97
        </block>
103
      </menu>
98
      </menu>
104
    </menus>
99
    </menus>
105
    
100
    
(-)config/menus/generic.xsp (-289 lines)
Lines 1-289 Link Here
1
<?xml version="1.0"?>
2
<!--
3
  Copyright 1999-2004 The Apache Software Foundation
4
5
  Licensed under the Apache License, Version 2.0 (the "License");
6
  you may not use this file except in compliance with the License.
7
  You may obtain a copy of the License at
8
9
      http://www.apache.org/licenses/LICENSE-2.0
10
11
  Unless required by applicable law or agreed to in writing, software
12
  distributed under the License is distributed on an "AS IS" BASIS,
13
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
  See the License for the specific language governing permissions and
15
  limitations under the License.
16
-->
17
18
<!-- $Id$ -->
19
20
<xsp:page
21
    language="java"
22
    xmlns:xsp="http://apache.org/xsp"
23
    xmlns:xsp-request="http://apache.org/xsp/request/2.0"
24
    xmlns:input="http://apache.org/cocoon/xsp/input/1.0"
25
    xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
26
    xmlns:wf="http://apache.org/cocoon/lenya/workflow/1.0"
27
    xmlns:uc="http://apache.org/cocoon/lenya/usecase/1.0"
28
    xmlns="http://apache.org/cocoon/lenya/menubar/1.0"
29
>
30
31
  <xsp:structure>
32
    <xsp:include>org.apache.lenya.cms.publication.Document</xsp:include>
33
    <xsp:include>org.apache.lenya.cms.publication.Publication</xsp:include>
34
  </xsp:structure>
35
36
  <menu>
37
38
    <xsp:logic>
39
      String projectid = parameters.getParameter("projectid","null");
40
41
      String xmlSource = <input:get-attribute module="page-envelope" as="string" name="document-path"/>;
42
      String documentId = <input:get-attribute module="page-envelope" as="string" name="context-prefix"/> + "/" + <input:get-attribute module="page-envelope" as="string" name="publication-id"/> + "/authoring" + <input:get-attribute module="page-envelope" as="string" name="document-id"/> + "_" + <input:get-attribute module="page-envelope" as="string" name="document-language"/>;
43
      String urisParameter = "uris=" + <input:get-attribute module="page-envelope" as="string" name="context-prefix"/> + "/" + <input:get-attribute module="page-envelope" as="string" name="publication-id"/> + "/live" + <input:get-attribute module="page-envelope" as="string" name="document-url"/>;
44
      String area = <input:get-attribute module="page-envelope" as="string" name="area"/>;
45
46
      String docType = "";
47
      try {
48
      Document document = (Document) <input:get-attribute as="object" module="page-envelope" name="document"/>;
49
          if (document.exists()) {
50
              docType = <input:get-attribute as="string" module="page-envelope" name="document-type"/>;
51
          }
52
      }
53
      catch (Exception e) {
54
          throw new ProcessingException(e);
55
      }
56
57
      boolean isDocument = false;
58
      {
59
        Object document = <input:get-attribute module="page-envelope" as="object" name="document"/>;
60
        try {
61
          if (document != "" &amp;&amp; ((Document) document).exists()) {
62
            isDocument = true;
63
          }
64
        }
65
        catch (Exception e) {
66
          throw new ProcessingException(e);
67
        }
68
      }
69
    </xsp:logic>
70
71
    <menus>
72
      <menu i18n:attr="name" name="File" label="File">
73
	<block>
74
75
	  <xsp:logic>
76
	    {
77
        if (Publication.ARCHIVE_AREA.equals(area) || Publication.TRASH_AREA.equals(area)) {
78
          <item><i18n:text>New Document</i18n:text></item>
79
        }
80
        else {
81
          <item uc:usecase="create" uc:step="showscreen" href="?doctype=xhtml"><i18n:text>New Document</i18n:text></item>
82
        }
83
	    }
84
	  </xsp:logic>
85
	</block>
86
	<block>
87
	  <xsp:logic>
88
	    {
89
	      if (isDocument
90
            &amp;&amp; Publication.AUTHORING_AREA.equals(area)
91
	          ) {
92
          <xsp:content>
93
            <item uc:usecase="create-language" uc:step="showscreen" href="?"><i18n:text>New Language Version</i18n:text></item>
94
          </xsp:content>
95
	      }
96
	      else {
97
          <xsp:content>
98
            <item><i18n:text>New Language Version</i18n:text></item>
99
          </xsp:content>
100
	      }
101
102
	      String[] availableLanguages = (String[])<input:get-attribute module="page-envelope" as="object" name="document-languages"/>;
103
	      if (isDocument
104
            &amp;&amp; Publication.AUTHORING_AREA.equals(area)
105
	          &amp;&amp; availableLanguages.length &gt; 1
106
	          ) {
107
	        <xsp:content>
108
	          <item uc:usecase="removelabel" uc:step="showscreen" href="?"><i18n:text>Remove Language Version</i18n:text></item>
109
	        </xsp:content>
110
	      } else {
111
	        <xsp:content>
112
	          <item><i18n:text>Remove Language Version</i18n:text></item>
113
	        </xsp:content>
114
	      }
115
	    }
116
	  </xsp:logic>
117
	</block>
118
	<block>
119
	  <item uc:usecase="logout" href="?"><i18n:text>Logout</i18n:text></item>
120
	</block>
121
      </menu>
122
123
      <menu i18n:attr="name" name="Edit" label="Search">
124
125
        <block info="false">
126
          <item wf:event="edit" uc:usecase="kupu" uc:step="open" href="?"><i18n:text>Edit with Kupu</i18n:text></item>
127
          <item wf:event="edit" uc:usecase="bxeng" uc:step="open" href="?"><i18n:text>Edit with BXE</i18n:text></item>
128
          <item wf:event="edit" uc:usecase="edit" uc:step="open"><xsp:attribute name="href"><xsp:expr>"?form=" + docType</xsp:expr></xsp:attribute><i18n:text>Edit with Forms</i18n:text></item>
129
          <item wf:event="edit" uc:usecase="1formedit" uc:step="open" href="?"><i18n:text>Edit with one Form</i18n:text></item>
130
        </block>
131
        <block info="false">
132
          <item wf:event="edit" uc:usecase="info-meta" uc:step="showscreen"><xsp:attribute name="href"><xsp-request:get-context-path/>/<input:get-attribute module="page-envelope" as="string" name="publication-id"/>/info-<input:get-attribute module="page-envelope" as="string" name="area"/><input:get-attribute module="page-envelope" as="string" name="document-url"/>?</xsp:attribute><i18n:text>Edit Metadata</i18n:text></item>
133
          <item wf:event="edit" uc:usecase="rename-label" uc:step="showscreen"><xsp:attribute name="href"><xsp-request:get-uri/>?</xsp:attribute><i18n:text>Edit Navigation Title</i18n:text></item>
134
        </block>
135
136
        <block authoring="false">
137
138
        <xsp:logic>
139
140
        {
141
          String docId = <input:get-attribute module="page-envelope" as="string" name="document-id"/>;
142
143
          if (isDocument
144
              &amp;&amp; "".equals(<input:get-attribute module="sitetree" as="string" name="live-node"/>)
145
              &amp;&amp; Publication.AUTHORING_AREA.equals(area)
146
              &amp;&amp; !"/index".equals(docId)) {
147
            <item uc:usecase="cut" uc:step="showscreen" href="?"><i18n:text>Cut</i18n:text></item>
148
          }
149
          else {
150
            <item><i18n:text>Cut</i18n:text></item>
151
          }
152
153
          if (isDocument
154
              &amp;&amp; Publication.AUTHORING_AREA.equals(area)
155
              &amp;&amp; !"/index".equals(docId)) {
156
            <item uc:usecase="copy" uc:step="showscreen" href="?"><i18n:text>Copy</i18n:text></item>
157
          }
158
          else {
159
            <item><i18n:text>Copy</i18n:text></item>
160
          }
161
162
        	String clipboard = (String) <input:get-attribute module="session-attr" as="object" name="org.apache.lenya.cms.info.firstdocid"/> + "/";
163
        	String currentDocumentId = <input:get-attribute module="page-envelope" as="string" name="document-id"/> + "/";
164
165
        	if (clipboard != null
166
        	    &amp;&amp; !"".equals(clipboard)
167
              &amp;&amp; Publication.AUTHORING_AREA.equals(area)
168
              &amp;&amp; !currentDocumentId.startsWith(clipboard)
169
              &amp;&amp; !"/index".equals(docId)) {
170
		        <item uc:usecase="paste" uc:step="showscreen" href="?"><i18n:text>Paste</i18n:text></item>
171
        	}
172
        	else {
173
		        <item><i18n:text>Paste</i18n:text></item>
174
        	}
175
        }
176
        </xsp:logic>
177
178
      </block>
179
      <block authoring="false">
180
        <xsp:logic>
181
          if (isDocument &amp;&amp; "".equals(<input:get-attribute module="sitetree" as="string" name="live-node"/>)
182
              &amp;&amp; Publication.AUTHORING_AREA.equals(area)) {
183
            <item uc:usecase="rename" uc:step="showscreen" href="?"><i18n:text>Rename URL</i18n:text></item>
184
          }
185
          else {
186
            <item>Rename URL</item>
187
          }
188
189
          if (isDocument) {
190
            <item wf:event="edit" uc:usecase="rename-label" uc:step="showscreen" href="?"><i18n:text>Edit Navigation Title</i18n:text></item>
191
          }
192
          else {
193
            <item>Edit Navigation Title</item>
194
          }
195
          if (isDocument) {
196
            <item wf:event="edit" uc:usecase="change-visibility" uc:step="showscreen" href="?"><i18n:text>Change node visibility</i18n:text></item>
197
          }
198
          else {
199
            <item>Change node visibility</item>
200
          }
201
        </xsp:logic>
202
      </block>
203
      <block authoring="false">
204
        <xsp:logic>
205
          if (isDocument
206
              &amp;&amp; "".equals(<input:get-attribute module="sitetree" as="string" name="live-node"/>)
207
              &amp;&amp; Publication.AUTHORING_AREA.equals(area)
208
              &amp;&amp; !"/index".equals(<input:get-attribute module="sitetree" as="string" name="document-id"/>)) {
209
            <item uc:usecase="move-node" uc:step="move-node"><xsp:attribute name="href"><xsp-request:get-uri/>?properties.movenode.direction=up</xsp:attribute><i18n:text>Move Up</i18n:text></item>
210
            <item uc:usecase="move-node" uc:step="move-node"><xsp:attribute name="href"><xsp-request:get-uri/>?properties.movenode.direction=down</xsp:attribute><i18n:text>Move Down</i18n:text></item>
211
          }
212
          else {
213
            <item><i18n:text>Move Up</i18n:text></item>
214
            <item><i18n:text>Move Down</i18n:text></item>
215
          }
216
        </xsp:logic>
217
      </block>
218
      <block authoring="false">
219
220
        <xsp:logic>
221
       	{
222
223
       	  if (isDocument &amp;&amp;
224
       	    !"/index".equals(<input:get-attribute module="page-envelope" as="string" name="document-id"/>)) {
225
            <item wf:event="delete" uc:usecase="delete" uc:step="showscreen" href="?"><i18n:text>Delete</i18n:text></item>
226
            <item wf:event="archive" uc:usecase="archive" uc:step="showscreen" href="?"><i18n:text>Archive</i18n:text></item>
227
       	  }
228
       	  else {
229
            <item><i18n:text>Delete</i18n:text></item>
230
            <item><i18n:text>Archive</i18n:text></item>
231
       	  }
232
233
        	if (isDocument &amp;&amp; (area.equals(Publication.TRASH_AREA) || area.equals(Publication.ARCHIVE_AREA))) {
234
            <item wf:event="restore" uc:usecase="restore" uc:step="showscreen" href="?">Restore</item>
235
        	}
236
        	else {
237
            <item><i18n:text>Restore</i18n:text></item>
238
        	}
239
      	}
240
        </xsp:logic>
241
242
      </block>
243
244
      </menu>
245
246
      <menu i18n:attr="name" name="Workflow" label="Help">
247
	  <xsp:logic>
248
      {
249
        if (isDocument &amp;&amp; Publication.AUTHORING_AREA.equals(area)) {
250
	<block>
251
          <item uc:usecase="submit" uc:step="showscreen" wf:event="submit" href="?"><i18n:text>Submit</i18n:text></item>
252
          <item uc:usecase="reject" uc:step="showscreen" wf:event="reject" href="?"><i18n:text>Reject</i18n:text></item>
253
          <item uc:usecase="publish" uc:step="showscreen" wf:event="publish"><xsp:attribute name="href">?<xsp:expr>urisParameter</xsp:expr>&amp;sources=<xsp:expr>xmlSource</xsp:expr>&amp;task-id=publish</xsp:attribute><i18n:text>Publish</i18n:text></item>
254
          <item uc:usecase="deactivate" uc:step="showscreen" wf:event="deactivate" href="?task-id=deactivateDocument"><i18n:text>Deactivate</i18n:text></item>
255
       </block><block>
256
          <item uc:usecase="schedule" uc:step="showscreen" href="?"><i18n:text>Schedule</i18n:text></item>
257
	</block>
258
        }
259
        else {
260
	<block>
261
          <item><i18n:text>Submit</i18n:text></item>
262
          <item><i18n:text>Reject</i18n:text></item>
263
          <item><i18n:text>Publish</i18n:text></item>
264
          <item><i18n:text>Deactivate</i18n:text></item>
265
       </block><block>
266
          <item><i18n:text>Schedule</i18n:text></item>
267
	</block>
268
        }
269
      }
270
	  </xsp:logic>
271
      </menu>
272
273
      <menu i18n:attr="name" name="Help" label="Debug">
274
        <block>
275
            <item href="http://lenya.apache.org/docs/index.html"><i18n:text>Documentation</i18n:text></item>
276
            <item href="http://wiki.apache.org/lenya/"><i18n:text>Wiki</i18n:text></item>
277
        </block>
278
        <block>
279
          <item><xsp:attribute name="href"><xsp-request:get-context-path/>/index.html</xsp:attribute><i18n:text>Apache Lenya Homepage</i18n:text></item>
280
          <item><xsp:attribute name="href"><xsp-request:get-context-path/>/about.html</xsp:attribute><i18n:text>About Apache Lenya</i18n:text></item>
281
        </block>
282
        <block>
283
          <item uc:usecase="view-logs" uc:step="overview" href="?"><i18n:text>View Task Logs</i18n:text></item>
284
      	</block>
285
      </menu>
286
    </menus>
287
288
  </menu>
289
</xsp:page>
(-)config/usecases.xconf (+27 lines)
Line 0 Link Here
1
  <xconf xpath="/cocoon/usecases" unless="/cocoon/usecases/component-instance[@name = 'default/workflow.submit']">
2
3
    <component-instance name="default/workflow.submit"
4
                        logger="lenya.usecases.workflow"
5
                        class="org.apache.lenya.cms.workflow.usecases.InvokeWorkflow">
6
      <event id="submit"/>
7
    </component-instance>
8
                        
9
    <component-instance name="default/workflow.reject"
10
                        logger="lenya.usecases.workflow"
11
                        class="org.apache.lenya.cms.workflow.usecases.InvokeWorkflow">
12
      <event id="reject"/>
13
    </component-instance>
14
                        
15
    <component-instance name="default/workflow.publish"
16
                        logger="lenya.usecases.workflow"
17
                        class="org.apache.lenya.defaultpub.cms.usecases.Publish"/>
18
19
    <component-instance name="default/workflow.deactivate"
20
                        logger="lenya.usecases.workflow"
21
                        class="org.apache.lenya.defaultpub.cms.usecases.Deactivate"/>
22
23
    <component-instance name="default/site.delete"
24
                        logger="lenya.usecases.delete"
25
                        class="org.apache.lenya.defaultpub.cms.usecases.Delete"/>
26
27
  </xconf>
(-)config/workflow/workflow.xml (-3 / +2 lines)
Lines 19-26 Link Here
19
19
20
<workflow xmlns="http://apache.org/cocoon/lenya/workflow/1.0"
20
<workflow xmlns="http://apache.org/cocoon/lenya/workflow/1.0"
21
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
21
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
22
    xsi:schemaLocation="http://apache.org/cocoon/lenya/workflow/1.0
22
    xsi:schemaLocation="http://apache.org/cocoon/lenya/workflow/1.0 ../../../../resources/entities/workflow.xsd">
23
        ../../../../resources/entities/workflow.xsd">
24
23
25
  <state id="authoring" initial="true"/>
24
  <state id="authoring" initial="true"/>
26
  <state id="review"/>
25
  <state id="review"/>
Lines 82-86 Link Here
82
  <transition source="trash" destination="authoring">
81
  <transition source="trash" destination="authoring">
83
    <event id="restore"/>
82
    <event id="restore"/>
84
    <condition class="org.apache.lenya.cms.workflow.RoleCondition">edit</condition>
83
    <condition class="org.apache.lenya.cms.workflow.RoleCondition">edit</condition>
85
  </transition>        
84
  </transition>  
86
</workflow>
85
</workflow>
(-)config/doctypes/schemas/homepage.rng (-31 / +1 lines)
Lines 29-64 Link Here
29
         xmlns:xhtml="http://www.w3.org/1999/xhtml"
29
         xmlns:xhtml="http://www.w3.org/1999/xhtml"
30
         >
30
         >
31
31
32
<include href="lenya.rng"/>
32
<include href="xhtml.rng"/>
33
33
34
35
<!-- include original XHTML transitional schema -->
36
<include href="xhtml/xhtml-basic.rng">
37
38
  <define name="html">
39
    <element name="html">
40
      <ref name="html.attlist"/>
41
      <ref name="lenya.meta"/>
42
      <ref name="head"/>
43
      <ref name="body"/>
44
    </element>
45
  </define>
46
47
  <define name="html.attlist">
48
    <ref name="XHTML.version.attrib"/>
49
    <ref name="I18n.attrib"/>
50
    <ref name="dummy.attlist"/>
51
  </define>
52
53
</include>
54
55
56
<!-- additional block elements -->
57
<define name="Block.class" combine="choice">
58
  <choice>
59
    <ref name="lenya.asset"/>
60
  </choice>
61
</define>
62
63
64
</grammar>
34
</grammar>
(-)config/doctypes/samples/xhtml.xml (-17 / +17 lines)
Lines 1-5 Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
1
<?xml version="1.0" encoding="UTF-8"?>
2
<xhtml:html
2
<html xmlns="http://www.w3.org/1999/xhtml" 
3
      xmlns:xhtml="http://www.w3.org/1999/xhtml" 
3
      xmlns:xhtml="http://www.w3.org/1999/xhtml" 
4
      xmlns:dc="http://purl.org/dc/elements/1.1/" 
4
      xmlns:dc="http://purl.org/dc/elements/1.1/" 
5
      xmlns:dcterms="http://purl.org/dc/terms/"
5
      xmlns:dcterms="http://purl.org/dc/terms/"
Lines 24-44 Link Here
24
        <dc:coverage/>
24
        <dc:coverage/>
25
        <dc:rights>dcrights</dc:rights>
25
        <dc:rights>dcrights</dc:rights>
26
    </lenya:meta>
26
    </lenya:meta>
27
  <xhtml:head>
27
  <head>
28
    <xhtml:title>Default Publication</xhtml:title>
28
    <title>Default Publication</title>
29
  </xhtml:head>
29
  </head>
30
  <xhtml:body>
30
  <body>
31
    <xhtml:h1>Default Publication</xhtml:h1>
31
    <h1>Default Publication</h1>
32
    <xhtml:p>Welcome to the default Lenya publication!</xhtml:p>
32
    <p>Welcome to the default Lenya publication!</p>
33
    <xhtml:p>The purpose of this publication is</xhtml:p>
33
    <p>The purpose of this publication is</p>
34
    <xhtml:ul>
34
    <ul>
35
      <xhtml:li>to show beginners the basic functionality of the Lenya CMS,</xhtml:li>
35
      <li>to show beginners the basic functionality of the Lenya CMS,</li>
36
      <xhtml:li>to provide an "out of the box" publication that can be easily adapted and used, and</xhtml:li>
36
      <li>to provide an "out of the box" publication that can be easily adapted and used, and</li>
37
      <xhtml:li>to provide a basis for reference implementations of new concepts and best practices.</xhtml:li>
37
      <li>to provide a basis for reference implementations of new concepts and best practices.</li>
38
    </xhtml:ul>
38
    </ul>
39
    <xhtml:p>
39
    <p>
40
    You won't find any fancy and confusing bells and whistles here, but the
40
    You won't find any fancy and confusing bells and whistles here, but the
41
    publication contains everything you need to get started.
41
    publication contains everything you need to get started.
42
    </xhtml:p>
42
    </p>
43
  </xhtml:body>
43
  </body>
44
</xhtml:html>
44
</html>
(-)config/doctypes/doctypes.xconf (-18 / +4 lines)
Lines 20-59 Link Here
20
<doctypes>
20
<doctypes>
21
21
22
  <doc type="homepage">
22
  <doc type="homepage">
23
    <children>
24
      <doc type="xhtml"/>
25
    </children>
26
    <creator src="org.apache.lenya.cms.authoring.DefaultBranchCreator">
23
    <creator src="org.apache.lenya.cms.authoring.DefaultBranchCreator">
27
      <sample-name>homepage.xml</sample-name>
24
      <sample-name>homepage.xml</sample-name>
28
    </creator>
25
    </creator>
29
    <tasks>
30
      <task id="publish"/>
31
    </tasks>
32
    <workflow src="workflow.xml"/>
26
    <workflow src="workflow.xml"/>
27
    <link-attribute xpath="//*[namespace-uri() = 'http://www.w3.org/1999/xhtml']/@href"/>
33
  </doc>
28
  </doc>
29
  
34
  <doc type="links">
30
  <doc type="links">
35
    <children>
36
      <doc type="xhtml"/>
37
    </children>
38
    <creator src="org.apache.lenya.cms.authoring.DefaultBranchCreator">
31
    <creator src="org.apache.lenya.cms.authoring.DefaultBranchCreator">
39
      <sample-name>links.xml</sample-name>
32
      <sample-name>links.xml</sample-name>
40
    </creator>
33
    </creator>
41
    <tasks>
42
      <task id="publish"/>
43
    </tasks>
44
    <workflow src="workflow.xml"/>
34
    <workflow src="workflow.xml"/>
45
  </doc>
35
  </doc>
36
46
  <doc type="xhtml">
37
  <doc type="xhtml">
47
    <children>
48
      <doc type="xhtml"/>
49
    </children>
50
    <creator src="org.apache.lenya.cms.authoring.DefaultBranchCreator">
38
    <creator src="org.apache.lenya.cms.authoring.DefaultBranchCreator">
51
      <sample-name>xhtml.xml</sample-name>
39
      <sample-name>xhtml.xml</sample-name>
52
    </creator>
40
    </creator>
53
    <tasks>
54
      <task id="publish"/>
55
    </tasks>
56
    <workflow src="workflow.xml"/>
41
    <workflow src="workflow.xml"/>
42
    <link-attribute xpath="//*[namespace-uri() = 'http://www.w3.org/1999/xhtml']/@href"/>
57
  </doc>
43
  </doc>
58
44
59
</doctypes>
45
</doctypes>
(-)sitemap.xmap (-5 / +3 lines)
Lines 19-32 Link Here
19
19
20
<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
20
<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
21
21
22
  <map:components/>
23
24
  <map:resources>
22
  <map:resources>
25
    <map:resource name="style-cms-page">
23
    <map:resource name="style-cms-page">
26
      <map:transform type="i18n">      
24
      <map:transform type="i18n">      
27
        <map:parameter name="locale" value="{request:locale}"/>
25
        <map:parameter name="locale" value="{request:locale}"/>
28
      </map:transform>    
26
      </map:transform>    
29
      <map:transform src="../../xslt/util/page2xhtml.xsl">
27
      <map:transform src="fallback://lenya/xslt/util/page2xhtml.xsl">
30
        <map:parameter name="contextprefix" value="{request:contextPath}"/>
28
        <map:parameter name="contextprefix" value="{request:contextPath}"/>
31
      </map:transform>
29
      </map:transform>
32
      <map:transform src="../../xslt/util/strip_namespaces.xsl"/>
30
      <map:transform src="../../xslt/util/strip_namespaces.xsl"/>
Lines 46-59 Link Here
46
44
47
    <map:pipeline>
45
    <map:pipeline>
48
      <map:match pattern="**">
46
      <map:match pattern="**">
49
        <map:mount uri-prefix="" src="publication-sitemap.xmap"/>
47
        <map:mount uri-prefix="" src="{fallback:publication-sitemap.xmap}"/>
50
      </map:match>
48
      </map:match>
51
49
52
      <map:handle-errors>
50
      <map:handle-errors>
53
        <map:select type="exception">
51
        <map:select type="exception">
54
           <map:when test="resourcenotfound">
52
           <map:when test="resourcenotfound">
55
             <map:generate src="../../content/util/empty.xml" />
53
             <map:generate src="../../content/util/empty.xml" />
56
            <map:transform src="../../xslt/exception/document-does-not-exist.xsl">
54
            <map:transform src="fallback://lenya/xslt/exception/document-does-not-exist.xsl">
57
              <map:parameter name="documentid" value="{page-envelope:document-id}"/>
55
              <map:parameter name="documentid" value="{page-envelope:document-id}"/>
58
              <map:parameter name="documenturl" value="{page-envelope:document-url}"/>
56
              <map:parameter name="documenturl" value="{page-envelope:document-url}"/>
59
            </map:transform>
57
            </map:transform>
(-)usecase-bxe.xmap (+301 lines)
Line 0 Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<!--
3
  Copyright 1999-2004 The Apache Software Foundation
4
5
  Licensed under the Apache License, Version 2.0 (the "License");
6
  you may not use this file except in compliance with the License.
7
  You may obtain a copy of the License at
8
9
      http://www.apache.org/licenses/LICENSE-2.0
10
11
  Unless required by applicable law or agreed to in writing, software
12
  distributed under the License is distributed on an "AS IS" BASIS,
13
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
  See the License for the specific language governing permissions and
15
  limitations under the License.
16
-->
17
18
<!-- $Id$ -->
19
20
<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
21
  
22
  <!-- =========================== Resources ================================ -->
23
  <map:resources>
24
        
25
    <map:resource name="style-cms-page">
26
      <map:transform type="i18n">
27
        <map:parameter name="locale" value="{request:locale}"/>
28
      </map:transform>
29
      <map:transform src="fallback://lenya/xslt/util/page2xhtml.xsl">
30
        <map:parameter name="contextprefix" value="{request:contextPath}"/>
31
      </map:transform>
32
      <map:transform src="../../xslt/util/strip_namespaces.xsl"/>
33
      <map:select type="parameter">
34
        <map:parameter name="statusCode" value="{statusCode}"/>
35
        <map:when test="">
36
          <map:serialize type="xhtml" />
37
        </map:when>
38
        <map:otherwise>
39
          <map:serialize type="xhtml" status-code="{statusCode}"/>
40
        </map:otherwise>
41
      </map:select>
42
    </map:resource>
43
    
44
    <map:resource name="cms-screen-xml">
45
          <map:generate src="../../content/{serverpage}" type="serverpages"/>
46
          <map:transform src="../../xslt/{stylesheet}">
47
            <map:parameter name="use-request-parameters" value="true"/>
48
            <map:parameter name="contextprefix" value="{request:contextPath}"/>
49
          </map:transform>      
50
    </map:resource>
51
    
52
    <map:resource name="cms-screen">
53
      <map:call resource="cms-screen-xml">
54
        <map:parameter name="serverpage" value="{serverpage}"/>
55
        <map:parameter name="stylesheet" value="{stylesheet}"/>
56
      </map:call>
57
      <map:call resource="style-cms-page"/>
58
    </map:resource>
59
    
60
    
61
  </map:resources>
62
  <!-- =========================== Flow ===================================== -->
63
  <map:flow language="javascript">
64
    <map:script src="../../usecases/edit-document.js"/>
65
  </map:flow>
66
	<!-- =========================== Pipelines ================================ -->
67
	
68
	<map:pipelines>
69
	  
70
    <map:pipeline type="noncaching">
71
      
72
      <map:match pattern="request2document">
73
        <map:generate type="stream"/>
74
        <map:transform src="../../xslt/bxe/change-object-path-back.xsl">
75
          <map:parameter name="documentid" value="{page-envelope:document-id}"/>
76
        </map:transform>
77
        <map:serialize type="xml"/>
78
      </map:match>
79
      
80
      <map:match type="usecase" pattern="bxe">
81
        
82
      <map:match type="step" pattern="open">
83
       <!-- Check for bxe -->
84
       <map:act type="resource-exists" src="../../resources/bxe/bxeLoader.js">
85
        <map:act type="reserved-checkout">
86
          <map:generate type="serverpages" src="../../content/rc/{exception}.xsp">
87
            <map:parameter name="user" value="{user}"/>
88
            <map:parameter name="filename" value="{filename}"/>
89
            <map:parameter name="date" value="{date}"/>
90
            <map:parameter name="message" value="{message}"/>
91
          </map:generate>
92
          <map:transform src="../../xslt/rc/rco-exception.xsl"/>
93
          <map:call resource="style-cms-page"/>
94
        </map:act>
95
        <map:aggregate element="bxe">
96
          <map:part src="../../resources/misc/bxe/index.xhtml"/>
97
          <map:part src="../../resources/misc/bxe/content-namespaces.xml"/>
98
        </map:aggregate>
99
        <map:transform src="../../xslt/bxe/aggregate.xsl"/>
100
        <map:transform src="../../xslt/bxe/index-xhtml.xsl">
101
          <map:parameter name="configfile" value="{request:requestURI}?lenya.usecase=bxe&amp;lenya.step=config"/>
102
          <map:parameter name="context" value="{request:contextPath}"/>
103
        </map:transform>
104
        <map:transform src="../../xslt/util/strip_namespaces.xsl"/>
105
        <map:serialize type="xhtml"/>
106
        </map:act>
107
        <map:generate src="../../resources/misc/bxe/download.xhtml"/>
108
        <map:call resource="style-cms-page"/>
109
        <map:serialize type="xhtml"/>
110
      </map:match>
111
      
112
      <map:match pattern="image-upload-show" type="step">
113
        <map:call resource="cms-screen">
114
           <map:parameter name="serverpage" value="info/assets.xsp"/>
115
           <map:parameter name="stylesheet" value="bxe/image.xsl"/>
116
        </map:call>
117
      </map:match>
118
119
      <map:match pattern="asset-upload-show" type="step">
120
        <map:call resource="cms-screen">
121
           <map:parameter name="serverpage" value="info/assets.xsp"/>
122
           <map:parameter name="stylesheet" value="bxe/asset.xsl"/>
123
        </map:call>
124
      </map:match> 
125
      
126
          <map:match type="step" pattern="asset-upload">
127
            <map:act type="upload">
128
              <map:redirect-to uri="{request:requestURI}?lenya.usecase=bxe&amp;lenya.step=asset-upload-show"/>
129
            </map:act>
130
            <map:call resource="cms-screen">
131
              <map:parameter name="serverpage" value="info/assets.xsp"/>
132
              <map:parameter name="stylesheet" value="bxe/asset.xsl"/>
133
            </map:call>
134
          </map:match>
135
136
          <map:match type="step" pattern="image-upload">
137
            <map:act type="upload">
138
              <map:redirect-to uri="{request:requestURI}?lenya.usecase=bxe&amp;lenya.step=image-upload-show"/>
139
            </map:act>
140
	        <map:call resource="cms-screen">
141
	           <map:parameter name="serverpage" value="info/assets.xsp"/>
142
	           <map:parameter name="stylesheet" value="bxe/image.xsl"/>
143
	        </map:call>
144
	       </map:match>
145
146
      <map:match pattern="link-show" type="step">
147
            <!-- just a dummy xsp since we call the info area directly -->
148
           <map:generate type="serverpages" src="../../content/info/assets.xsp"/>
149
          <map:transform src="../../xslt/bxe/link.xsl" label="content">
150
            <map:parameter name="infoarea" value="true"/>
151
            <map:parameter name="contextprefix" value="{request:contextPath}"/>
152
            <map:parameter name="publicationid" value="{page-envelope:publication-id}"/>
153
            <map:parameter name="area" value="authoring"/>
154
            <map:parameter name="tab" value="en"/>
155
            <map:parameter name="chosenlanguage" value="{page-envelope:document-language}"/>
156
            <map:parameter name="documentid" value="{page-envelope:document-id}"/>
157
            <map:parameter name="documenturl" value="/{page-envelope:document-url}"/>
158
            <map:parameter name="documentextension" value="{page-envelope:document-extension}"/>
159
            <map:parameter name="defaultlanguage" value="{page-envelope:default-language}"/>
160
            <map:parameter name="languages" value="{page-envelope:publication-languages-csv}"/>
161
          </map:transform>
162
        <map:call resource="style-cms-page"/>
163
      </map:match>
164
      
165
      <!-- {publication-id}/{area}/info-sitetree -->
166
      <map:match pattern="link-tree" type="step">
167
        <map:select type="parameter">
168
          <map:parameter name="parameter-selector-test" value="{request-param:incremental}"/>
169
          <map:when test="true">
170
            <map:generate src="../../content/util/empty.xml" />
171
            <map:act type="set-header">
172
              <map:parameter name="Cache-Control" value="pre-check=0" />
173
              <map:parameter name="Expires" value="-1" />
174
            </map:act>
175
            <map:transform src="../../xslt/info/sitetree2tree.xsl" label="content">
176
              <map:parameter name="contextprefix" value="{request:contextPath}"/>
177
              <map:parameter name="publicationid" value="{page-envelope:publication-id}"/>
178
              <map:parameter name="chosenlanguage" value="{request-param:language}"/>
179
              <map:parameter name="defaultlanguage" value="{page-envelope:default-language}"/>
180
              <map:parameter name="cutdocumentid" value="{session-attr:org.apache.lenya.cms.info.cutdocumentid}"/>
181
              <map:parameter name="incremental" value="true"/>
182
              <map:parameter name="areas" value="authoring"/>
183
            </map:transform>
184
          </map:when>
185
          
186
          <map:otherwise>
187
            <map:aggregate element="lenya" label="aggregate">
188
              <map:part src="content/authoring/sitetree.xml"/>
189
            </map:aggregate>
190
    
191
            <map:transform src="../../xslt/navigation/sitetree2nav.xsl" label="navtree">
192
              <map:parameter name="chosenlanguage" value="{request-param:language}"/>
193
              <map:parameter name="defaultlanguage" value="{page-envelope:default-language}"/>
194
            </map:transform>
195
    
196
            <map:transform src="../../xslt/bxe/sitetree2tree.xsl" label="content">
197
              <map:parameter name="contextprefix" value="{request:contextPath}"/>
198
              <map:parameter name="publicationid" value="{page-envelope:publication-id}"/>
199
              <map:parameter name="chosenlanguage" value="{request-param:language}"/>
200
              <map:parameter name="defaultlanguage" value="{page-envelope:default-language}"/>
201
              <map:parameter name="cutdocumentid" value="{session-attr:org.apache.lenya.cms.info.cutdocumentid}"/>
202
             </map:transform>
203
           </map:otherwise>
204
         </map:select>
205
         
206
        <map:serialize type="text"/>
207
      </map:match>      
208
209
      <map:match pattern="**/*.html">
210
        <!-- configuration -->
211
        <map:match type="step" pattern="config">
212
          <map:generate src="../../resources/misc/bxe/inc/config.xml"/>
213
          <map:transform src="../../xslt/bxe/config-xml.xsl">
214
            <map:parameter name="BX_xmlfile" value="{request:requestURI}?lenya.usecase=bxe&amp;lenya.step=xml"/>
215
            <map:parameter name="defaultlanguage" value="{page-envelope:default-language}"/>
216
            
217
  <!--      Instead of an xsl we use the xhtml file to provide the basic layout
218
            <map:parameter name="BX_xslfile" value="{2}.xsl"/>
219
  -->
220
            <map:parameter name="BX_xhtmlfile" value="{../2}.bxe.html"/>
221
            <map:parameter name="BX_validationfile" value="{request:contextPath}/{page-envelope:publication-id}/{page-envelope:area}/{page-envelope:document-type}.rng"/>
222
            <map:parameter name="css" value="{request:contextPath}/{page-envelope:publication-id}/{page-envelope:area}/css/{page-envelope:document-type}-bxe.css"/>
223
  <!--       The document is checked in when we exit from bx (in case of save&exit and in case of exit), so we use the usecase
224
             for the checkin while we redirect to the document
225
  -->
226
            <map:parameter name="BX_exitdestination" value="{request:requestURI}?lenya.usecase=checkin&amp;lenya.step=checkin&amp;backup=true"/>
227
            <map:parameter name="contextmenufile" value="../../resources/misc/bxe/contextmenu.xml"/>
228
          </map:transform>
229
          <map:transform type="cinclude"/>
230
          <map:serialize type="xml"/>
231
        </map:match>
232
      </map:match>
233
      
234
      <map:match pattern="*/**.html">
235
      
236
      <!-- /GET and PUT -->
237
      <map:match type="step" pattern="xml">      
238
        <map:select type="request-method">
239
          
240
          <map:when test="PUT">
241
            <!-- before we save, we must be sure that the document is well checked out
242
            -->           
243
	        <map:act type="reserved-checkout-test">
244
    	      <map:generate type="serverpages" src="../../content/rc/{exception}.xsp">
245
        	    <map:parameter name="user" value="{user}"/>
246
            	<map:parameter name="filename" value="{filename}"/>
247
	            <map:parameter name="date" value="{date}"/>
248
    	      </map:generate>
249
        	  <map:transform src="../../xslt/rc/rco-exception.xsl"/>
250
	          <map:call resource="style-cms-page"/>
251
        	</map:act>
252
          
253
          <map:call function="editDocument">
254
            <map:parameter name="sourceUri" value="cocoon:/request2document"/>
255
            <map:parameter name="noCheckin" value="true"/>
256
          </map:call>
257
          </map:when>
258
259
          <map:otherwise> <!-- GET -->
260
            <map:generate src="content/authoring/{page-envelope:document-path}"/>
261
            <map:transform src="../../xslt/bxe/change-object-path.xsl">
262
              <map:parameter name="documentid" value="{page-envelope:document-id}"/>
263
            </map:transform>
264
            <map:serialize type="xml"/>
265
          </map:otherwise>
266
          
267
        </map:select>
268
      </map:match>
269
      <!-- /GET and PUT -->
270
      
271
      </map:match> <!-- uri pattern -->
272
            
273
      </map:match> <!-- usecase -->
274
275
      <map:handle-errors>
276
        <map:select type="exception">
277
           <map:when test="resourcenotfound">
278
             <map:generate src="../../content/util/empty.xml" />
279
            <map:transform src="fallback://lenya/xslt/exception/document-does-not-exist.xsl">
280
              <map:parameter name="documentid" value="{page-envelope:document-id}"/>
281
              <map:parameter name="documenturl" value="{page-envelope:document-url}"/>
282
            </map:transform>
283
            <map:call resource="style-cms-page">
284
              <map:parameter name="statusCode" value="404"/>
285
            </map:call>
286
          </map:when>
287
        <map:otherwise>
288
        <map:generate type="notifying"/>
289
        <map:transform src="../../../stylesheets/system/error2html.xslt">
290
          <map:parameter name="contextPath" value="{request:contextPath}"/>
291
        </map:transform>
292
         </map:otherwise>
293
        </map:select>
294
        <map:serialize type="xhtml"/>
295
      </map:handle-errors>
296
      
297
    </map:pipeline>
298
    
299
	</map:pipelines>
300
	
301
</map:sitemap>
0
  + author date id revision
302
  + author date id revision
1
  + native
303
  + native
(-)lenya/resources/i18n/cmsui.xml (-2 / +1 lines)
Lines 17-23 Link Here
17
   limitations under the License.
17
   limitations under the License.
18
18
19
   
19
   
20
   $Id$
20
   $Id: cmsui.xml,v 1.2 2004/03/13 12:24:30 roku Exp $
21
   
21
   
22
-->
22
-->
23
23
Lines 29-33 Link Here
29
  <message key="New language for existing Document">New language for existing Document</message>
29
  <message key="New language for existing Document">New language for existing Document</message>
30
  <message key="default.createdoc.info.all-language-versions-exists">There are already versions of this document for all languages.</message>
30
  <message key="default.createdoc.info.all-language-versions-exists">There are already versions of this document for all languages.</message>
31
31
32
  <message key="last_published">Last Published</message>
33
</catalogue>
32
</catalogue>
(-)lenya/resources/i18n/cmsui_fr.xml (-2 / +1 lines)
Lines 17-23 Link Here
17
   limitations under the License.
17
   limitations under the License.
18
18
19
   
19
   
20
   $Id$
20
   $Id: cmsui_fr.xml,v 1.5 2004/04/17 07:22:46 roku Exp $
21
   
21
   
22
   @translators Olivier Lange <wire at petit-atelier dot ch>
22
   @translators Olivier Lange <wire at petit-atelier dot ch>
23
   
23
   
Lines 29-34 Link Here
29
  <message key="Create new language version">Créer une nouvelle traduction</message>
29
  <message key="Create new language version">Créer une nouvelle traduction</message>
30
  <message key="New language for existing Document">Nouvelle traduction d'un document existant</message>
30
  <message key="New language for existing Document">Nouvelle traduction d'un document existant</message>
31
  <message key="default.createdoc.info.all-language-versions-exists">Les traductions de ce document existent déjà dans toutes les langues.</message>
31
  <message key="default.createdoc.info.all-language-versions-exists">Les traductions de ce document existent déjà dans toutes les langues.</message>
32
  <message key="last_published">Mise à jour</message>
33
  
32
  
34
</catalogue>
33
</catalogue>
(-)lenya/resources/i18n/cmsui_de.xml (-2 / +1 lines)
Lines 17-23 Link Here
17
   limitations under the License.
17
   limitations under the License.
18
  
18
  
19
 
19
 
20
   $Id$ 
20
   $Id: cmsui_de.xml,v 1.3 2004/04/17 07:22:45 roku Exp $ 
21
   
21
   
22
-->
22
-->
23
23
Lines 29-34 Link Here
29
  <message key="New language for existing Document">Neue Sprachversion für existierendes Dokument anlegen</message>
29
  <message key="New language for existing Document">Neue Sprachversion für existierendes Dokument anlegen</message>
30
  <message key="default.createdoc.info.all-language-versions-exists">Das Dokument existiert bereits in allen notwendigen Sprachen.</message>
30
  <message key="default.createdoc.info.all-language-versions-exists">Das Dokument existiert bereits in allen notwendigen Sprachen.</message>
31
  
31
  
32
  <message key="last_published">Letzte Aktualisierung</message>
33
</catalogue>
32
</catalogue>
34
33
(-)lenya/usecases/site/create.jx (+140 lines)
Line 0 Link Here
1
<?xml version="1.0"?>
2
<!--
3
  Copyright 1999-2004 The Apache Software Foundation
4
5
  Licensed under the Apache License, Version 2.0 (the "License");
6
  you may not use this file except in compliance with the License.
7
  You may obtain a copy of the License at
8
9
      http://www.apache.org/licenses/LICENSE-2.0
10
11
  Unless required by applicable law or agreed to in writing, software
12
  distributed under the License is distributed on an "AS IS" BASIS,
13
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
  See the License for the specific language governing permissions and
15
  limitations under the License.
16
-->
17
18
<!-- $Id: login.jx 123986 2005-01-03 15:23:11Z andreas $ -->
19
20
<page:page xmlns:jx="http://apache.org/cocoon/templates/jx/1.0" 
21
           xmlns:page="http://apache.org/cocoon/lenya/cms-page/1.0" 
22
           xmlns="http://www.w3.org/1999/xhtml" 
23
           xmlns:i18n="http://apache.org/cocoon/i18n/2.1" >
24
25
  <page:title><i18n:text>New Document</i18n:text></page:title>
26
  <page:body>
27
    <div class="lenya-box">
28
      <div class="lenya-box-title">
29
        <i18n:text>New Document</i18n:text>
30
      </div>
31
      <div class="lenya-box-body">
32
        <form>
33
          <input type="hidden" name="lenya.continuation" value="${continuation.id}"/>
34
          <input type="hidden" name="lenya.usecase" value="${request.getParameter('lenya.usecase')}"/>
35
          <table class="lenya-table-noborder">
36
            <tr>
37
              <td colspan="2">
38
                <ul>
39
                  <jx:forEach var="message" items="${usecase.getErrorMessages()}">
40
                    <li>
41
                      <i18n:text>
42
                        <jx:out value="${message}"/>
43
                      </i18n:text>
44
                    </li>
45
                  </jx:forEach>
46
                  <jx:forEach var="message" items="${usecase.getInfoMessages()}">
47
                    <li>
48
                      <i18n:text>
49
                        <jx:out value="${message}"/>
50
                      </i18n:text>
51
                    </li>
52
                  </jx:forEach>
53
                </ul>
54
              </td>
55
            </tr>
56
              <tr>
57
                <td class="lenya-entry-caption">
58
                  <i18n:text>Parent ID</i18n:text>:</td>
59
                <td>
60
                  <jx:out value="${usecase.getParameter('parentId')}"/>
61
                </td>
62
              </tr>
63
              <tr>
64
                <td class="lenya-entry-caption">
65
                  <i18n:text>Document ID</i18n:text>*: </td>
66
                <td>
67
                  <input class="lenya-form-element" type="text" name="documentId" value="${usecase.getParameter('documentId')}"/>
68
                  <br/> (<i18n:text>No whitespace, no special characters</i18n:text>)</td>
69
              </tr>
70
              <tr>
71
                <td class="lenya-entry-caption">
72
                  <i18n:text>Navigation Title</i18n:text>*: </td>
73
                <td>
74
                  <input class="lenya-form-element" type="text" name="title" value="${usecase.getParameter('title')}"/>
75
                </td>
76
              </tr>
77
              <tr>
78
                <td class="lenya-entry-caption">
79
                  <i18n:text>Language</i18n:text>*: </td>
80
                <td>
81
                  <select class="lenya-form-element" name="language">
82
                    <jx:forEach var="language" items="${usecase.getParameter('languages')}">
83
                      <option value="${language}">${language}</option>
84
                    </jx:forEach>
85
                  </select>
86
                </td>
87
              </tr>
88
              <tr>
89
                <td class="lenya-entry-caption">
90
                  <i18n:text>Creator</i18n:text>:</td>
91
                <td>
92
                  <input class="lenya-form-element" type="text" name="creator" value="${usecase.getParameter('creator')}"/>
93
                </td>
94
              </tr>
95
              <tr>
96
                <td class="lenya-entry-caption">
97
                  <i18n:text>Subject</i18n:text>:</td>
98
                <td>
99
                  <input class="lenya-form-element" type="text" name="subject" value="${usecase.getParameter('subject')}"/>
100
                </td>
101
              </tr>
102
              <tr>
103
                <td class="lenya-entry-caption">
104
                  <i18n:text>Publisher</i18n:text>:</td>
105
                <td>
106
                  <input class="lenya-form-element" type="text" name="publisher" value="${usecase.getParameter('publisher')}"/>
107
                </td>
108
              </tr>
109
              <tr>
110
                <td class="lenya-entry-caption">
111
                  <i18n:text>Date</i18n:text>:</td>
112
                <td>
113
                  <jx:out value="${usecase.getParameter('date')}"/>
114
                </td>
115
              </tr>
116
              <tr>
117
                <td class="lenya-entry-caption">
118
                  <i18n:text>Rights</i18n:text>:</td>
119
                <td>
120
                  <input class="lenya-form-element" type="text" name="rights" value="${usecase.getParameter('rights')}"/>
121
                </td>
122
              </tr>
123
              <tr>
124
                <td class="lenya-entry-caption">* <i18n:text>required fields</i18n:text>
125
                </td>
126
              </tr>
127
              <tr>
128
                <td/>
129
                <td>
130
                  <input i18n:attr="value" type="submit" name="submit" value="Create"/>
131
                  &#160;
132
                  <input i18n:attr="value" type="submit" name="cancel" value="Cancel"/>
133
                </td>
134
              </tr>
135
          </table>
136
        </form>
137
      </div>
138
    </div>
139
  </page:body>
140
</page:page>
(-)lenya/usecases/site/createLanguage.jx (+133 lines)
Line 0 Link Here
1
<?xml version="1.0"?>
2
<!--
3
  Copyright 1999-2004 The Apache Software Foundation
4
5
  Licensed under the Apache License, Version 2.0 (the "License");
6
  you may not use this file except in compliance with the License.
7
  You may obtain a copy of the License at
8
9
      http://www.apache.org/licenses/LICENSE-2.0
10
11
  Unless required by applicable law or agreed to in writing, software
12
  distributed under the License is distributed on an "AS IS" BASIS,
13
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
  See the License for the specific language governing permissions and
15
  limitations under the License.
16
-->
17
18
<!-- $Id: login.jx 123986 2005-01-03 15:23:11Z andreas $ -->
19
20
<page:page xmlns:jx="http://apache.org/cocoon/templates/jx/1.0" 
21
           xmlns:page="http://apache.org/cocoon/lenya/cms-page/1.0" 
22
           xmlns="http://www.w3.org/1999/xhtml" 
23
           xmlns:i18n="http://apache.org/cocoon/i18n/2.1" >
24
25
  <page:title><i18n:text>New Document</i18n:text></page:title>
26
  <page:body>
27
    <div class="lenya-box">
28
      <div class="lenya-box-title">
29
        <i18n:text>New Document</i18n:text>
30
      </div>
31
      <div class="lenya-box-body">
32
        <form>
33
          <input type="hidden" name="lenya.continuation" value="${continuation.id}"/>
34
          <input type="hidden" name="lenya.usecase" value="${request.getParameter('lenya.usecase')}"/>
35
          <table class="lenya-table-noborder">
36
            <tr>
37
              <td colspan="2">
38
                <ul>
39
                  <jx:forEach var="message" items="${usecase.getErrorMessages()}">
40
                    <li>
41
                      <i18n:text>
42
                        <jx:out value="${message}"/>
43
                      </i18n:text>
44
                    </li>
45
                  </jx:forEach>
46
                  <jx:forEach var="message" items="${usecase.getInfoMessages()}">
47
                    <li>
48
                      <i18n:text>
49
                        <jx:out value="${message}"/>
50
                      </i18n:text>
51
                    </li>
52
                  </jx:forEach>
53
                </ul>
54
              </td>
55
            </tr>
56
              <tr>
57
                <td class="lenya-entry-caption">
58
                  <i18n:text>Document ID</i18n:text>: </td>
59
                <td>
60
                  <jx:out value="${usecase.getParameter('documentId')}"/>
61
                  <br/> (<i18n:text>No whitespace, no special characters</i18n:text>)</td>
62
              </tr>
63
              <tr>
64
                <td class="lenya-entry-caption">
65
                  <i18n:text>Navigation Title</i18n:text>*: </td>
66
                <td>
67
                  <input class="lenya-form-element" type="text" name="title" value="${usecase.getParameter('title')}"/>
68
                </td>
69
              </tr>
70
              <tr>
71
                <td class="lenya-entry-caption">
72
                  <i18n:text>Language</i18n:text>*: </td>
73
                <td>
74
                  <select class="lenya-form-element" name="language">
75
                    <jx:forEach var="language" items="${usecase.getParameter('languages')}">
76
                      <option value="${language}">${language}</option>
77
                    </jx:forEach>
78
                  </select>
79
                </td>
80
              </tr>
81
              <tr>
82
                <td class="lenya-entry-caption">
83
                  <i18n:text>Creator</i18n:text>:</td>
84
                <td>
85
                  <input class="lenya-form-element" type="text" name="creator" value="${usecase.getParameter('creator')}"/>
86
                </td>
87
              </tr>
88
              <tr>
89
                <td class="lenya-entry-caption">
90
                  <i18n:text>Subject</i18n:text>:</td>
91
                <td>
92
                  <input class="lenya-form-element" type="text" name="subject" value="${usecase.getParameter('subject')}"/>
93
                </td>
94
              </tr>
95
              <tr>
96
                <td class="lenya-entry-caption">
97
                  <i18n:text>Publisher</i18n:text>:</td>
98
                <td>
99
                  <input class="lenya-form-element" type="text" name="publisher" value="${usecase.getParameter('publisher')}"/>
100
                </td>
101
              </tr>
102
              <tr>
103
                <td class="lenya-entry-caption">
104
                  <i18n:text>Date</i18n:text>:</td>
105
                <td>
106
                  <jx:out value="${usecase.getParameter('date')}"/>
107
                </td>
108
              </tr>
109
              <tr>
110
                <td class="lenya-entry-caption">
111
                  <i18n:text>Rights</i18n:text>:</td>
112
                <td>
113
                  <input class="lenya-form-element" type="text" name="rights" value="${usecase.getParameter('rights')}"/>
114
                </td>
115
              </tr>
116
              <tr>
117
                <td class="lenya-entry-caption">* <i18n:text>required fields</i18n:text>
118
                </td>
119
              </tr>
120
              <tr>
121
                <td/>
122
                <td>
123
                  <input i18n:attr="value" type="submit" name="submit" value="Create"/>
124
                  &#160;
125
                  <input i18n:attr="value" type="submit" name="cancel" value="Cancel"/>
126
                </td>
127
              </tr>
128
          </table>
129
        </form>
130
      </div>
131
    </div>
132
  </page:body>
133
</page:page>
(-)lenya/usecases/workflow/submit.jx (+80 lines)
Line 0 Link Here
1
<?xml version="1.0"?>
2
<!--
3
  Copyright 1999-2004 The Apache Software Foundation
4
5
  Licensed under the Apache License, Version 2.0 (the "License");
6
  you may not use this file except in compliance with the License.
7
  You may obtain a copy of the License at
8
9
      http://www.apache.org/licenses/LICENSE-2.0
10
11
  Unless required by applicable law or agreed to in writing, software
12
  distributed under the License is distributed on an "AS IS" BASIS,
13
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
  See the License for the specific language governing permissions and
15
  limitations under the License.
16
-->
17
18
<!-- $Id: login.jx 123986 2005-01-03 15:23:11Z andreas $ -->
19
20
<page:page xmlns:jx="http://apache.org/cocoon/templates/jx/1.0" 
21
           xmlns:page="http://apache.org/cocoon/lenya/cms-page/1.0" 
22
           xmlns="http://www.w3.org/1999/xhtml" 
23
           xmlns:i18n="http://apache.org/cocoon/i18n/2.1" >
24
25
  <page:title><i18n:text>Submit Document</i18n:text></page:title>
26
  <page:body>
27
    <div class="lenya-box">
28
      <div class="lenya-box-title">
29
        <i18n:translate>
30
          <i18n:text i18n:key="submit-for-approval"/>
31
          <i18n:param><jx:out value="${usecase.getParameter('document').getId()}"/></i18n:param>
32
        </i18n:translate>      
33
      </div>
34
      <div class="lenya-box-body">
35
        <form>
36
          <input type="hidden" name="lenya.continuation" value="${continuation.id}"/>
37
          <input type="hidden" name="lenya.usecase" value="${request.getParameter('lenya.usecase')}"/>
38
          <table class="lenya-table-noborder">
39
            <tr>
40
              <td colspan="2">
41
                <ul>
42
                  <jx:forEach var="message" items="${usecase.getErrorMessages()}">
43
                    <li>
44
                      <i18n:text>
45
                        <jx:out value="${message}"/>
46
                      </i18n:text>
47
                    </li>
48
                  </jx:forEach>
49
                  <jx:forEach var="message" items="${usecase.getInfoMessages()}">
50
                    <li>
51
                      <i18n:text>
52
                        <jx:out value="${message}"/>
53
                      </i18n:text>
54
                    </li>
55
                  </jx:forEach>
56
                </ul>
57
              </td>
58
            </tr>
59
              <tr>
60
                <td colspan="2" class="lenya-entry-caption">
61
                  <i18n:translate>
62
                    <i18n:text i18n:key="submit-for-approval?"/>
63
                    <i18n:param><jx:out value="${usecase.getParameter('document').getId()}"/></i18n:param>
64
                  </i18n:translate>
65
                </td>
66
              </tr>
67
              <tr>
68
                <td/>
69
                <td>
70
                  <input i18n:attr="value" type="submit" name="submit" value="Submit"/>
71
                  &#160;
72
                  <input i18n:attr="value" type="submit" name="cancel" value="Cancel"/>
73
                </td>
74
              </tr>
75
          </table>
76
        </form>
77
      </div>
78
    </div>
79
  </page:body>
80
</page:page>
(-)lenya/usecases/workflow/publish.jx (+105 lines)
Line 0 Link Here
1
<?xml version="1.0"?>
2
<!--
3
  Copyright 1999-2004 The Apache Software Foundation
4
5
  Licensed under the Apache License, Version 2.0 (the "License");
6
  you may not use this file except in compliance with the License.
7
  You may obtain a copy of the License at
8
9
      http://www.apache.org/licenses/LICENSE-2.0
10
11
  Unless required by applicable law or agreed to in writing, software
12
  distributed under the License is distributed on an "AS IS" BASIS,
13
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
  See the License for the specific language governing permissions and
15
  limitations under the License.
16
-->
17
18
<!-- $Id: login.jx 123986 2005-01-03 15:23:11Z andreas $ -->
19
20
<page:page xmlns:jx="http://apache.org/cocoon/templates/jx/1.0" 
21
           xmlns:page="http://apache.org/cocoon/lenya/cms-page/1.0" 
22
           xmlns="http://www.w3.org/1999/xhtml" 
23
           xmlns:i18n="http://apache.org/cocoon/i18n/2.1" >
24
25
  <page:title><i18n:text>Publish</i18n:text></page:title>
26
  <page:body>
27
    <div class="lenya-box">
28
      <div class="lenya-box-title">
29
        <i18n:text>Publish</i18n:text>
30
      </div>
31
      <div class="lenya-box-body">
32
        <form>
33
          <input type="hidden" name="lenya.continuation" value="${continuation.id}"/>
34
          <input type="hidden" name="lenya.usecase" value="${request.getParameter('lenya.usecase')}"/>
35
          <table class="lenya-table-noborder">
36
            <tr>
37
              <td class="lenya-entry-caption" valign="top"><i18n:text>Document</i18n:text>:</td>
38
              <td valign="top">
39
                <jx:out value="${usecase.getParameter('document').getId()}"/>
40
              </td>
41
            </tr>
42
            <tr>
43
              <td colspan="2">
44
                <ul>
45
                  <jx:forEach var="message" items="${usecase.getErrorMessages()}">
46
                    <li>
47
                      <i18n:text>
48
                        <jx:out value="${message}"/>
49
                      </i18n:text>
50
                    </li>
51
                  </jx:forEach>
52
                  <jx:forEach var="missingDocument" items="${usecase.getParameter('missingDocuments')}">
53
                    <li>
54
                      <a href="${request.getContextPath() + missingDocument.getCanonicalWebappURL()}"><jx:out value="${missingDocument.getId()}"/> [<jx:out value="${missingDocument.getLanguage()}"/>]</a>
55
                    </li>
56
                  </jx:forEach>
57
                  <jx:forEach var="message" items="${usecase.getInfoMessages()}">
58
                    <li>
59
                      <i18n:text>
60
                        <jx:out value="${message}"/>
61
                      </i18n:text>
62
                    </li>
63
                  </jx:forEach>
64
                </ul>
65
              </td>
66
            </tr>
67
            <tr>
68
              <td/>
69
              <td>
70
                <jx:choose>
71
                  <jx:when test="${usecase.getParameter('allowSingleDocument').equals('false')}">
72
                    <input type="checkbox" checked="checked" disabled="disabled"/>
73
                    <input name="subtree" type="hidden" value="on"/>
74
                  </jx:when>
75
                  <jx:when test="${usecase.getParameter('subtree') == null}">
76
                    <input name="subtree" type="checkbox"/>
77
                  </jx:when>
78
                  <jx:otherwise>
79
                    <input name="subtree" type="checkbox" checked="checked"/>
80
                  </jx:otherwise>
81
                </jx:choose>
82
                <i18n:text>publish complete subtree</i18n:text>
83
              </td>
84
            </tr>
85
            <tr>
86
              <td><i18n:text>Schedule</i18n:text>:</td>
87
              <td>
88
                <input type="checkbox" name="schedule"/>
89
                <input type="text" name="schedule.time" value="${usecase.getParameter('schedule.time')}"/>
90
              </td>
91
            </tr>
92
            <tr>
93
              <td/>
94
              <td>
95
                <input i18n:attr="value" type="submit" name="submit" value="Publish"/>
96
                &#160;
97
                <input i18n:attr="value" type="submit" name="cancel" value="Cancel"/>
98
              </td>
99
            </tr>
100
          </table>
101
        </form>
102
      </div>
103
    </div>
104
  </page:body>
105
</page:page>
(-)lenya/usecases/workflow/deactivate.jx (+93 lines)
Line 0 Link Here
1
<?xml version="1.0"?>
2
<!--
3
  Copyright 1999-2004 The Apache Software Foundation
4
5
  Licensed under the Apache License, Version 2.0 (the "License");
6
  you may not use this file except in compliance with the License.
7
  You may obtain a copy of the License at
8
9
      http://www.apache.org/licenses/LICENSE-2.0
10
11
  Unless required by applicable law or agreed to in writing, software
12
  distributed under the License is distributed on an "AS IS" BASIS,
13
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
  See the License for the specific language governing permissions and
15
  limitations under the License.
16
-->
17
18
<!-- $Id: login.jx 123986 2005-01-03 15:23:11Z andreas $ -->
19
20
<page:page xmlns:jx="http://apache.org/cocoon/templates/jx/1.0" 
21
           xmlns:page="http://apache.org/cocoon/lenya/cms-page/1.0" 
22
           xmlns="http://www.w3.org/1999/xhtml" 
23
           xmlns:i18n="http://apache.org/cocoon/i18n/2.1" >
24
25
  <page:title><i18n:text>Deactivate</i18n:text></page:title>
26
  <page:body>
27
    <div class="lenya-box">
28
      <div class="lenya-box-title">
29
        <i18n:text>Deactivate</i18n:text>
30
      </div>
31
      <div class="lenya-box-body">
32
        <form>
33
          <input type="hidden" name="lenya.continuation" value="${continuation.id}"/>
34
          <input type="hidden" name="lenya.usecase" value="${request.getParameter('lenya.usecase')}"/>
35
          <table class="lenya-table-noborder">
36
            <tr>
37
              <td class="lenya-entry-caption" valign="top"><i18n:text>Document</i18n:text>:</td>
38
              <td valign="top">
39
                <jx:out value="${usecase.getParameter('document').getId()}"/>
40
              </td>
41
            </tr>
42
            <tr>
43
              <td colspan="2">
44
                <ul>
45
                  <jx:forEach var="message" items="${usecase.getErrorMessages()}">
46
                    <li>
47
                      <i18n:text>
48
                        <jx:out value="${message}"/>
49
                      </i18n:text>
50
                    </li>
51
                  </jx:forEach>
52
                  <jx:forEach var="message" items="${usecase.getInfoMessages()}">
53
                    <li>
54
                      <i18n:text>
55
                        <jx:out value="${message}"/>
56
                      </i18n:text>
57
                    </li>
58
                  </jx:forEach>
59
                </ul>
60
              </td>
61
            </tr>
62
            <tr>
63
              <td/>
64
              <td>
65
                <jx:choose>
66
                  <jx:when test="${usecase.getParameter('allowSingleDocument').equals('false')}">
67
                    <input type="checkbox" checked="checked" disabled="disabled"/>
68
                    <input name="subtree" type="hidden" value="on"/>
69
                  </jx:when>
70
                  <jx:when test="${usecase.getParameter('subtree') == null}">
71
                    <input name="subtree" type="checkbox"/>
72
                  </jx:when>
73
                  <jx:otherwise>
74
                    <input name="subtree" type="checkbox" checked="checked"/>
75
                  </jx:otherwise>
76
                </jx:choose>
77
                <i18n:text>deactivate complete subtree</i18n:text>
78
              </td>
79
            </tr>
80
            <tr>
81
              <td/>
82
              <td>
83
                <input i18n:attr="value" type="submit" name="submit" value="Deactivate"/>
84
                &#160;
85
                <input i18n:attr="value" type="submit" name="cancel" value="Cancel"/>
86
              </td>
87
            </tr>
88
          </table>
89
        </form>
90
      </div>
91
    </div>
92
  </page:body>
93
</page:page>
(-)lenya/usecases/workflow/reject.jx (+80 lines)
Line 0 Link Here
1
<?xml version="1.0"?>
2
<!--
3
  Copyright 1999-2004 The Apache Software Foundation
4
5
  Licensed under the Apache License, Version 2.0 (the "License");
6
  you may not use this file except in compliance with the License.
7
  You may obtain a copy of the License at
8
9
      http://www.apache.org/licenses/LICENSE-2.0
10
11
  Unless required by applicable law or agreed to in writing, software
12
  distributed under the License is distributed on an "AS IS" BASIS,
13
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
  See the License for the specific language governing permissions and
15
  limitations under the License.
16
-->
17
18
<!-- $Id: login.jx 123986 2005-01-03 15:23:11Z andreas $ -->
19
20
<page:page xmlns:jx="http://apache.org/cocoon/templates/jx/1.0" 
21
           xmlns:page="http://apache.org/cocoon/lenya/cms-page/1.0" 
22
           xmlns="http://www.w3.org/1999/xhtml" 
23
           xmlns:i18n="http://apache.org/cocoon/i18n/2.1" >
24
25
  <page:title><i18n:text>Reject Document</i18n:text></page:title>
26
  <page:body>
27
    <div class="lenya-box">
28
      <div class="lenya-box-title">
29
        <i18n:translate>
30
          <i18n:text i18n:key="reject-doc"/>
31
          <i18n:param><jx:out value="${usecase.getParameter('document').getId()}"/></i18n:param>
32
        </i18n:translate>      
33
      </div>
34
      <div class="lenya-box-body">
35
        <form>
36
          <input type="hidden" name="lenya.continuation" value="${continuation.id}"/>
37
          <input type="hidden" name="lenya.usecase" value="${request.getParameter('lenya.usecase')}"/>
38
          <table class="lenya-table-noborder">
39
            <tr>
40
              <td colspan="2">
41
                <ul>
42
                  <jx:forEach var="message" items="${usecase.getErrorMessages()}">
43
                    <li>
44
                      <i18n:text>
45
                        <jx:out value="${message}"/>
46
                      </i18n:text>
47
                    </li>
48
                  </jx:forEach>
49
                  <jx:forEach var="message" items="${usecase.getInfoMessages()}">
50
                    <li>
51
                      <i18n:text>
52
                        <jx:out value="${message}"/>
53
                      </i18n:text>
54
                    </li>
55
                  </jx:forEach>
56
                </ul>
57
              </td>
58
            </tr>
59
              <tr>
60
                <td colspan="2" class="lenya-entry-caption">
61
                  <i18n:translate>
62
                    <i18n:text i18n:key="reject-doc?"/>
63
                    <i18n:param><jx:out value="${usecase.getParameter('document').getId()}"/></i18n:param>
64
                  </i18n:translate>
65
                </td>
66
              </tr>
67
              <tr>
68
                <td/>
69
                <td>
70
                  <input i18n:attr="value" type="submit" name="submit" value="Reject"/>
71
                  &#160;
72
                  <input i18n:attr="value" type="submit" name="cancel" value="Cancel"/>
73
                </td>
74
              </tr>
75
          </table>
76
        </form>
77
      </div>
78
    </div>
79
  </page:body>
80
</page:page>
(-)publication.xml (-2 / +2 lines)
Lines 19-26 Link Here
19
19
20
<lenya:publication xmlns:lenya="http://apache.org/cocoon/lenya/publication/1.0">
20
<lenya:publication xmlns:lenya="http://apache.org/cocoon/lenya/publication/1.0">
21
  <lenya:name>Default Publication</lenya:name>
21
  <lenya:name>Default Publication</lenya:name>
22
  <lenya:pub-version>1.2.3-dev</lenya:pub-version>
22
  <lenya:pub-version>1.0</lenya:pub-version>
23
  <lenya:lenya-version>1.2.3-dev</lenya:lenya-version>
23
  <lenya:lenya-version>1.4-dev</lenya:lenya-version>
24
  <lenya:cocoon-version>2.1.6</lenya:cocoon-version>
24
  <lenya:cocoon-version>2.1.6</lenya:cocoon-version>
25
  <lenya:description>This publication is a best practice, getting started publication.</lenya:description>
25
  <lenya:description>This publication is a best practice, getting started publication.</lenya:description>
26
  <lenya:credits>Special thanks to </lenya:credits>
26
  <lenya:credits>Special thanks to </lenya:credits>
(-)resources/shared/css/page.css (-8 / +1 lines)
Lines 144-150 Link Here
144
    margin-right: 10px;
144
    margin-right: 10px;
145
    float: right;
145
    float: right;
146
    position:relative;
146
    position:relative;
147
    top:-20px;
147
    top:-20px
148
}
148
}
149
149
150
input.searchfield {
150
input.searchfield {
Lines 264-273 Link Here
264
    font-size: 10px;
264
    font-size: 10px;
265
    margin: 10px 10px 10px 5px;
265
    margin: 10px 10px 10px 5px;
266
}
266
}
267
268
#footer {
269
    padding: 5px;
270
	font-size: 60%;
271
    text-align: right;
272
    border-top: solid 1px #BB9999;
273
}
(-)resources/shared/css/xhtml.css (+1 lines)
Line 0 Link Here
1
/* Put your doctype-specific CSS here */
0
  + native
2
  + native
(-)resources/shared/css/links.css (+1 lines)
Line 0 Link Here
1
/* Put your doctype-specific CSS here */
0
  + native
2
  + native
(-)resources/shared/css/homepage.css (+1 lines)
Line 0 Link Here
1
/* Put your doctype-specific CSS here */
0
  + native
2
  + native
(-)resources/misc/bxe/xhtml-bxe.css (+16 lines)
Line 0 Link Here
1
/*
2
* Copyright 1999-2004 The Apache Software Foundation
3
*
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
7
*
8
*     http://www.apache.org/licenses/LICENSE-2.0
9
*
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
15
*/
16
@import url(page.css);
0
  + author date id revision
17
  + author date id revision
1
  + native
18
  + native
(-)resources/misc/bxe/xhtml-namespaces.xml (+26 lines)
Line 0 Link Here
1
<?xml version="1.0"?>
2
<!--
3
  Copyright 1999-2004 The Apache Software Foundation
4
5
  Licensed under the Apache License, Version 2.0 (the "License");
6
  you may not use this file except in compliance with the License.
7
  You may obtain a copy of the License at
8
9
      http://www.apache.org/licenses/LICENSE-2.0
10
11
  Unless required by applicable law or agreed to in writing, software
12
  distributed under the License is distributed on an "AS IS" BASIS,
13
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
  See the License for the specific language governing permissions and
15
  limitations under the License.
16
-->
17
18
<!-- $Id$ -->
19
20
<namespaces>
21
22
<xmlns>xhtml=http://www.w3.org/1999/xhtml</xmlns>
23
<xmlns>dc=http://purl.org/dc/elements/1.1/</xmlns>
24
<xmlns>lenya=http://apache.org/cocoon/lenya/page-envelope/1.0</xmlns>
25
26
</namespaces>
0
  + author date id revision
27
  + author date id revision
1
  + native
28
  + native
(-)publication-sitemap.xmap (-33 / +49 lines)
Lines 18-26 Link Here
18
<!-- $Id$ -->
18
<!-- $Id$ -->
19
19
20
<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
20
<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
21
  
21
22
  <map:components/>
23
  
24
  <map:views>
22
  <map:views>
25
    <map:view from-label="aggregation" name="aggregation">
23
    <map:view from-label="aggregation" name="aggregation">
26
      <map:serialize type="xml"/>
24
      <map:serialize type="xml"/>
Lines 32-38 Link Here
32
      <map:transform type="i18n">      
30
      <map:transform type="i18n">      
33
        <map:parameter name="locale" value="{request:locale}"/>
31
        <map:parameter name="locale" value="{request:locale}"/>
34
      </map:transform>    
32
      </map:transform>    
35
      <map:transform src="../../xslt/util/page2xhtml.xsl">
33
      <map:transform src="fallback://lenya/xslt/util/page2xhtml.xsl">
36
        <map:parameter name="contextprefix" value="{request:contextPath}"/>
34
        <map:parameter name="contextprefix" value="{request:contextPath}"/>
37
      </map:transform>
35
      </map:transform>
38
      <map:transform src="../../xslt/util/strip_namespaces.xsl"/>
36
      <map:transform src="../../xslt/util/strip_namespaces.xsl"/>
Lines 63-77 Link Here
63
    <map:pipeline>
61
    <map:pipeline>
64
      <map:match pattern="**/">
62
      <map:match pattern="**/">
65
        <map:redirect-to uri="index.html"/>
63
        <map:redirect-to uri="index.html"/>
66
        <!--<map:redirect-to uri="{1}.html"/>-->
67
      </map:match>
64
      </map:match>
68
    </map:pipeline>
65
    </map:pipeline>
69
    
66
    
70
    <map:pipeline>
67
    <map:pipeline>
71
      <!-- pattern="{rendertype}/{area}/{doctype}/{document-path}" -->
68
      <!-- pattern="{rendertype}/{area}/{doctype}/{document-path}" -->
72
      <!-- NOTE: rendertype seems to be 'edit' or 'view' -->
69
      <!-- NOTE: rendertype seems to be 'edit' or 'view' -->
73
      <map:match pattern="lenya-document-*/*/*/**.xml">
70
      <map:match pattern="lenya-document/*/*/*/**.xml">
74
        <map:mount check-reload="true" reload-method="synchron" src="doctypes.xmap" uri-prefix="lenya-document-"/>
71
        <map:mount uri-prefix="lenya-document/" src="{fallback:doctypes.xmap}" check-reload="true" reload-method="synchron"/>
75
      </map:match>
72
      </map:match>
76
    </map:pipeline>
73
    </map:pipeline>
77
74
Lines 81-99 Link Here
81
    <map:pipeline type="noncaching">
78
    <map:pipeline type="noncaching">
82
      
79
      
83
      <map:match pattern="*/**.rng">
80
      <map:match pattern="*/**.rng">
84
        <map:generate src="config/doctypes/schemas/{2}.rng"/>
81
        <map:generate src="fallback://config/doctypes/schemas/{2}.rng"/>
85
        <map:serialize type="xml"/>
82
        <map:serialize type="xml"/>
86
      </map:match>
83
      </map:match>
87
      
84
      
88
      <map:match pattern="**/*-bxeng.css">
85
      <map:match pattern="**/*-bxe.css">
89
        <map:read mime-type="text/css" src="resources/misc/bxeng/{2}-bxeng.css"/>
86
        <map:read mime-type="text/css" src="resources/misc/bxe/{2}-bxe.css"/>
90
      </map:match>
87
      </map:match>
91
      
88
      
92
      <map:handle-errors>
89
      <map:handle-errors>
93
        <map:select type="exception">
90
        <map:select type="exception">
94
           <map:when test="resourcenotfound">
91
           <map:when test="resourcenotfound">
95
             <map:generate src="../../content/util/empty.xml" />
92
             <map:generate src="../../content/util/empty.xml" />
96
            <map:transform src="../../xslt/exception/document-does-not-exist.xsl">
93
            <map:transform src="fallback://lenya/xslt/exception/document-does-not-exist.xsl">
97
              <map:parameter name="documentid" value="{page-envelope:document-id}"/>
94
              <map:parameter name="documentid" value="{page-envelope:document-id}"/>
98
              <map:parameter name="documenturl" value="{page-envelope:document-url}"/>
95
              <map:parameter name="documenturl" value="{page-envelope:document-url}"/>
99
            </map:transform>
96
            </map:transform>
Lines 125-133 Link Here
125
          <map:part src="cocoon://navigation/{2}/{3}/tabs/{5}.xml"/>
122
          <map:part src="cocoon://navigation/{2}/{3}/tabs/{5}.xml"/>
126
          <map:part src="cocoon://navigation/{2}/{3}/menu/{5}.xml"/>
123
          <map:part src="cocoon://navigation/{2}/{3}/menu/{5}.xml"/>
127
          <map:part src="cocoon://navigation/{2}/{3}/search/{5}.xml"/>
124
          <map:part src="cocoon://navigation/{2}/{3}/search/{5}.xml"/>
128
          <map:part src="cocoon:/lenya-document-{1}/{3}/{4}/{page-envelope:document-path}"/>
125
          <map:part src="cocoon:/lenya-document/{1}/{3}/{4}/{page-envelope:document-path}"/>
129
        </map:aggregate>
126
        </map:aggregate>
130
        <map:transform src="xslt/page2xhtml-{4}.xsl">
127
        <map:transform src="fallback://xslt/page2xhtml-{4}.xsl">
131
          <map:parameter name="root" value="{page-envelope:context-prefix}/{2}/{3}"/>
128
          <map:parameter name="root" value="{page-envelope:context-prefix}/{2}/{3}"/>
132
          <map:parameter name="url" value="{5}"/>
129
          <map:parameter name="url" value="{5}"/>
133
          <map:parameter name="document-id" value="{page-envelope:document-id}"/>
130
          <map:parameter name="document-id" value="{page-envelope:document-id}"/>
Lines 153-188 Link Here
153
        <map:serialize type="xml"/>
150
        <map:serialize type="xml"/>
154
      </map:match>
151
      </map:match>
155
      
152
      
156
      <map:match pattern="**.html">
153
      <map:match pattern="*/**.html">
157
        <map:act type="language-exists">
154
        <map:act type="language-exists">
158
	  <map:select type="resource-exists">
155
          <map:select type="resource-exists">
159
            <map:when test="{global:cache-dir}/{../1}.html">
156
            <!-- Read from cache -->
160
              <map:read src="{global:cache-dir}/{../1}.html" mime-type="text/html"/>
157
            <!-- If configured within Apache then mod_lenya will nevertheless read from cache -->
158
            <map:when test="{global:cache-dir}/{../1}/{../2}.html">
159
              <map:read src="{global:cache-dir}/{../1}/{../2}.html" mime-type="text/html"/>
161
            </map:when>
160
            </map:when>
161
            <!-- Write to cache and serialize -->
162
            <map:otherwise>
162
            <map:otherwise>
163
              <map:generate src="cocoon:/lenyabody-view/{page-envelope:publication-id}/{page-envelope:area}/{page-envelope:document-type}{page-envelope:document-url}"/>
163
164
          <map:generate src="cocoon:/lenyabody-view/{page-envelope:publication-id}/{page-envelope:area}/{page-envelope:document-type}{page-envelope:document-url}"/>
165
166
          <map:select type="browser">
167
            <map:when test="mozilla5">
164
              <map:match pattern="authoring/**.html">
168
              <map:match pattern="authoring/**.html">
165
                <map:transform src="cocoon://lenya-page/{page-envelope:publication-id}/{../../1}.xml?doctype={page-envelope:document-type}"/>
169
                <map:transform src="cocoon://lenya-page/{page-envelope:publication-id}/{../../1}/{../../2}.xml?doctype={page-envelope:document-type}&amp;uiml=xul"/>
166
              </map:match>
170
              </map:match>
171
              <map:serialize type="xml" mime-type="application/vnd.mozilla.xul+xml"/>
172
            </map:when>
173
            <map:otherwise>
174
              <map:match pattern="authoring/**.html">
175
                <map:transform src="cocoon://lenya-page/{page-envelope:publication-id}/{../../1}/{../../2}.xml?doctype={page-envelope:document-type}"/>
176
              </map:match>
167
              <map:transform src="../../xslt/util/strip_namespaces.xsl"/>
177
              <map:transform src="../../xslt/util/strip_namespaces.xsl"/>
168
              <map:match pattern="live/**.html">
178
              <!-- Write to cache for requests from live area -->
169
                <map:transform src="../../xslt/authoring/edit/addSourceTags.xsl">
179
              <map:select type="parameter">
170
                  <map:parameter name="source" value="{global:cache-dir}/live/{1}.html"/>
180
                <map:parameter name="parameter-selector-test" value="{../1}"/>
171
                </map:transform>
181
                <map:when test="live">
172
                <map:transform type="write-source">
182
                  <map:transform src="../../xslt/authoring/edit/addSourceTags.xsl">
173
                  <map:parameter name="serializer" value="html-no-dtd"/>
183
                    <map:parameter name="source" value="{global:cache-dir}/{../1}/{../2}.html"/>
174
                </map:transform>
184
                  </map:transform>
175
                <map:transform src="../../xslt/authoring/edit/removeSourceTags.xsl"/>
185
                  <map:transform type="write-source">
176
              </map:match>
186
                    <map:parameter name="serializer" value="html-no-dtd"/>
177
              <map:serialize type="html"/>
187
                  </map:transform>
188
                  <map:transform src="../../xslt/authoring/edit/removeSourceTags.xsl"/>
189
                </map:when>
190
              </map:select>
191
    	      <map:serialize type="html"/>
178
            </map:otherwise>
192
            </map:otherwise>
179
	  </map:select>
193
          </map:select>
194
            </map:otherwise>
195
          </map:select>
180
        </map:act>
196
        </map:act>
181
197
182
        <!-- There is no version of the requested document-id for the
198
        <!-- There is no version of the requested document-id for the
183
             requested language. -->
199
             requested language. -->
184
        <map:generate type="serverpages" src="../../content/exception/missing-language.xsp"/>
200
        <map:generate type="serverpages" src="../../content/exception/missing-language.xsp"/>
185
        <map:transform src="../../xslt/exception/missing-language.xsl"/>
201
        <map:transform src="fallback://lenya/xslt/exception/missing-language.xsl"/>
186
        <map:call resource="style-cms-page"/>
202
        <map:call resource="style-cms-page"/>
187
203
188
      </map:match>
204
      </map:match>
Lines 191-197 Link Here
191
        <map:select type="exception">
207
        <map:select type="exception">
192
          <map:when test="document-does-not-exist">
208
          <map:when test="document-does-not-exist">
193
            <map:generate src="../../content/util/empty.xml"/>
209
            <map:generate src="../../content/util/empty.xml"/>
194
            <map:transform src="../../xslt/exception/document-does-not-exist.xsl">
210
            <map:transform src="fallback://lenya/xslt/exception/document-does-not-exist.xsl">
195
              <map:parameter name="documentid" value="{page-envelope:document-id}"/>
211
              <map:parameter name="documentid" value="{page-envelope:document-id}"/>
196
              <map:parameter name="documenturl" value="{page-envelope:document-url}"/>
212
              <map:parameter name="documenturl" value="{page-envelope:document-url}"/>
197
            </map:transform>
213
            </map:transform>
Lines 201-207 Link Here
201
          </map:when>
217
          </map:when>
202
           <map:when test="resourcenotfound">
218
           <map:when test="resourcenotfound">
203
             <map:generate src="../../content/util/empty.xml" />
219
             <map:generate src="../../content/util/empty.xml" />
204
            <map:transform src="../../xslt/exception/document-does-not-exist.xsl">
220
            <map:transform src="fallback://lenya/xslt/exception/document-does-not-exist.xsl">
205
              <map:parameter name="documentid" value="{page-envelope:document-id}"/>
221
              <map:parameter name="documentid" value="{page-envelope:document-id}"/>
206
              <map:parameter name="documenturl" value="{page-envelope:document-url}"/>
222
              <map:parameter name="documenturl" value="{page-envelope:document-url}"/>
207
            </map:transform>
223
            </map:transform>
(-)usecase-bxeng.xmap (-290 lines)
Lines 1-290 Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<!--
3
  Copyright 1999-2004 The Apache Software Foundation
4
5
  Licensed under the Apache License, Version 2.0 (the "License");
6
  you may not use this file except in compliance with the License.
7
  You may obtain a copy of the License at
8
9
      http://www.apache.org/licenses/LICENSE-2.0
10
11
  Unless required by applicable law or agreed to in writing, software
12
  distributed under the License is distributed on an "AS IS" BASIS,
13
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
  See the License for the specific language governing permissions and
15
  limitations under the License.
16
-->
17
18
<!-- $Id$ -->
19
20
<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
21
  
22
	<!-- =========================== Components ================================ -->
23
	<map:components>
24
		<map:generators default="file"/>
25
		<map:transformers default="xalan"/>
26
		<map:readers default="resource"/>
27
		<map:serializers default="xhtml"/>
28
		<map:matchers default="wildcard"/>
29
        <map:actions/>
30
		<map:selectors/>
31
	</map:components>
32
	
33
  <!-- =========================== Resources ================================ -->
34
  <map:resources>
35
        
36
    <map:resource name="style-cms-page">
37
      <map:transform type="i18n">
38
        <map:parameter name="locale" value="{request:locale}"/>
39
      </map:transform>
40
      <map:transform src="../../xslt/util/page2xhtml.xsl">
41
        <map:parameter name="contextprefix" value="{request:contextPath}"/>
42
      </map:transform>
43
      <map:transform src="../../xslt/util/strip_namespaces.xsl"/>
44
      <map:select type="parameter">
45
        <map:parameter name="statusCode" value="{statusCode}"/>
46
        <map:when test="">
47
          <map:serialize type="html" />
48
        </map:when>
49
        <map:otherwise>
50
          <map:serialize type="html" status-code="{statusCode}"/>
51
        </map:otherwise>
52
      </map:select>
53
    </map:resource>
54
    
55
    <map:resource name="cms-screen-xml">
56
          <map:generate src="../../content/{serverpage}" type="serverpages"/>
57
          <map:transform src="../../xslt/{stylesheet}">
58
            <map:parameter name="use-request-parameters" value="true"/>
59
            <map:parameter name="contextprefix" value="{request:contextPath}"/>
60
          </map:transform>      
61
    </map:resource>
62
    
63
    <map:resource name="cms-screen">
64
      <map:call resource="cms-screen-xml">
65
        <map:parameter name="serverpage" value="{serverpage}"/>
66
        <map:parameter name="stylesheet" value="{stylesheet}"/>
67
      </map:call>
68
      <map:call resource="style-cms-page"/>
69
    </map:resource>
70
    
71
    
72
  </map:resources>
73
  <!-- =========================== Flow ===================================== -->
74
  <map:flow language="javascript">
75
    <map:script src="../../usecases/edit-document.js"/>
76
  </map:flow>
77
	<!-- =========================== Pipelines ================================ -->
78
	
79
	<map:pipelines>
80
	  
81
    <map:pipeline type="noncaching">
82
      
83
      <map:match pattern="request2document">
84
        <map:generate type="stream"/>
85
        <map:transform src="../../xslt/bxeng/change-object-path-back.xsl">
86
          <map:parameter name="documentid" value="{page-envelope:document-id}"/>
87
        </map:transform>
88
        <map:serialize type="xml"/>
89
      </map:match>
90
      
91
      <map:match type="usecase" pattern="bxeng">
92
        
93
      <map:match type="step" pattern="open">
94
       <!-- Check for BXENG -->
95
       <map:act type="resource-exists" src="../../resources/bxeng/bxeLoader.js">
96
        <map:act type="reserved-checkout">
97
          <map:generate type="serverpages" src="../../content/rc/{exception}.xsp">
98
            <map:parameter name="user" value="{user}"/>
99
            <map:parameter name="filename" value="{filename}"/>
100
            <map:parameter name="date" value="{date}"/>
101
            <map:parameter name="message" value="{message}"/>
102
          </map:generate>
103
          <map:transform src="../../xslt/rc/rco-exception.xsl"/>
104
          <map:call resource="style-cms-page"/>
105
        </map:act>
106
        <map:aggregate element="bxeng">
107
          <map:part src="../../resources/misc/bxeng/index.xhtml"/>
108
          <map:part src="../../resources/misc/bxeng/content-namespaces.xml"/>
109
        </map:aggregate>
110
        <map:transform src="../../xslt/bxeng/aggregate.xsl"/>
111
        <map:transform src="../../xslt/bxeng/index-xhtml.xsl">
112
          <map:parameter name="configfile" value="{request:requestURI}?lenya.usecase=bxeng&amp;lenya.step=config"/>
113
          <map:parameter name="context" value="{request:contextPath}"/>
114
        </map:transform>
115
        <map:transform src="../../xslt/util/strip_namespaces.xsl"/>
116
        <map:serialize type="xhtml"/>
117
        </map:act>
118
        <map:generate src="../../resources/misc/bxeng/download.xhtml"/>
119
        <map:call resource="style-cms-page"/>
120
        <map:serialize type="html"/>
121
      </map:match>
122
      
123
      <map:match pattern="image-upload-show" type="step">
124
        <map:call resource="cms-screen">
125
           <map:parameter name="serverpage" value="info/assets.xsp"/>
126
           <map:parameter name="stylesheet" value="bxeng/image.xsl"/>
127
        </map:call>
128
      </map:match>
129
130
      <map:match pattern="asset-upload-show" type="step">
131
        <map:call resource="cms-screen">
132
           <map:parameter name="serverpage" value="info/assets.xsp"/>
133
           <map:parameter name="stylesheet" value="bxeng/asset.xsl"/>
134
        </map:call>
135
      </map:match> 
136
      
137
          <map:match type="step" pattern="asset-upload">
138
            <map:act type="upload">
139
              <map:redirect-to uri="{request:requestURI}?lenya.usecase=bxeng&amp;lenya.step=asset-upload-show"/>
140
            </map:act>
141
            <map:call resource="cms-screen">
142
              <map:parameter name="serverpage" value="info/assets.xsp"/>
143
              <map:parameter name="stylesheet" value="bxeng/asset.xsl"/>
144
            </map:call>
145
          </map:match>
146
147
          <map:match type="step" pattern="image-upload">
148
            <map:act type="upload">
149
              <map:redirect-to uri="{request:requestURI}?lenya.usecase=bxeng&amp;lenya.step=image-upload-show"/>
150
            </map:act>
151
	        <map:call resource="cms-screen">
152
	           <map:parameter name="serverpage" value="info/assets.xsp"/>
153
	           <map:parameter name="stylesheet" value="bxeng/image.xsl"/>
154
	        </map:call>
155
	       </map:match>
156
157
      <map:match pattern="link-show" type="step">
158
            <!-- just a dummy xsp since we call the info area directly -->
159
           <map:generate type="serverpages" src="../../content/info/assets.xsp"/>
160
          <map:transform src="../../xslt/bxeng/link.xsl" label="content">
161
            <map:parameter name="infoarea" value="true"/>
162
            <map:parameter name="contextprefix" value="{request:contextPath}"/>
163
            <map:parameter name="publicationid" value="{page-envelope:publication-id}"/>
164
            <map:parameter name="area" value="authoring"/>
165
            <map:parameter name="tab" value="en"/>
166
            <map:parameter name="chosenlanguage" value="{page-envelope:document-language}"/>
167
            <map:parameter name="documentid" value="{page-envelope:document-id}"/>
168
            <map:parameter name="documenturl" value="/{page-envelope:document-url}"/>
169
            <map:parameter name="documentextension" value="{page-envelope:document-extension}"/>
170
            <map:parameter name="defaultlanguage" value="{page-envelope:default-language}"/>
171
            <map:parameter name="languages" value="{page-envelope:publication-languages-csv}"/>
172
          </map:transform>
173
        <map:call resource="style-cms-page"/>
174
      </map:match>
175
      
176
      <!-- {publication-id}/{area}/info-sitetree -->
177
      <map:match pattern="link-tree" type="step">
178
        <map:aggregate element="lenya" label="aggregate">
179
          <map:part src="content/authoring/sitetree.xml"/>
180
        </map:aggregate>
181
182
        <map:transform src="../../xslt/navigation/sitetree2nav.xsl" label="navtree">
183
          <map:parameter name="chosenlanguage" value="{request-param:language}"/>
184
          <map:parameter name="defaultlanguage" value="{page-envelope:default-language}"/>
185
        </map:transform>
186
187
        <map:transform src="../../xslt/bxeng/sitetree2tree.xsl" label="content">
188
          <map:parameter name="contextprefix" value="{request:contextPath}"/>
189
          <map:parameter name="publicationid" value="{page-envelope:publication-id}"/>
190
          <map:parameter name="chosenlanguage" value="{request-param:language}"/>
191
          <map:parameter name="defaultlanguage" value="{page-envelope:default-language}"/>
192
          <map:parameter name="cutdocumentid" value="{session-attr:org.apache.lenya.cms.info.cutdocumentid}"/>
193
         </map:transform>
194
195
        <map:serialize type="text"/>
196
      </map:match>      
197
198
      <map:match pattern="**/*.html">
199
        <!-- configuration -->
200
        <map:match type="step" pattern="config">
201
          <map:generate src="../../resources/misc/bxeng/inc/config.xml"/>
202
          <map:transform src="../../xslt/bxeng/config-xml.xsl">
203
            <map:parameter name="BX_xmlfile" value="{request:requestURI}?lenya.usecase=bxeng&amp;lenya.step=xml"/>
204
            <map:parameter name="defaultlanguage" value="{page-envelope:default-language}"/>
205
            
206
  <!--      Instead of an xsl we use the xhtml file to provide the basic layout
207
            <map:parameter name="BX_xslfile" value="{2}.xsl"/>
208
  -->
209
            <map:parameter name="BX_xhtmlfile" value="{../2}.bxe.html"/>
210
            <map:parameter name="BX_validationfile" value="{request:contextPath}/{page-envelope:publication-id}/{page-envelope:area}/{page-envelope:document-type}.rng"/>
211
            <map:parameter name="css" value="{request:contextPath}/{page-envelope:publication-id}/{page-envelope:area}/css/{page-envelope:document-type}-bxeng.css"/>
212
  <!--       The document is checked in when we exit from bx (in case of save&exit and in case of exit), so we use the usecase
213
             for the checkin while we redirect to the document
214
  -->
215
            <map:parameter name="BX_exitdestination" value="{request:requestURI}?lenya.usecase=checkin&amp;lenya.step=checkin&amp;backup=true"/>
216
            <map:parameter name="contextmenufile" value="../../resources/misc/bxeng/contextmenu.xml"/>
217
          </map:transform>
218
          <map:transform type="cinclude"/>
219
          <map:serialize type="xml"/>
220
        </map:match>
221
      </map:match>
222
      
223
      <map:match pattern="*/**.html">
224
      
225
      <!-- /GET and PUT -->
226
      <map:match type="step" pattern="xml">      
227
        <map:select type="request-method">
228
          
229
          <map:when test="PUT">
230
            <!-- before we save, we must be sure that the document is well checked out
231
            -->           
232
	        <map:act type="reserved-checkout-test">
233
    	      <map:generate type="serverpages" src="../../content/rc/{exception}.xsp">
234
        	    <map:parameter name="user" value="{user}"/>
235
            	<map:parameter name="filename" value="{filename}"/>
236
	            <map:parameter name="date" value="{date}"/>
237
    	      </map:generate>
238
        	  <map:transform src="../../xslt/rc/rco-exception.xsl"/>
239
	          <map:call resource="style-cms-page"/>
240
        	</map:act>
241
          
242
          <map:call function="editDocument">
243
            <map:parameter name="sourceUri" value="cocoon:/request2document"/>
244
            <map:parameter name="noCheckin" value="true"/>
245
          </map:call>
246
          </map:when>
247
248
          <map:otherwise> <!-- GET -->
249
            <map:generate src="content/authoring/{page-envelope:document-path}"/>
250
            <map:transform src="../../xslt/bxeng/change-object-path.xsl">
251
              <map:parameter name="documentid" value="{page-envelope:document-id}"/>
252
            </map:transform>
253
            <map:serialize type="xml"/>
254
          </map:otherwise>
255
          
256
        </map:select>
257
      </map:match>
258
      <!-- /GET and PUT -->
259
      
260
      </map:match> <!-- uri pattern -->
261
            
262
      </map:match> <!-- usecase -->
263
264
      <map:handle-errors>
265
        <map:select type="exception">
266
           <map:when test="resourcenotfound">
267
             <map:generate src="../../content/util/empty.xml" />
268
            <map:transform src="../../xslt/exception/document-does-not-exist.xsl">
269
              <map:parameter name="documentid" value="{page-envelope:document-id}"/>
270
              <map:parameter name="documenturl" value="{page-envelope:document-url}"/>
271
            </map:transform>
272
            <map:call resource="style-cms-page">
273
              <map:parameter name="statusCode" value="404"/>
274
            </map:call>
275
          </map:when>
276
        <map:otherwise>
277
        <map:generate type="notifying"/>
278
        <map:transform src="../../../stylesheets/system/error2html.xslt">
279
          <map:parameter name="contextPath" value="{request:contextPath}"/>
280
        </map:transform>
281
         </map:otherwise>
282
        </map:select>
283
        <map:serialize type="html"/>
284
      </map:handle-errors>
285
      
286
    </map:pipeline>
287
    
288
	</map:pipelines>
289
	
290
</map:sitemap>

Return to bug 34088