diff --git a/ccm-bundle/application.xml b/ccm-bundle/application.xml index 603b7aef7..3e9490443 100644 --- a/ccm-bundle/application.xml +++ b/ccm-bundle/application.xml @@ -11,8 +11,8 @@ - + diff --git a/ccm-bundle/bundles/demo/cfg/integration.properties b/ccm-bundle/bundles/demo/cfg/integration.properties index ee60cbf07..8ceafa035 100644 --- a/ccm-bundle/bundles/demo/cfg/integration.properties +++ b/ccm-bundle/bundles/demo/cfg/integration.properties @@ -17,6 +17,7 @@ waf.kernel.primary_user_identifier=email ; if you activate screen_name, forum loader does not work. ; waf.kernel.primary_user_identifier=screen_name waf.kernel.supported_languages=de,en +waf.kernel.language_independent_items=true ; security.properties: waf.auto_registration_on=false @@ -46,7 +47,7 @@ com.arsdigita.cms.default_item_template_path=/default/aplaws-item.jsp com.arsdigita.cms.default_template_resolver_class=com.arsdigita.subsite.dispatcher.SubsiteItemTemplateResolver ; Configure dhtml editor for use in cms content-center -; Xinha is default and should work out of the box +; Xinha is default and does work out of the box ; A CCM specific configuration file is used to prevent a mess with the standard ; configuration, default is: ; com.arsdigita.cms.dhtml_editor_config=Xinha.Config,/assets/xinha/CCMcmsXinhaConfig.js diff --git a/ccm-bundle/bundles/demo/cfg/project.xml b/ccm-bundle/bundles/demo/cfg/project.xml index f23df6d05..741f32d44 100644 --- a/ccm-bundle/bundles/demo/cfg/project.xml +++ b/ccm-bundle/bundles/demo/cfg/project.xml @@ -141,8 +141,10 @@ - + + - rss-files + rssfeed-files com.arsdigita.web.ApplicationFileServlet template-path - /templates/ccm-ldn-rss + /templates/ccm-rssfeed file-resolver - com.arsdigita.london.rss.RSSFileResolver + com.arsdigita.rssfeed.RSSFileResolver - + @@ -347,11 +347,12 @@ /ccm-navigation/files/* - + - rss-files - /ccm-ldn-rss/files/* + rssfeed-files + /ccm-rssfeed/files/* + @@ -420,7 +421,7 @@ legacy-adapter - /themes/servlet/legacy-adapter/* + /templates/servlet/legacy-adapter/* @@ -460,7 +461,7 @@ content-item-xsl - /themes/servlet/content-item/* + /templates/servlet/content-item/* diff --git a/ccm-bundle/bundles/devel/cfg/integration.properties b/ccm-bundle/bundles/devel/cfg/integration.properties index abfac2b10..a96199586 100644 --- a/ccm-bundle/bundles/devel/cfg/integration.properties +++ b/ccm-bundle/bundles/devel/cfg/integration.properties @@ -17,6 +17,7 @@ waf.kernel.primary_user_identifier=email ; if you activate screen_name, forum loader does not work. ; waf.kernel.primary_user_identifier=screen_name waf.kernel.supported_languages=en,de +waf.kernel.language_independent_items=true ; security.properties: waf.auto_registration_on=false @@ -46,7 +47,7 @@ com.arsdigita.cms.default_item_template_path=/default/aplaws-item.jsp com.arsdigita.cms.default_template_resolver_class=com.arsdigita.subsite.dispatcher.SubsiteItemTemplateResolver ; Configure dhtml editor for use in cms content-center -; Xinha is default and should work out of the box +; Xinha is default and does work out of the box ; A CCM specific configuration file is used to prevent a mess with the standard ; configuration, default is: ; com.arsdigita.cms.dhtml_editor_config=Xinha.Config,/assets/xinha/CCMcmsXinhaConfig.js diff --git a/ccm-bundle/bundles/devel/cfg/project.xml b/ccm-bundle/bundles/devel/cfg/project.xml index c78234076..7b53b183c 100644 --- a/ccm-bundle/bundles/devel/cfg/project.xml +++ b/ccm-bundle/bundles/devel/cfg/project.xml @@ -81,10 +81,10 @@ - +--> @@ -134,16 +134,16 @@ --> - - - + + + + --> + + diff --git a/ccm-bundle/bundles/devel/cfg/web-sci.xml b/ccm-bundle/bundles/devel/cfg/web-sci.xml index af99c77aa..cd676d146 100644 --- a/ccm-bundle/bundles/devel/cfg/web-sci.xml +++ b/ccm-bundle/bundles/devel/cfg/web-sci.xml @@ -220,20 +220,20 @@ com.arsdigita.dispatcher.PortletTypeXSLServlet - + - rss-files + rssfeed-files com.arsdigita.web.ApplicationFileServlet template-path - /templates/ccm-ldn-rss + /templates/ccm-rssfeed file-resolver - com.arsdigita.london.rss.RSSFileResolver + com.arsdigita.rssfeed.RSSFileResolver - + @@ -347,11 +347,12 @@ /ccm-navigation/files/* - + - rss-files - /ccm-ldn-rss/files/* + rssfeed-files + /ccm-rssfeed/files/* + @@ -420,7 +421,7 @@ legacy-adapter - /themes/servlet/legacy-adapter/* + /templates/servlet/legacy-adapter/* @@ -460,7 +461,7 @@ content-item-xsl - /themes/servlet/content-item/* + /templates/servlet/content-item/* diff --git a/ccm-bundle/src/com/arsdigita/bundle/ui/ItemCategoryPicker.java b/ccm-bundle/src/com/arsdigita/bundle/ui/ItemCategoryPicker.java index 1b9365278..de490e90c 100644 --- a/ccm-bundle/src/com/arsdigita/bundle/ui/ItemCategoryPicker.java +++ b/ccm-bundle/src/com/arsdigita/bundle/ui/ItemCategoryPicker.java @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -package com.arsdigita.aplaws.ui; +package com.arsdigita.bundle.ui; import org.apache.log4j.Logger; @@ -26,7 +26,7 @@ import com.arsdigita.bebop.parameters.StringParameter; import com.arsdigita.categorization.ui.ACSObjectCategoryForm; import com.arsdigita.cms.CMS; import com.arsdigita.cms.ContentItem; -import com.arsdigita.cms.ui.authoring.*; +import com.arsdigita.cms.ui.authoring.ItemCategoryForm; import com.arsdigita.kernel.ACSObject; import com.arsdigita.london.terms.ui.ACSObjectCategoryPicker; import com.arsdigita.london.terms.ui.TermWidget; diff --git a/ccm-bundle/src/com/arsdigita/bundle/ui/SimplePage.java b/ccm-bundle/src/com/arsdigita/bundle/ui/SimplePage.java index bafa8be3c..b5f56e7fa 100644 --- a/ccm-bundle/src/com/arsdigita/bundle/ui/SimplePage.java +++ b/ccm-bundle/src/com/arsdigita/bundle/ui/SimplePage.java @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -package com.arsdigita.aplaws.ui; +package com.arsdigita.bundle.ui; import com.arsdigita.bebop.PageState; import com.arsdigita.bebop.Label; diff --git a/ccm-bundle/src/com/arsdigita/bundle/ui/TermItemSummary.java b/ccm-bundle/src/com/arsdigita/bundle/ui/TermItemSummary.java index f6aee2e6e..0f19c3364 100644 --- a/ccm-bundle/src/com/arsdigita/bundle/ui/TermItemSummary.java +++ b/ccm-bundle/src/com/arsdigita/bundle/ui/TermItemSummary.java @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -package com.arsdigita.aplaws.ui; +package com.arsdigita.bundle.ui; import com.arsdigita.london.terms.Domain; import com.arsdigita.london.terms.ui.AbstractTermItemSummary; diff --git a/ccm-bundle/web/packages/content-section/www/admin/auto-cat.jsp b/ccm-bundle/web/templates/ccm-cms/content-section/admin/auto-cat.jsp similarity index 100% rename from ccm-bundle/web/packages/content-section/www/admin/auto-cat.jsp rename to ccm-bundle/web/templates/ccm-cms/content-section/admin/auto-cat.jsp diff --git a/ccm-bundle/web/packages/content-section/www/admin/load-cat.jsp b/ccm-bundle/web/templates/ccm-cms/content-section/admin/load-cat.jsp similarity index 100% rename from ccm-bundle/web/packages/content-section/www/admin/load-cat.jsp rename to ccm-bundle/web/templates/ccm-cms/content-section/admin/load-cat.jsp diff --git a/ccm-bundle/web/packages/content-section/www/crash-me.jsp b/ccm-bundle/web/templates/ccm-cms/content-section/crash-me.jsp similarity index 100% rename from ccm-bundle/web/packages/content-section/www/crash-me.jsp rename to ccm-bundle/web/templates/ccm-cms/content-section/crash-me.jsp diff --git a/ccm-bundle/web/packages/content-section/templates/default/aplaws-folder.jsp b/ccm-bundle/web/templates/ccm-cms/content-section/default/aplaws-folder.jsp similarity index 100% rename from ccm-bundle/web/packages/content-section/templates/default/aplaws-folder.jsp rename to ccm-bundle/web/templates/ccm-cms/content-section/default/aplaws-folder.jsp diff --git a/ccm-bundle/web/packages/content-section/templates/default/aplaws-item.jsp b/ccm-bundle/web/templates/ccm-cms/content-section/default/aplaws-item.jsp similarity index 100% rename from ccm-bundle/web/packages/content-section/templates/default/aplaws-item.jsp rename to ccm-bundle/web/templates/ccm-cms/content-section/default/aplaws-item.jsp diff --git a/ccm-sci-bundle/web/packages/content-section/www/person4homepages.jsp b/ccm-bundle/web/templates/ccm-cms/content-section/person4homepages.jsp similarity index 100% rename from ccm-sci-bundle/web/packages/content-section/www/person4homepages.jsp rename to ccm-bundle/web/templates/ccm-cms/content-section/person4homepages.jsp diff --git a/ccm-sci-bundle/web/packages/content-section/www/projects4homepages.jsp b/ccm-bundle/web/templates/ccm-cms/content-section/projects4homepages.jsp similarity index 100% rename from ccm-sci-bundle/web/packages/content-section/www/projects4homepages.jsp rename to ccm-bundle/web/templates/ccm-cms/content-section/projects4homepages.jsp diff --git a/ccm-sci-bundle/web/packages/content-section/www/publications4homepages.jsp b/ccm-bundle/web/templates/ccm-cms/content-section/publications4homepages.jsp similarity index 100% rename from ccm-sci-bundle/web/packages/content-section/www/publications4homepages.jsp rename to ccm-bundle/web/templates/ccm-cms/content-section/publications4homepages.jsp diff --git a/ccm-bundle/web/packages/content-section/www/textonly.jsp b/ccm-bundle/web/templates/ccm-cms/content-section/textonly.jsp similarity index 100% rename from ccm-bundle/web/packages/content-section/www/textonly.jsp rename to ccm-bundle/web/templates/ccm-cms/content-section/textonly.jsp diff --git a/ccm-bundle/web/templates/ccm-navigation/navigation/sitemap.jsp b/ccm-bundle/web/templates/ccm-navigation/navigation/sitemap.jsp index 2c4559768..2a614450e 100644 --- a/ccm-bundle/web/templates/ccm-navigation/navigation/sitemap.jsp +++ b/ccm-bundle/web/templates/ccm-navigation/navigation/sitemap.jsp @@ -1,7 +1,7 @@ + xmlns:define="/WEB-INF/bebop-define.tld" + xmlns:show="/WEB-INF/bebop-show.tld" + version="1.2"> diff --git a/ccm-bundle/web/themes/static/aplaws-generic/content-section-admin.xsl b/ccm-bundle/web/themes/static/aplaws-generic/content-section-content-admin.xsl similarity index 95% rename from ccm-bundle/web/themes/static/aplaws-generic/content-section-admin.xsl rename to ccm-bundle/web/themes/static/aplaws-generic/content-section-content-admin.xsl index 7fa9efb68..70dc7223f 100644 --- a/ccm-bundle/web/themes/static/aplaws-generic/content-section-admin.xsl +++ b/ccm-bundle/web/themes/static/aplaws-generic/content-section-content-admin.xsl @@ -7,7 +7,7 @@ exclude-result-prefixes="bebop cms ui aplaws xsl" version="1.0"> - + diff --git a/ccm-bundle/web/themes/static/aplaws-generic/forum-example/categorised-forum/forum-categories.xsl b/ccm-bundle/web/themes/static/aplaws-generic/forum-example/categorised-forum/forum-categories.xsl index 5c8293890..89557e8cb 100644 --- a/ccm-bundle/web/themes/static/aplaws-generic/forum-example/categorised-forum/forum-categories.xsl +++ b/ccm-bundle/web/themes/static/aplaws-generic/forum-example/categorised-forum/forum-categories.xsl @@ -9,8 +9,8 @@ version="1.0"> diff --git a/ccm-bundle/web/themes/static/aplaws-generic/forum-example/categorised-forum/forum-index.xsl b/ccm-bundle/web/themes/static/aplaws-generic/forum-example/categorised-forum/forum-index.xsl index 4fba593f8..94f34946a 100644 --- a/ccm-bundle/web/themes/static/aplaws-generic/forum-example/categorised-forum/forum-index.xsl +++ b/ccm-bundle/web/themes/static/aplaws-generic/forum-example/categorised-forum/forum-index.xsl @@ -1,1311 +1,1312 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Forum - - - - - - - - - - - Skip over navigation - | - - - - - - - - - - - - - - - - - - - - - - -
- - - -
- - - - - - | - - - - | - -
-

-
-
- -
-
-
- - - - - - - - - - postOdd - - - postEven - - - - - - - - - - - - - - - - - - - - - - - -
Thread:
- - -
- -
-
-
-
- - - ( - - ) - -
- - -
- - - Approve - - -   - - - - - Reject - - -   - - - - Edit - - -   - - - - Delete - - -   - - -   -   -   - - Reply - -   - Reply -   - -
-
-
- -
- Posted:  - -  by  - - - -
- -
- - - -
- -
-
-
- -
-
-
- -
- -
- -
- - -
- {./description} -
-
-
-
-
- - - - - - -
- -
-
- - - -
-
- - - - - - - - - - <<< Previous - -   -   - - Page  -   - of  -   - -   -   - - - - - - - - - Next >>> - - -
-
-
- - - -
-
- -
-
Filter by topic:
- -
- -
-
-
-
-
-
- - -
-
-
Thread
-
Author
-
Replies
-
Last Post
-
- -
No messages have been posted yet
-
- - -
- - - - odd - - - even - - - - - -
- - - -
-
- -
-
- -
-
- -
- -
-
-
- - - -
- - -
-
-
Subject
-
Replies
-
Author
-
Last Post
-
Status
-
Delete
-
-
- -
- You are not subscribed to any threads -
-
- - - - - postOdd - - - postEven - - - -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
-
-
- - -
- - - - false - - - -
-
- - - - -
-
-
Topic
-
Threads
-
Last Post
-
- - - - - - postOdd - - - postEven - - - -
-
- - - - - - - - - - - - - - - - - -
-
- -
-
- - - - - - n/a - - -
-
-
- - - - - postOdd - - - postEven - - - -
-
- - - - - - - - - - - None - - - - None - - -
-
- -
-
- - - - - - n/a - - -
-
-
-
-
- - -
-
Forum Alerts
-
- -
-
- - - - -
-
Thread Alerts
-
- -
-
- - - -
- - - - -
- - - - -
-
-
-   -
-
-
-
- - - - - - -
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - forum member list -
-
- - - -
-
-
-
- - - -
- -
-
-   -
-
- - -
- -
-
-   -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - post - - - - - - - -
-

- -
- -
-
- - - - - -
-
- -
-
- -
-
-
- - - - -
-
-
-
-
- -
- - - - -
-
Subject:
-
- -
- -
-
-
-
-
Message:
-
- -
- -
-
-
- - - -
-
Topic:
-
- -
-
-
- -
- Original Message: -
-
-
- -
-
-
-
- -
- - - - - - -
-
- - - -
-
- -
- Posted - -
-
-
- -
-
-
- - - - - - - - - - - - -
-
Image:
-
- -
- -
-
-
-
-
Description:
-
- -
- -
-
-
-
-
- -
-
-
- - - - - - -
- No images attached to this post -
-
- - - - - - - postOdd - - - postEven - - - -
-
-
- {@caption} -
-
- -
-
- Remove -
-
-
-
-
-
-
- - - - - - -
- -
- -
-
File:
-
- -
- -
-
-
-
-
Description:
-
- -
- -
-
-
-
-
- -
-
-
- - - - -
- No files attached to this post -
-
- -
- - - - - - - - - - - - -
File
Description
-
- - - - - - - - - - - Remove
-
-
-
- -
- -
- - -
- -
-
- - - - - - - Post New Message - - - Add Images (optional) - - - Add Files (optional) - - - Preview New Message - - - - - - - - - - - - Edit Message - - - Edit Images - - - Edit Files - - - Preview Changes - - - - - - - - - - - - Post reply - - - Add Images (optional) - - - Add Files (optional) - - - Preview Reply - - - - - - - - -
-
- - - -
-

-
-
- -
-
Name:
-
- -
- -
-
-
-
-
Description:
-
- -
- -
-
-
-
-
- -
-
-
- -
-
- - - - -
- - - - - -
-

-
-
-
- - -
-
-
- -
- -
-
-
-
-
-
- -
- -
-
-
-
- - -
- - - - - -
-
-
-
- -
-
-
- -
-
-
-
- -
- - -
-
- - - -
- -
-
- -
-
- -
-
- -
-
- - -
- - -
-
- -
-
- -
-
-
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
- - - - - - -
- -
- - - - - - - - - - - - - - -
- You are watching this thread. To stop watching this thread, click "Stop Watching Thread" below. -
- -
- - - - - - - - - - - -
- - - - -
- - - -
-
-
- - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Forum + + + + + + + + + + + Skip over navigation + | + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + + + + | + + + + | + +
+

+
+
+ +
+
+
+ + + + + + + + + + postOdd + + + postEven + + + + + + + + + + + + + + + + + + + + + + + +
Thread:
+ + +
+ +
+
+
+
+ + + ( + + ) + +
+ + +
+ + + Approve + + +   + + + + + Reject + + +   + + + + Edit + + +   + + + + Delete + + +   + + +   +   +   + + Reply + +   + Reply +   + +
+
+
+ +
+ Posted:  + +  by  + + + +
+ +
+ + + +
+ +
+
+
+ +
+
+
+ +
+ +
+ +
+ + +
+ {./description} +
+
+
+
+
+ + + + + + +
+ +
+
+ + + +
+
+ + + + + + + + + + <<< Previous + +   +   + + Page  +   + of  +   + +   +   + + + + + + + + + Next >>> + + +
+
+
+ + + +
+
+ +
+
Filter by topic:
+ +
+ +
+
+
+
+
+
+ + +
+
+
Thread
+
Author
+
Replies
+
Last Post
+
+ +
No messages have been posted yet
+
+ + +
+ + + + odd + + + even + + + + + +
+ + + +
+
+ +
+
+ +
+
+ +
+ +
+
+
+ + + +
+ + +
+
+
Subject
+
Replies
+
Author
+
Last Post
+
Status
+
Delete
+
+
+ +
+ You are not subscribed to any threads +
+
+ + + + + postOdd + + + postEven + + + +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+
+
+ + +
+ + + + false + + + +
+
+ + + + +
+
+
Topic
+
Threads
+
Last Post
+
+ + + + + + postOdd + + + postEven + + + +
+
+ + + + + + + + + + + + + + + + + +
+
+ +
+
+ + + + + + n/a + + +
+
+
+ + + + + postOdd + + + postEven + + + +
+
+ + + + + + + + + + + None + + + + None + + +
+
+ +
+
+ + + + + + n/a + + +
+
+
+
+
+ + +
+
Forum Alerts
+
+ +
+
+ + + + +
+
Thread Alerts
+
+ +
+
+ + + +
+ + + + +
+ + + + +
+
+
+   +
+
+
+
+ + + + + + +
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + forum member list +
+
+ + + +
+
+
+
+ + + +
+ +
+
+   +
+
+ + +
+ +
+
+   +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
+ + + post + + + + + + + +
+

+ +
+ +
+
+ + + + + +
+
+ +
+
+ +
+
+
+ + + + +
+
+
+
+
+ +
+ + + + +
+
Subject:
+
+ +
+ +
+
+
+
+
Message:
+
+ +
+ +
+
+
+ + + +
+
Topic:
+
+ +
+
+
+ +
+ Original Message: +
+
+
+ +
+
+
+
+ +
+ + + + + + +
+
+ + + +
+
+ +
+ Posted + +
+
+
+ +
+
+
+ + + + + + + + + + + + +
+
Image:
+
+ +
+ +
+
+
+
+
Description:
+
+ +
+ +
+
+
+
+
+ +
+
+
+ + + + + + +
+ No images attached to this post +
+
+ + + + + + + postOdd + + + postEven + + + +
+
+
+ {@caption} +
+
+ +
+
+ Remove +
+
+
+
+
+
+
+ + + + + + +
+ +
+ +
+
File:
+
+ +
+ +
+
+
+
+
Description:
+
+ +
+ +
+
+
+
+
+ +
+
+
+ + + + +
+ No files attached to this post +
+
+ +
+ + + + + + + + + + + + +
File
Description
+
+ + + + + + + + + + + Remove
+
+
+
+ +
+ +
+ + +
+ +
+
+ + + + + + + Post New Message + + + Add Images (optional) + + + Add Files (optional) + + + Preview New Message + + + + + + + + + + + + Edit Message + + + Edit Images + + + Edit Files + + + Preview Changes + + + + + + + + + + + + Post reply + + + Add Images (optional) + + + Add Files (optional) + + + Preview Reply + + + + + + + + +
+
+ + + +
+

+
+
+ +
+
Name:
+
+ +
+ +
+
+
+
+
Description:
+
+ +
+ +
+
+
+
+
+ +
+
+
+ +
+
+ + + + +
+ + + + + +
+

+
+
+
+ + +
+
+
+ +
+ +
+
+
+
+
+
+ +
+ +
+
+
+
+ + +
+ + + + + +
+
+
+
+ +
+
+
+ +
+
+
+
+ +
+ + +
+
+ + + +
+ +
+
+ +
+
+ +
+
+ +
+
+ + +
+ + +
+
+ +
+
+ +
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + +
+ +
+ + + + + + + + + + + + + + +
+ You are watching this thread. To stop watching this thread, click "Stop Watching Thread" below. +
+ +
+ + + + + + + + + + + +
+ + + + +
+ + + +
+
+
+ + diff --git a/ccm-bundle/web/themes/static/aplaws-generic/forum-example/forum-index.xsl b/ccm-bundle/web/themes/static/aplaws-generic/forum-example/forum-index.xsl index 6c28dd698..b87c2c0ce 100644 --- a/ccm-bundle/web/themes/static/aplaws-generic/forum-example/forum-index.xsl +++ b/ccm-bundle/web/themes/static/aplaws-generic/forum-example/forum-index.xsl @@ -8,16 +8,9 @@ exclude-result-prefixes="xsl bebop nav search portal forum cms" version="1.0"> - - - - - + + + diff --git a/ccm-bundle/web/themes/static/aplaws-generic/forum-index.xsl b/ccm-bundle/web/themes/static/aplaws-generic/forum-index.xsl index 40150b681..cac13d5c8 100644 --- a/ccm-bundle/web/themes/static/aplaws-generic/forum-index.xsl +++ b/ccm-bundle/web/themes/static/aplaws-generic/forum-index.xsl @@ -1,3 +1,4 @@ + - - diff --git a/ccm-bundle/web/themes/static/aplaws-generic/lib/lib.xsl b/ccm-bundle/web/themes/static/aplaws-generic/lib/lib.xsl index f8247e3b8..216ffc077 100644 --- a/ccm-bundle/web/themes/static/aplaws-generic/lib/lib.xsl +++ b/ccm-bundle/web/themes/static/aplaws-generic/lib/lib.xsl @@ -1,14 +1,13 @@ - + @@ -164,7 +163,7 @@ copyright &nbsp;|&nbsp; disclaimer and privacy statement - &nbsp;|& + &nbsp;|&nbsp; contact &nbsp;|&nbsp; accessibility @@ -188,13 +187,6 @@ - - - - - - - @@ -203,6 +195,8 @@ + + diff --git a/ccm-bundle/web/themes/static/aplaws-generic/portal/content-sections-portlet.xsl b/ccm-bundle/web/themes/static/aplaws-generic/portal/content-sections-portlet.xsl index 22d71ba97..d0c9afd1d 100644 --- a/ccm-bundle/web/themes/static/aplaws-generic/portal/content-sections-portlet.xsl +++ b/ccm-bundle/web/themes/static/aplaws-generic/portal/content-sections-portlet.xsl @@ -1,11 +1,11 @@ - + diff --git a/ccm-bundle/web/themes/static/aplaws-generic/portal/portlets.xsl b/ccm-bundle/web/themes/static/aplaws-generic/portal/portlets.xsl index 034983188..33286b190 100644 --- a/ccm-bundle/web/themes/static/aplaws-generic/portal/portlets.xsl +++ b/ccm-bundle/web/themes/static/aplaws-generic/portal/portlets.xsl @@ -1,23 +1,23 @@ - - - - - - - - - - - - - + + + + + + + + + + + + + diff --git a/ccm-bundle/web/themes/static/aplaws-generic/portal/time-of-day-portlet.xsl b/ccm-bundle/web/themes/static/aplaws-generic/portal/time-of-day-portlet.xsl index 1d4dd4075..35c7398c9 100644 --- a/ccm-bundle/web/themes/static/aplaws-generic/portal/time-of-day-portlet.xsl +++ b/ccm-bundle/web/themes/static/aplaws-generic/portal/time-of-day-portlet.xsl @@ -1,12 +1,11 @@ - - + diff --git a/ccm-bundle/web/themes/static/aplaws-generic/types/ContentTypes.xsl b/ccm-bundle/web/themes/static/aplaws-generic/types/ContentTypes.xsl index 3a2c402c5..8b3c97dfe 100644 --- a/ccm-bundle/web/themes/static/aplaws-generic/types/ContentTypes.xsl +++ b/ccm-bundle/web/themes/static/aplaws-generic/types/ContentTypes.xsl @@ -40,7 +40,7 @@ - + diff --git a/ccm-bundle/web/themes/static/aplaws-generic/types/SimpleAddress.xsl b/ccm-bundle/web/themes/static/aplaws-generic/types/SimpleAddress.xsl index 3c028f660..fc7885c6f 100644 --- a/ccm-bundle/web/themes/static/aplaws-generic/types/SimpleAddress.xsl +++ b/ccm-bundle/web/themes/static/aplaws-generic/types/SimpleAddress.xsl @@ -1,5 +1,4 @@ - The Message of the Day Item Content Type for the Red Hat CCM CMS. + + It is supposed to provide an entry field for a message of the day test and + an associated file, presumably downloadable. Presentation logic unkown. + + Status Note: + The current code lacks any xsl template. The content type does not appear + in the list of content types in content center. So it is currently + unsupported. diff --git a/ccm-cms/src/WEB-INF/resources/content-center-old-map.xml b/ccm-cms/src/WEB-INF/resources/content-center-old-map.xml new file mode 100755 index 000000000..379f72132 --- /dev/null +++ b/ccm-cms/src/WEB-INF/resources/content-center-old-map.xml @@ -0,0 +1,18 @@ + + + + com.arsdigita.cms.ui.CMSPageWorkspacePage + + + index/ + com.arsdigita.cms.ui.CMSPageWorkspacePage + + + searchredirect/ + com.arsdigita.cms.ui.SearchResultRedirector + + + item-search/ + com.arsdigita.cms.ui.ItemSearchPage + + diff --git a/ccm-cms/src/com/arsdigita/cms/CMSConfig.java b/ccm-cms/src/com/arsdigita/cms/CMSConfig.java index 4687cb38e..5f977e54d 100755 --- a/ccm-cms/src/com/arsdigita/cms/CMSConfig.java +++ b/ccm-cms/src/com/arsdigita/cms/CMSConfig.java @@ -470,22 +470,39 @@ public final class CMSConfig extends AbstractConfig { * SortKey|Alphabetical is initialized in constructor! See below. */ private final Parameter m_categoryTreeOrdering = - new EnumerationParameter( - "com.arsdigita.cms.category_tree_order", - Parameter.OPTIONAL, - Category.SORT_KEY); + new EnumerationParameter( + "com.arsdigita.cms.category_tree_order", + Parameter.OPTIONAL, + Category.SORT_KEY); + /** - * Allow content creation in section listing. Allows you to turn off - * the ability to create content in the section listing + * Allow content creation in Workspace (content center) section listing. + * Allows you to turn off the ability to create content in the section listing */ private final Parameter m_allowContentCreateInSectionListing = - new BooleanParameter( - "com.arsdigita.cms.allow_content_create_in_section_listing", - Parameter.REQUIRED, - new Boolean(true)); + new BooleanParameter( + "com.arsdigita.cms.allow_content_create_in_section_listing", + Parameter.REQUIRED, + new Boolean(true)); + + /** + * Hide the legacy public site link in Workspace (content center) section + * listing. Legacy public site display is replaced by navigation based + * presentation (or by portlets) and should be hidden in the admin ui + * be default now. + */ + private final Parameter m_hideLegacyPublicSiteLink = + new BooleanParameter( + "com.arsdigita.cms.hide_legacy_public_site_link", + Parameter.REQUIRED, + new Boolean(true)); + + // /////////////////////////////////////////// // Notification related parameters // /////////////////////////////////////////// + + /** * Delete Sent Workflow Notifications. Decide whether successfully sent * notifications and messages should be deleted from the system @@ -670,6 +687,7 @@ public final class CMSConfig extends AbstractConfig { register(m_hasContactsAuthoringStep); register(m_hideTextAssetUploadFile); register(m_allowContentCreateInSectionListing); + register(m_hideLegacyPublicSiteLink); // Content Center (Workspace) config related parameters register(m_contentCenterMap); @@ -1079,6 +1097,14 @@ public final class CMSConfig extends AbstractConfig { booleanValue(); } + /** + * Hide the (no longer used) legacy public site link in Workspace + * (content center) section listing, true by default. + */ + public final boolean getHideLegacyPublicSiteLink() { + return ((Boolean) get(m_hideLegacyPublicSiteLink)).booleanValue(); + } + public String getItemSearchDefaultTab() { return (String) get(m_itemSearchDefaultTab); } diff --git a/ccm-cms/src/com/arsdigita/cms/ContentSection.java b/ccm-cms/src/com/arsdigita/cms/ContentSection.java index 4909b12fa..771a8d509 100755 --- a/ccm-cms/src/com/arsdigita/cms/ContentSection.java +++ b/ccm-cms/src/com/arsdigita/cms/ContentSection.java @@ -250,47 +250,10 @@ public class ContentSection extends Application { set(NAME, name); } -// Left-over from content section as old-style application based on kernel -// PackageType and Sitenode instead on new style web.Application. -// Retained for reference purpose until the packages Workspace and Service are -// migrated to new style application as well. -// /** -// * Get the package instance for this content section. Each section is -// * associated with exactly one package instance. -// * -// * @return the package instance associated with this content section. -// * @post return != null -// */ -// public PackageInstance getPackageInstance() { -// DataObject pkg = (DataObject) get(PACKAGE); -// Assert.exists(pkg, "package instance"); -// return new PackageInstance(pkg); -// } -// -// /** -// * Set the package instance for this content section. -// * -// * @param pkg The package instance -// * @pre ( pkg != null ) -// */ -// protected void setPackageInstance(PackageInstance pkg) { -// Assert.exists(pkg, "package instance"); -// setAssociation(PACKAGE, pkg); -// } -// -// /** -// * Fetch the site node on which the content section is mounted. -// * A content section should be mounted on exactly one site node. If it -// * is mounted on more than one site node, only the first site node will -// * be returned. -// * -// * @return The site node -// */ -// public SiteNode getSiteNode() { -// return getPackageInstance().getDefaultMountPoint(); -// } /** - * Finds the location of the content section. + * Finds the location of the content section from the HTTP request. Therefore + * it contains the static prefix (if one is configured, "ccm" by default) + * and must not be used to construct an url for internal links! * * @return The URL of the site node on which the content section is mounted. * This URL includes the webapp context path. @@ -316,7 +279,10 @@ public class ContentSection extends Application { } /** - * Gets the full path of the content section. + * Gets the full path of the content section from the dispatcher + * + * Currently a guess: It includes the static dispatcher prefix + * (if any is configured, "ccm" by default). * * @return returns the path of this application including the dispatcher path. * The path does not end in a slash. Does not return null @@ -325,16 +291,6 @@ public class ContentSection extends Application { return URL.getDispatcherPath() + getPath(); } -// Left over, see above -// public final String getPath() { -// final String path = getSiteNode().getURL(); -// -// if (Assert.isEnabled()) { -// Assert.isTrue(path.endsWith("/")); -// } -// -// return path.substring(0, path.length() - 1); -// } /** * Get the folder in which all draft items are contained, directly or * indirectly. This folder will in general contain different kinds of diff --git a/ccm-cms/src/com/arsdigita/cms/ContentSectionServlet.java b/ccm-cms/src/com/arsdigita/cms/ContentSectionServlet.java index 6aeff78c7..01b51fa1f 100755 --- a/ccm-cms/src/com/arsdigita/cms/ContentSectionServlet.java +++ b/ccm-cms/src/com/arsdigita/cms/ContentSectionServlet.java @@ -33,6 +33,7 @@ import com.arsdigita.domain.DomainObjectFactory; import com.arsdigita.globalization.GlobalizationHelper; import com.arsdigita.kernel.ACSObjectCache; import com.arsdigita.kernel.Kernel; +import com.arsdigita.kernel.KernelContext; import com.arsdigita.kernel.Party; import com.arsdigita.kernel.User; import com.arsdigita.persistence.AbstractTransactionListener; @@ -41,8 +42,10 @@ import com.arsdigita.persistence.Session; import com.arsdigita.persistence.SessionManager; import com.arsdigita.persistence.TransactionContext; import com.arsdigita.util.Assert; +import com.arsdigita.util.Classes; import com.arsdigita.versioning.Versions; import com.arsdigita.web.Application; +import com.arsdigita.web.ApplicationFileResolver; import com.arsdigita.web.BaseApplicationServlet; import com.arsdigita.web.LoginSignal; import com.arsdigita.web.Web; @@ -55,62 +58,129 @@ import java.util.Date; import java.util.HashMap; import java.util.Map; import javax.servlet.RequestDispatcher; +import javax.servlet.ServletConfig; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.log4j.Logger; -/** - * Content Section's application servlet - * +/* + * NOTE: * Repaired ItemURLCache to save multilingual items with automatic - * language negotiation. The cahce now uses the remaining url part + * language negotiation. The cache now uses the remaining url part * and the language concatinated as a hash table key. The delimiter * is CACHE_KEY_DELIMITER. + */ + +/* + * NOTE 2: + * In a process of refactoring from legacy compatible to legacy free applications. + * TODO: + * - replace url check using RequestContext which resolves to SiteNodeRequest + * implementation + * - Refactor content item UI bebop ApplicationPage or PageFactory instead of + * legacy infected sitenode / package dispatchers. + */ + +/** + * Content Section's Application Servlet according CCM core web application + * structure {@see com.arsdigita.web.Application} implements the content + * section UI. + * + * It handles the UI for content items and delegates the UI for sections and + * folders to jsp templates. * * @author unknown * @author Sören Bernstein + * @author Peter Boy */ public class ContentSectionServlet extends BaseApplicationServlet { + /** Creates a s_logging category with name = full name of class */ private static final Logger s_log = - Logger.getLogger(ContentSectionServlet.class); + Logger.getLogger(ContentSectionServlet.class); - /** Stringarray of file name patterns for index files. Should be made - configurable. */ + /** Stringarray of file name patterns for index files. */ private static final String[] WELCOME_FILES = new String[] { "index.jsp", "index.html" }; - - private ContentItemDispatcher m_disp = new ContentItemDispatcher(); - public static Map s_itemResolverCache = Collections - .synchronizedMap(new HashMap()); - - /** cache the content items */ - private static Map s_itemURLCacheMap = null; - - /** The context for previewing items */ + /** The context (in url) for previewing items */ public static final String PREVIEW = "/preview"; + /** Template files */ public static final String FILE_SUFFIX = ".jsp"; public static final String INDEX_FILE = "/index"; public static final String CONTENT_ITEM = - "com.arsdigita.cms.dispatcher.item"; + "com.arsdigita.cms.dispatcher.item"; public static final String CONTENT_SECTION = - "com.arsdigita.cms.dispatcher.section"; + "com.arsdigita.cms.dispatcher.section"; public static final String XML_SUFFIX = ".xml"; public static final String XML_MODE = "xmlMode"; public static final String MEDIA_TYPE = "templateContext"; - - private static boolean s_cacheItems = true; private static final String CACHE_KEY_DELIMITER = "%"; + + private ContentItemDispatcher m_disp = new ContentItemDispatcher(); + + public static Map s_itemResolverCache = Collections + .synchronizedMap(new HashMap()); + /** cache the content items */ + private static Map s_itemURLCacheMap = null; + private static boolean s_cacheItems = true; + + /** Path to directory containg ccm-cms template files */ + private String m_templatePath; + /** Resolvers to find templages (JSP) and other stuff stored in file system.*/ + private ApplicationFileResolver m_resolver; + /** - * Implements the service method of BaseApplicationServlet - * @see com.arsdigita.web.BaseApplicationServlet#doService - * (HttpServletRequest, HttpServletResponse, Application) + * Init method overwrites parents init to pass in optional parameters + * {@link com.arsdigita.web.BaseServlet}. + * If not specified system wide defaults are used. + */ + @Override + public void init(ServletConfig config) throws ServletException { + + super.init(config); + + + // optional init-param named template-path from ~/WEB-INF/web.xml + String templatePath = config.getInitParameter("template-path"); + if (templatePath == null) { + m_templatePath = ContentSection.getConfig().getTemplateRoot(); + } else { + m_templatePath = config.getInitParameter("template-path"); + } + + Assert.exists(m_templatePath, String.class); + Assert.isTrue(m_templatePath.startsWith("/"), + "template-path must start with '/'"); + Assert.isTrue(!m_templatePath.endsWith("/"), + "template-path must not end with '/'"); + + + // optional init-param named file-resolver from ~/WEB-INF/web.xml + String resolverName = config.getInitParameter("file-resolver"); + if (resolverName == null) { + m_resolver = Web.getConfig().getApplicationFileResolver(); + } else { + m_resolver = (ApplicationFileResolver)Classes.newInstance(resolverName); + } + if (s_log.isDebugEnabled()) { + s_log.debug("Template path is " + m_templatePath + + " with resolver " + m_resolver.getClass().getName()); + } + } + + /** + * Implementation of parent's (abstract) doService method checks HTTP request + * to determine whether to handle a content item or other stuff which is + * delegated to jsp templates. + * + * {@see com.arsdigita.web.BaseApplicationServlet#doService + * (HttpServletRequest, HttpServletResponse, Application)} */ protected void doService( HttpServletRequest sreq, HttpServletResponse sresp, @@ -118,9 +188,13 @@ public class ContentSectionServlet extends BaseApplicationServlet { throws ServletException, IOException { ContentSection section = (ContentSection) app; - - RequestContext ctx = DispatcherHelper.getRequestContext(); + String requestUri = sreq.getRequestURI(); + /* + * NOTE: + * Resolves currently to SiteNodeRequestContext which will be removed. + */ + RequestContext ctx = DispatcherHelper.getRequestContext(); String url = ctx.getRemainingURLPart(); // here SiteNodeRequestContext if (s_log.isInfoEnabled()) { @@ -161,38 +235,13 @@ public class ContentSectionServlet extends BaseApplicationServlet { if (s_log.isInfoEnabled()) { s_log.info("NOT serving content item"); } + + /* Store content section in http request to make it available + * or admin index,jsp */ sreq.setAttribute(CONTENT_SECTION, section); - String packageURL = ctx.getPageBase() + - ctx.getRemainingURLPart(); - if (s_log.isDebugEnabled()) { - s_log.debug("Forwarding onto file " + packageURL); - } - if (packageURL.endsWith("/")) { - for (int i = 0 ; i < WELCOME_FILES.length ; i++) { - if (s_log.isDebugEnabled()) { - s_log.debug("Trying welcome resource " + - packageURL + WELCOME_FILES[i]); - } - - RequestDispatcher rd = - DispatcherHelper.getRequestContext(sreq). - getServletContext().getRequestDispatcher(packageURL + WELCOME_FILES[i]); - if (rd != null && - DispatcherHelper.getRequestContext(sreq). - getServletContext().getResource(packageURL + WELCOME_FILES[i]) != null) { - if (s_log.isDebugEnabled()) { - s_log.debug("Got dispatcher " + rd); - } - sreq = DispatcherHelper.restoreOriginalRequest(sreq); - rd.forward(sreq,sresp); - return; - } - } - } - RequestDispatcher rd = - DispatcherHelper.getRequestContext(sreq). - getServletContext().getRequestDispatcher(packageURL); + RequestDispatcher rd = m_resolver.resolve(m_templatePath, + sreq, sresp, app); if (rd != null) { if (s_log.isDebugEnabled()) { s_log.debug("Got dispatcher " + rd); @@ -200,7 +249,8 @@ public class ContentSectionServlet extends BaseApplicationServlet { sreq = DispatcherHelper.restoreOriginalRequest(sreq); rd.forward(sreq,sresp); } else { - sresp.sendError(404, packageURL + " not found on this server."); + // sresp.sendError(404, packageURL + " not found on this server."); + sresp.sendError(404, requestUri + " not found on this server."); } } } @@ -284,6 +334,17 @@ public class ContentSectionServlet extends BaseApplicationServlet { //use ContentItemDispatcher m_disp.dispatch(sreq,sresp,ctx); } + + /** + * Fetches the content section from the request attributes. + * + * @param request The HTTP request + * @return The content section + * @pre ( request != null ) + */ + public static ContentSection getContentSection(HttpServletRequest request) { + return (ContentSection) request.getAttribute(CONTENT_SECTION); + } /** * Fetches the ItemResolver for a content section. Checks cache first. @@ -308,6 +369,9 @@ public class ContentSectionServlet extends BaseApplicationServlet { return ir; } + /** + * + */ public ContentItem getItem(ContentSection section, String url, ItemResolver itemResolver) { @@ -540,4 +604,25 @@ public class ContentSectionServlet extends BaseApplicationServlet { } } + + /** + * Checks that the current user has permission to access the admin pages. + **/ + public static boolean checkAdminAccess(HttpServletRequest request, + ContentSection section) { + + User user ; + KernelContext kernelContext = Kernel.getContext(); + if ( kernelContext.getParty() instanceof User ) { + user = (User) kernelContext.getParty(); + } else { + // Should not happen, at this stage the user has to be logged in. + return false; + } + + SecurityManager sm = new SecurityManager(section); + + return sm.canAccess(user, SecurityManager.ADMIN_PAGES); + } + } diff --git a/ccm-cms/src/com/arsdigita/cms/Initializer.java b/ccm-cms/src/com/arsdigita/cms/Initializer.java index 3c8af54d8..55d7db7de 100755 --- a/ccm-cms/src/com/arsdigita/cms/Initializer.java +++ b/ccm-cms/src/com/arsdigita/cms/Initializer.java @@ -175,9 +175,29 @@ public class Initializer extends CompoundInitializer { s_log.debug("CMS.Initializer.init(DomainInitEvent) invoked"); super.init(e); + /* Register object instantiator for Workspace (Content Center) */ + e.getFactory().registerInstantiator + (Workspace.BASE_DATA_OBJECT_TYPE, + new ACSObjectInstantiator() { + @Override + public DomainObject doNewInstance(DataObject dobj) { + return new Workspace(dobj); + } + } ); + LanguageUtil.setSupportedLanguages( Kernel.getConfig().getSupportedLanguages()); + /* Register object instantiator for CMS Service */ + e.getFactory().registerInstantiator + (Service.BASE_DATA_OBJECT_TYPE, + new ACSObjectInstantiator() { + @Override + public DomainObject doNewInstance(DataObject dobj) { + return new Service(dobj); + } + } ); + URLService.registerFinder(ContentPage.BASE_DATA_OBJECT_TYPE, new ItemURLFinder()); URLService.registerFinder(ContentBundle.BASE_DATA_OBJECT_TYPE, diff --git a/ccm-cms/src/com/arsdigita/cms/Loader.java b/ccm-cms/src/com/arsdigita/cms/Loader.java index 2eee06328..0cb34bc34 100755 --- a/ccm-cms/src/com/arsdigita/cms/Loader.java +++ b/ccm-cms/src/com/arsdigita/cms/Loader.java @@ -196,40 +196,24 @@ public class Loader extends PackageLoader { * Loads and instantiates the Workspace subpackage (content-center) in the * database. * It is made public to be able to invoke it from the update script - * (e.g. 6.6.1-6.6.2). + * (e.g. 6.6.1-6.6.2). We need separate steps for loading and instantiating + * because update skript require. */ public static ApplicationType loadWorkspaceApplicationType() { s_log.debug("Creating CMS Workspace..."); -// Creating of Workspace package using new style c.ad.web.Application -// in legacy compatible mode. Needs refactoring of the Workspace package. -// In a first step these instructions replace c.ad.installer.WorkspaceInstaller +// ////////////// Current style to create app type /////////////// + /* Create new stype legacy compatible application type */ + ApplicationType type = ApplicationType + .createApplicationType(Workspace.PACKAGE_KEY, + Workspace.INSTANCE_NAME, + Workspace.BASE_DATA_OBJECT_TYPE); + type.setDescription("The content center workspace for content creators."); + type.setDispatcherClass(Workspace.DISPATCHER_CLASS); + type.save(); - // create application type - ApplicationSetup appsetup = new ApplicationSetup(s_log); - // new style properties - appsetup.setApplicationObjectType(Workspace.BASE_DATA_OBJECT_TYPE); - appsetup.setTitle(Workspace.INSTANCE_NAME); // same as for instance - // there is only one - appsetup.setDescription("The content center workspace for content creators."); - // old style / legacy compatible properties - appsetup.setKey(Workspace.PACKAGE_KEY); - appsetup.setDispatcherClass(Workspace.DISPATCHER_CLASS); - // should not be needed anymore, stypesheets handled by StylesheetResolver - appsetup.setSingleton(true); - appsetup.setPortalApplication(false); - appsetup.setInstantiator(new ACSObjectInstantiator() { - @Override - protected DomainObject doNewInstance(DataObject dataObject) { - return new Workspace(dataObject); - } - }); - - ApplicationType workspaceType = appsetup.run(); - workspaceType.save(); s_log.debug("CMS Workspace type created."); - - return workspaceType; + return type; } /** @@ -242,14 +226,14 @@ public class Loader extends PackageLoader { // old-style package key used as url fragment where to install the instance s_log.debug("Creating CMS Workspace instance ..."); Workspace app = (Workspace) Application.createApplication( - workspaceType, // type + Workspace.BASE_DATA_OBJECT_TYPE, // type Workspace.PACKAGE_KEY, // url fragment Workspace.INSTANCE_NAME,// title null); // parent app.setDescription("The default CMS workspace instance."); app.save(); - s_log.debug("CMS Workspace instance " + Workspace.PACKAGE_KEY + " created."); + s_log.debug("CMS Workspace instance " + Workspace.PACKAGE_KEY + " created."); s_log.debug("Done loading CMS Workspace."); } @@ -269,25 +253,34 @@ public class Loader extends PackageLoader { // In a first step these instructions replace c.ad.installer.ServiceInstaller // create application type - ApplicationSetup appsetup = new ApplicationSetup(s_log); - // new style properties - appsetup.setApplicationObjectType(Service.BASE_DATA_OBJECT_TYPE); - appsetup.setTitle(Service.INSTANCE_NAME); // same as for instance +// ApplicationSetup appsetup = new ApplicationSetup(s_log); +// // new style properties +// appsetup.setApplicationObjectType(Service.BASE_DATA_OBJECT_TYPE); +// appsetup.setTitle(Service.INSTANCE_NAME); // same as for instance // there is only one - appsetup.setDescription("Services to store global resources and assets."); +// appsetup.setDescription("Services to store global resources and assets."); // old style / legacy compatible properties - appsetup.setKey(Service.PACKAGE_KEY); - appsetup.setDispatcherClass(Service.DISPATCHER_CLASS); - appsetup.setSingleton(true); - appsetup.setPortalApplication(false); - appsetup.setInstantiator(new ACSObjectInstantiator() { - @Override - protected DomainObject doNewInstance(DataObject dataObject) { - return new Service(dataObject); - } - }); +// appsetup.setKey(Service.PACKAGE_KEY); +// appsetup.setDispatcherClass(Service.DISPATCHER_CLASS); +// appsetup.setSingleton(true); +// appsetup.setPortalApplication(false); +// appsetup.setInstantiator(new ACSObjectInstantiator() { +// @Override +// protected DomainObject doNewInstance(DataObject dataObject) { +// return new Service(dataObject); +// } +// }); - ApplicationType serviceType = appsetup.run(); +// ApplicationType serviceType = appsetup.run(); +// serviceType.save(); +// ////////////// Current style to create app type /////////////// + /* Create new stype legacy compatible application type */ + ApplicationType serviceType = ApplicationType + .createApplicationType(Service.PACKAGE_KEY, + Service.INSTANCE_NAME, + Service.BASE_DATA_OBJECT_TYPE); + serviceType.setDescription("Services to store global resources and assets."); + serviceType.setDispatcherClass(Service.DISPATCHER_CLASS); serviceType.save(); return serviceType; @@ -334,34 +327,12 @@ public class Loader extends PackageLoader { // Step 1: Create content section application type // prerequisite for concrete content-section instance creation. -// ////////////// Deprecated style to create app type /////////////// -// ////////////// Delete when migration process completed /////////////// -// ApplicationSetup appType = new ApplicationSetup(s_log); -// appType.setApplicationObjectType(ContentSection.BASE_DATA_OBJECT_TYPE); -// appType.setKey(ContentSection.PACKAGE_TYPE); // by default: content-section -// appType.setTitle("CMS Content Section"); -// appType.setDescription("A CMS Content Section"); -// appType.setPortalApplication(false); - //setup.setDispatcherClass(ContentItemDispatcher.class.getName()); - // contains the xsl to generate the page - // ApplicationSetup requires an Instantiator which has to be set here - // Setting it up in Initializer prior to creating the application type - // doesn't work! -// appType.setInstantiator(new ACSObjectInstantiator() { -// @Override -// public DomainObject doNewInstance(DataObject dataObject) { -// return new ContentSection(dataObject); -// } -// }); -// appType.run(); -// //////////////////////////////////////////////////////////////////////// - - /* Create new stype legacy compatible application type */ - ApplicationType type = ApplicationType - .createApplicationType(ContentSection.PACKAGE_TYPE, - "CMS Content Section", - ContentSection.BASE_DATA_OBJECT_TYPE); + /* Create new type legacy compatible application type */ +// ApplicationType type = ApplicationType +// .createApplicationType(ContentSection.PACKAGE_TYPE, +// "CMS Content Section", +// ContentSection.BASE_DATA_OBJECT_TYPE); /* Create legacy-free application type * NOTE: The wording in the title parameter of ApplicationType @@ -370,10 +341,10 @@ public class Loader extends PackageLoader { * replacing blanks between words and illegal characters with an * hyphen and converted to lower case. * "Content Section" will become "content-section". */ -// ApplicationType type = new ApplicationType( -// "Content Section", -// ContentSection.BASE_DATA_OBJECT_TYPE ); - type.setDescription("A CMS Content Section."); + ApplicationType type = new ApplicationType( + "Content Section", + ContentSection.BASE_DATA_OBJECT_TYPE ); + type.setDescription("The CMS Content Section application."); type.save(); // Step 2: Load CMS specific privileges into central (core) privilege diff --git a/ccm-cms/src/com/arsdigita/cms/SecurityManager.java b/ccm-cms/src/com/arsdigita/cms/SecurityManager.java index 36aa191f2..ffb90cfb7 100755 --- a/ccm-cms/src/com/arsdigita/cms/SecurityManager.java +++ b/ccm-cms/src/com/arsdigita/cms/SecurityManager.java @@ -45,8 +45,7 @@ import javax.servlet.http.HttpServletResponse; import org.apache.log4j.Logger; /** - *

Security class used for checking and granting privileges in - * CMS.

+ *

Security class used for checking and granting privileges in CMS.

* * @author Michael Pih * @version $Id: SecurityManager.java 2161 2011-02-02 00:16:13Z pboy $ diff --git a/ccm-cms/src/com/arsdigita/cms/WorkspaceServlet.java b/ccm-cms/src/com/arsdigita/cms/WorkspaceServlet.java new file mode 100644 index 000000000..34e720289 --- /dev/null +++ b/ccm-cms/src/com/arsdigita/cms/WorkspaceServlet.java @@ -0,0 +1,148 @@ +/* + * Copyright (C) 2012 Peter Boy All Rights Reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +package com.arsdigita.cms; + +import com.arsdigita.cms.dispatcher.SimpleCache; +import com.arsdigita.developersupport.DeveloperSupport; +import com.arsdigita.kernel.security.UserContext; +import com.arsdigita.kernel.security.Util; +import com.arsdigita.ui.login.LoginHelper; +import com.arsdigita.web.Application; +import com.arsdigita.web.BaseApplicationServlet; + +import com.arsdigita.web.LoginSignal; +import com.arsdigita.web.Web; +import java.io.IOException; + +import java.util.ArrayList; +import java.util.HashMap; + +import javax.servlet.ServletException; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.log4j.Logger; + +/** + * CMS Workspace (content-center) application servlet serves all request made + * within the Content Center application. + * + * @author Peter Boy + * @version $Id: WorkspaceServlet.java 2161 2011-02-02 00:16:13Z pboy $ + */ +public class WorkspaceServlet extends BaseApplicationServlet { + + /**Error logging */ + private static Logger s_log = Logger + .getLogger(WorkspaceServlet.class.getName()); + + /** The path of the file that maps resources. */ + public final static String DEFAULT_MAP_FILE = + "/WEB-INF/resources/content-center-map.xml"; + + /** Mapping between a relative URL and the class name of a ResourceHandler.*/ + private static HashMap s_pageClasses = WorkspaceSetup.getURLToClassMap(); + private static HashMap s_pageURLs = WorkspaceSetup.getClassToURLMap(); + + /** + * Instantiated ResourceHandlers cache. This allows for lazy loading. + */ + private static SimpleCache s_pages = new SimpleCache(); + +// private Dispatcher m_notFoundHandler; + private ArrayList m_trailingSlashList = new ArrayList(); + + + + /** + * Implements the (abstract) doService method of BaseApplicationServlet to + * create the Worspace page. + * + * @see com.arsdigita.web.BaseApplicationServlet#doService + * (HttpServletRequest, HttpServletResponse, Application) + */ + protected void doService( HttpServletRequest sreq, + HttpServletResponse sresp, + Application app) + throws ServletException, IOException { + + if (s_log.isDebugEnabled()) { + s_log.info("starting doService method"); + } + DeveloperSupport.startStage("ContentCenterServlet.doService"); + + // Check user access. + checkUserAccess(sreq, sresp); + + + DeveloperSupport.endStage("ContentCenterServlet.doService"); + if (s_log.isDebugEnabled()) { + s_log.info("doService method competed"); + } + } + + + + + + /** + * Verify that the user is logged in and is able to view the + * page. Subclasses can override this method if they need to, but + * should always be sure to call super.checkUserAccess(...) + * + * @param request The HTTP request + * @param response The HTTP response + * @param actx The request context + **/ + protected void checkUserAccess(final HttpServletRequest request, + final HttpServletResponse response //, +/// final RequestContext actx + ) + throws ServletException { + + if (!Web.getUserContext().isLoggedIn()) { + throw new LoginSignal(request); + + } + } + + /** + * Redirects the client to the login page, setting the return url to + * the current request URI. + * + * @exception ServletException If there is an exception thrown while + * trying to redirect, wrap that exception in a ServletException + **/ + protected void redirectToLoginPage(HttpServletRequest req, + HttpServletResponse resp) + throws ServletException { + String url = Util.getSecurityHelper() + .getLoginURL(req) + +"?"+LoginHelper.RETURN_URL_PARAM_NAME + +"="+UserContext.encodeReturnURL(req); + try { + LoginHelper.sendRedirect(req, resp, url); + } catch (IOException e) { + s_log.error("IO Exception", e); + throw new ServletException(e.getMessage(), e); + } + } + +} diff --git a/ccm-cms/src/com/arsdigita/cms/dispatcher/CMSPage.java b/ccm-cms/src/com/arsdigita/cms/dispatcher/CMSPage.java index 0f7546f1d..355bd8779 100755 --- a/ccm-cms/src/com/arsdigita/cms/dispatcher/CMSPage.java +++ b/ccm-cms/src/com/arsdigita/cms/dispatcher/CMSPage.java @@ -257,8 +257,9 @@ public class CMSPage extends Page implements ResourceHandler { * @pre m_transformer != null */ public void dispatch(final HttpServletRequest request, - final HttpServletResponse response, - RequestContext actx) + final HttpServletResponse response , + RequestContext actx + ) throws IOException, ServletException { DeveloperSupport.startStage("CMSPage.dispatch: serve page"); diff --git a/ccm-cms/src/com/arsdigita/cms/dispatcher/ContentCenterDispatcher.java b/ccm-cms/src/com/arsdigita/cms/dispatcher/ContentCenterDispatcher.java index 935664134..3790c90cf 100755 --- a/ccm-cms/src/com/arsdigita/cms/dispatcher/ContentCenterDispatcher.java +++ b/ccm-cms/src/com/arsdigita/cms/dispatcher/ContentCenterDispatcher.java @@ -76,7 +76,7 @@ public class ContentCenterDispatcher extends LockableImpl * The path of the file that maps resources. */ public final static String DEFAULT_MAP_FILE = - "/WEB-INF/resources/content-center-map.xml"; + "/WEB-INF/resources/content-center-old-map.xml"; /** * Error logging. @@ -138,7 +138,8 @@ public class ContentCenterDispatcher extends LockableImpl } // Check user access. - checkUserAccess(request, response, actx); + // checkUserAccess(request, response, actx); + checkUserAccess(request, response); ResourceHandler page = getResource(url); if ( page != null ) { @@ -171,7 +172,8 @@ public class ContentCenterDispatcher extends LockableImpl * creating virtual directories, so that relative URLs and redirects * work. */ - public void requireTrailingSlash(String url) { + // public void requireTrailingSlash(String url) { + private void requireTrailingSlash(String url) { m_trailingSlashList.add(url); } @@ -266,8 +268,9 @@ public class ContentCenterDispatcher extends LockableImpl * @param actx The request context **/ protected void checkUserAccess(final HttpServletRequest request, - final HttpServletResponse response, - final RequestContext actx) + final HttpServletResponse response // , + // final RequestContext actx + ) throws ServletException { if (!Web.getUserContext().isLoggedIn()) { throw new LoginSignal(request); diff --git a/ccm-cms/src/com/arsdigita/cms/dispatcher/ContentSectionDispatcher.java b/ccm-cms/src/com/arsdigita/cms/dispatcher/ContentSectionDispatcher.java index 55f552eab..49238a6e2 100755 --- a/ccm-cms/src/com/arsdigita/cms/dispatcher/ContentSectionDispatcher.java +++ b/ccm-cms/src/com/arsdigita/cms/dispatcher/ContentSectionDispatcher.java @@ -25,6 +25,8 @@ import com.arsdigita.dispatcher.Dispatcher; import com.arsdigita.dispatcher.DispatcherChain; import com.arsdigita.dispatcher.RequestContext; import com.arsdigita.domain.DataObjectNotFoundException; +import com.arsdigita.kernel.Kernel; +import com.arsdigita.kernel.KernelContext; import com.arsdigita.kernel.SiteNode; import com.arsdigita.kernel.User; import com.arsdigita.sitenode.SiteNodeRequestContext; @@ -41,7 +43,7 @@ import javax.servlet.http.HttpServletResponse; * @author Karl Goldstein (karlg@arsdigita.com) * @version $Revision: #9 $ $DateTime: 2004/08/17 23:15:09 $ * @version $Id: ContentSectionDispatcher.java 2090 2010-04-17 08:04:14Z pboy $ - **/ + */ public class ContentSectionDispatcher implements Dispatcher { public static final String CONTENT_ITEM = "com.arsdigita.cms.dispatcher.item"; @@ -121,8 +123,15 @@ public class ContentSectionDispatcher implements Dispatcher { public static boolean checkAdminAccess(HttpServletRequest request, ContentSection section) { - User user = Utilities.getCurrentUser(request); - + User user ; + KernelContext kernelContext = Kernel.getContext(); + if ( kernelContext.getParty() instanceof User ) { + user = (User) kernelContext.getParty(); + } else { + // Should not happen, at this stage the user has to be logged in. + return false; + } + SecurityManager sm = new SecurityManager(section); return sm.canAccess(user, SecurityManager.ADMIN_PAGES); diff --git a/ccm-cms/src/com/arsdigita/cms/dispatcher/Utilities.java b/ccm-cms/src/com/arsdigita/cms/dispatcher/Utilities.java index ec7273aef..dceef6cff 100755 --- a/ccm-cms/src/com/arsdigita/cms/dispatcher/Utilities.java +++ b/ccm-cms/src/com/arsdigita/cms/dispatcher/Utilities.java @@ -46,6 +46,7 @@ import java.util.Map; /** *

This class provides many utility functions for the Content Management * System.

+ * Specifically used by various JSP templates. * * @author Michael Pih (pihman@arsdigita.com) * @version $Id: Utilities.java 2140 2011-01-16 12:04:20Z pboy $ @@ -64,6 +65,8 @@ public class Utilities { /** * Fetch the location of the CMS Workspace package. Caches the result. * @return The URL of the CMS Workspace package + * @deprecated without direct replacement yet, refactor code to use + * legacy free code in com.arsdigita.web */ public static String getWorkspaceURL() { String url = (String) m_cache.get(CMS.WORKSPACE_PACKAGE_KEY); @@ -166,6 +169,7 @@ public class Utilities { * Fetches the URL of a mounted instance of a package. * @param key The package key * @return The URL where the package is mounted + * @deprecated without direct replacement yet */ private static String getSingletonPackageURL(String key) { PackageType type = null; @@ -206,6 +210,13 @@ public class Utilities { return url.toString(); } + /** + * + * @param key + * @return + * @deprecated without replacement (singleton package is not a supported + * property for legacy free applications.) + */ private static String getSingletonPackageURLSansContext(String key) { PackageType type = null; type = PackageType.findByKey(key); diff --git a/ccm-cms/src/com/arsdigita/cms/ui/BaseAdminPane.java b/ccm-cms/src/com/arsdigita/cms/ui/BaseAdminPane.java index b18c768bf..e3962af9c 100755 --- a/ccm-cms/src/com/arsdigita/cms/ui/BaseAdminPane.java +++ b/ccm-cms/src/com/arsdigita/cms/ui/BaseAdminPane.java @@ -86,11 +86,11 @@ public abstract class BaseAdminPane extends SelectionPanel super(title, builder); } - protected final static GlobalizedMessage gz(final String key) { + protected static GlobalizedMessage gz(final String key) { return GlobalizationUtil.globalize(key); } - protected final static String lz(final String key) { + protected static String lz(final String key) { return (String) gz(key).localize(); } } diff --git a/ccm-cms/src/com/arsdigita/cms/ui/CMSApplicationPage.java b/ccm-cms/src/com/arsdigita/cms/ui/CMSApplicationPage.java new file mode 100755 index 000000000..7d0c6d870 --- /dev/null +++ b/ccm-cms/src/com/arsdigita/cms/ui/CMSApplicationPage.java @@ -0,0 +1,346 @@ +/* + * Copyright (C) 2001-2004 Red Hat Inc. All Rights Reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ +package com.arsdigita.cms.ui; + +import com.arsdigita.cms.dispatcher.*; +import com.arsdigita.bebop.Bebop; +import com.arsdigita.bebop.Container; +import com.arsdigita.bebop.Label; +import com.arsdigita.bebop.Page; +import com.arsdigita.bebop.PageState; +import com.arsdigita.bebop.page.PageTransformer; +import com.arsdigita.cms.CMSExcursion; +import com.arsdigita.cms.ContentItem; +import com.arsdigita.cms.ContentSection; +import com.arsdigita.cms.SecurityManager; +import com.arsdigita.developersupport.DeveloperSupport; +import com.arsdigita.dispatcher.RequestContext; +import com.arsdigita.domain.DataObjectNotFoundException; +import com.arsdigita.domain.DomainObjectFactory; +import com.arsdigita.kernel.Kernel; +import com.arsdigita.kernel.KernelHelper; +import com.arsdigita.kernel.User; +import com.arsdigita.kernel.permissions.PermissionDescriptor; +import com.arsdigita.kernel.permissions.PermissionService; +import com.arsdigita.persistence.OID; +import com.arsdigita.templating.PresentationManager; +import com.arsdigita.util.Assert; +import com.arsdigita.web.Application; +import com.arsdigita.xml.Document; +import com.arsdigita.xml.Element; + +import java.io.IOException; +import java.math.BigDecimal; +import java.util.HashMap; +import javax.servlet.ServletException; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.log4j.Logger; + +/** + *

A CMSPage is a Bebop {@link com.arsdigita.bebop.Page} + * implementation of the {@link com.arsdigita.cms.dispatcher.ResourceHandler} + * interface.

+ * + *

It stores the current {@link com.arsdigita.cms.ContentSection} and, if + * applicable, the {@link com.arsdigita.cms.ContentItem} in the page state as + * request local objects. Components that are part of the CMSPage + * may access these objects by calling:

+ *
+ *     getContentSection(PageState state);
+ *     
+ * + * @author Michael Pih (pihman@arsdigita.com) + * @author Uday Mathur (umathur@arsdigita.com) + * @version $Id: CMSPage.java 2140 2011-01-16 12:04:20Z pboy $ + */ +public class CMSApplicationPage extends Page { + + private static final Logger s_log = Logger.getLogger(CMSApplicationPage.class); + + /** The global assets URL stub XML parameter name. */ + public final static String ASSETS = "ASSETS"; + + /** The XML page class. */ + public final static String PAGE_CLASS = "CMS"; + + /** Map of XML parameters */ + private HashMap m_params; + + /** */ + private PageTransformer m_transformer; + + public CMSApplicationPage() { + super(); + buildPage(); + } + + public CMSApplicationPage(String title) { + super(title); + buildPage(); + } + + public CMSApplicationPage(String title, Container panel) { + super(title, panel); + buildPage(); + } + + public CMSApplicationPage(Label title) { + super(title); + buildPage(); + } + + public CMSApplicationPage(Label title, Container panel) { + super(title, panel); + buildPage(); + } + + /** + * Builds the page. + */ + protected void buildPage() { + // Set the class attribute. + setClassAttr(PAGE_CLASS); + + // Global XML params. + // MP: This only works with older versions of Xalan. + m_params = new HashMap(); + setXMLParameter(ASSETS, Utilities.getGlobalAssetsURL()); + + // MP: This is a hack to so that the XML params work with the newer + // version of Xalan. + setAttribute(ASSETS, Utilities.getGlobalAssetsURL()); + + // Make sure the error display gets rendered. + getErrorDisplay().setIdAttr("page-body"); + + final PresentationManager pm = Bebop.getConfig().getPresentationManager(); + + if (pm instanceof PageTransformer) { + m_transformer = (PageTransformer) pm; + } + else { + m_transformer = new PageTransformer(); + } + } + + /** + * Finishes and locks the page. If the page is already locked, does nothing. + * + * This method is called by the {@link com.arsdigita.dispatcher.Dispatcher} + * that initializes this page. + */ + public synchronized void init() { + s_log.debug("Initializing the page"); + + if (!isLocked()) { + s_log.debug("The page hasn't been locked; locking it now"); + + lock(); + } + } + + /** + * Fetches the value of the XML parameter. + * + * @param name The parameter name + * @return The parameter value + * @pre (name != null) + */ + public String getXMLParameter(String name) { + return (String) m_params.get(name); + } + + /** + * Set an XML parameter. + * + * @param name The parameter name + * @param value The parameter value + * @pre (name != null) + */ + public void setXMLParameter(String name, String value) { + m_params.put(name, value); + } + + /** + * Fetch the request-local content section. + * + * @param request The HTTP request + * @return The current content section + * + * @deprecated use com.arsdigita.cms.CMS.getContext().getContentSection() + * instead + * Despite of being deprecated it can not be removed because it + * is required by the interface Resourcehandler which is + * implemented by this class. + * On the other hand, if deprecated, implementing ResourceHandler + * may not be required + */ + public ContentSection getContentSection(HttpServletRequest request) { + // Resets all content sections associations. + return ContentSectionDispatcher.getContentSection(request); + } + + /** + * Fetch the request-local content section. + * + * @param state The page state + * @return The current content section + * + * @deprecated use com.arsdigita.cms.CMS.getContext().getContentSection() + * instead + * Despite of being deprecated it can not be removed because it + * is required by ContentItemPage which extends CMSPage and + * uses this method. + */ + public ContentSection getContentSection(PageState state) { + return getContentSection(state.getRequest()); + } + + /** + * Fetch the request-local content item. + * + * @param request The HTTP request + * @return The current content item + * + * @deprecated use com.arsdigita.cms.CMS.getContext().getContentItem() + * instead + * Despite of being deprecated it can not be removed because it + * is required by the interface Resourcehandler which is + * implemented by this class. + * On the other hand, if deprecated, implementing ResourceHandler + * may not be required + */ + public ContentItem getContentItem(HttpServletRequest request) { + // resets all content item associations + return ContentSectionDispatcher.getContentItem(request); + } + + /** + * Fetch the request-local content item. + * + * @param state The page state + * @return The current content item + * @deprecated use com.arsdigita.cms.CMS.getContext().getContentItem() + * instead. + * Despite of being deprecated it can not be removed because it + * is required by ContentItemPage which extends CMSPage and + * uses this method. + */ + public ContentItem getContentItem(PageState state) { + return getContentItem(state.getRequest()); + } + + /** + * Services the Bebop page. + * + * @param request The servlet request object + * @param response the servlet response object + * + * @pre m_transformer != null + */ + public void dispatch(final HttpServletRequest request, + final HttpServletResponse response // , + // RequestContext actx + ) + throws IOException, ServletException { + + DeveloperSupport.startStage("CMSPage.dispatch: serve page"); + + CMSExcursion excursion = new CMSExcursion() { + public void excurse() throws IOException, ServletException { + Application app = Application.getCurrentApplication(request); + ContentSection section = null; + + if (app == null) { + // We're at the content center; do nothing. + } else if (app instanceof ContentSection) { + section = (ContentSection) app; + } else { + // hack to deal with category browser mounted + // under section app. + app = app.getParentApplication(); + if (app instanceof ContentSection) { + section = (ContentSection) app; + } + } + + if (section != null) { + setContentSection(section); + setSecurityManager(new SecurityManager(section)); + } + + final String itemID = request.getParameter("item_id"); + + if (itemID != null) { + try { + ContentItem item = + (ContentItem) DomainObjectFactory.newInstance + (new OID(ContentItem.BASE_DATA_OBJECT_TYPE, + new BigDecimal(itemID))); + setContentItem(item); + PermissionDescriptor perm = new PermissionDescriptor( + SecurityManager.CMS_PREVIEW_ITEM_DESCRIPTOR, + item, + Kernel.getContext().getParty() ); + if (!PermissionService.checkPermission(perm)) { + s_log.warn("No perm to CMS_PREVIEW_ITEM " + itemID); + throw new AccessDeniedException( + "You do not have privileges to administer item " + + itemID); + } + } catch (DataObjectNotFoundException donfe) { + s_log.warn("Failed to load content item " + itemID); + } + } + + final Document doc = buildDocument(request, response); + + Assert.exists(m_transformer, + "Implementation of PresentationManager"); + m_transformer.servePage(doc, request, response, m_params); + } + }; + try { + excursion.run(); + } finally { + DeveloperSupport.endStage("CMSPage.dispatch: serve page"); + } + } + + @Override + protected Element generateXMLHelper(PageState ps, Document parent) { + Element page = super.generateXMLHelper(ps,parent); + User user = getCurrentUser(ps); + if ( user != null ) { + page.addAttribute("name",user.getDisplayName()); + } + + return page; + } + + /** + * @deprecated Use Kernel.getContext().getParty() if possible and + * Web.getContext().getUser() if necessary. + */ + public static User getCurrentUser(PageState state) { + return KernelHelper.getCurrentUser(state.getRequest()); + } +} diff --git a/ccm-cms/src/com/arsdigita/cms/ui/CMSPageWorkspacePage.java b/ccm-cms/src/com/arsdigita/cms/ui/CMSPageWorkspacePage.java new file mode 100755 index 000000000..21513aef2 --- /dev/null +++ b/ccm-cms/src/com/arsdigita/cms/ui/CMSPageWorkspacePage.java @@ -0,0 +1,204 @@ +/* + * Copyright (C) 2001-2004 Red Hat Inc. All Rights Reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ +package com.arsdigita.cms.ui; + +import com.arsdigita.bebop.Component; +import com.arsdigita.bebop.Label; +import com.arsdigita.bebop.Link; +import com.arsdigita.bebop.PageState; +import com.arsdigita.bebop.SimpleContainer; +import com.arsdigita.bebop.TabbedPane; +import com.arsdigita.bebop.event.ActionEvent; +import com.arsdigita.bebop.event.ActionListener; +import com.arsdigita.bebop.event.PrintEvent; +import com.arsdigita.bebop.event.PrintListener; +import com.arsdigita.bebop.parameters.BigDecimalParameter; +import com.arsdigita.cms.ContentItem; +import com.arsdigita.cms.ContentSection; +import com.arsdigita.cms.ContentType; +import com.arsdigita.cms.dispatcher.CMSPage; +import com.arsdigita.cms.ui.workspace.TasksPanel; +import com.arsdigita.cms.util.GlobalizationUtil; +import com.arsdigita.kernel.KernelHelper; +import com.arsdigita.kernel.User; +import com.arsdigita.kernel.ui.ACSObjectSelectionModel; +import com.arsdigita.ui.DebugPanel; + + +/** + *

The Content Center page.

+ * + * @author Jack Chung (flattop@arsdigita.com) + * @author Michael Pih (pihman@arsdigita.com) + * @version $Id: CMSPageWorkspacePage.java 2090 2010-04-17 08:04:14Z pboy $ + */ +public class CMSPageWorkspacePage extends CMSPage implements ActionListener { + + private final static String XSL_CLASS = "CMS Admin"; + + private TabbedPane m_tabbedPane; + + private TasksPanel m_tasks; + private ItemSearch m_search; + private ACSObjectSelectionModel m_typeSel; + private ACSObjectSelectionModel m_sectionSel; + + public static final String CONTENT_TYPE = "type_id"; + public static final String CONTENT_SECTION = "section_id"; + + /** + * Construct a new CMSPageWorkspacePage + */ + public CMSPageWorkspacePage() { // Constructor Page + super(new Label( GlobalizationUtil.globalize + ("cms.ui.content_center")), + new SimpleContainer()); + + setClassAttr("cms-admin"); + + BigDecimalParameter typeId = new BigDecimalParameter(CONTENT_TYPE); + addGlobalStateParam(typeId); + m_typeSel = new ACSObjectSelectionModel + (ContentType.class.getName(), ContentType.BASE_DATA_OBJECT_TYPE, typeId); + + BigDecimalParameter sectionId = new BigDecimalParameter + (CONTENT_SECTION); + addGlobalStateParam(sectionId); + m_sectionSel = new ACSObjectSelectionModel + (ContentSection.class.getName(), + ContentSection.BASE_DATA_OBJECT_TYPE, + sectionId); + + add( new WorkspaceContextBar() ); + add( new GlobalNavigation() ); + + m_tasks = getTasksPane(m_typeSel, m_sectionSel); + m_search = getSearchPane(); + + m_tabbedPane = createTabbedPane(); + m_tabbedPane.setIdAttr("page-body"); + add(m_tabbedPane); + + add(new DebugPanel()); + } + + /** + * Creates, and then caches, the Tasks pane. Overriding this + * method to return null will prevent this tab from appearing. + **/ + protected TasksPanel getTasksPane(ACSObjectSelectionModel typeModel, + ACSObjectSelectionModel sectionModel) { + if (m_tasks == null) { + m_tasks = new TasksPanel(typeModel,sectionModel); + } + return m_tasks; + } + + /** + * Creates, and then caches, the Search pane. Overriding this + * method to return null will prevent this tab from appearing. + **/ + protected ItemSearch getSearchPane() { + if (m_search == null) { + m_search = new ItemSearch(ContentItem.DRAFT); + } + + return m_search; + } + + + private SimpleContainer makeHeader() { + PrintListener l = new PrintListener() { + public void prepare(PrintEvent event) { + PageState state = event.getPageState(); + Link link = (Link) event.getTarget(); + + User user = KernelHelper.getCurrentUser(state.getRequest()); + + link.setChild(new Label(user.getName())); + link.setTarget("/pvt/"); + } + }; + + SimpleContainer sc = new SimpleContainer(); + Label welcomeLabel = new Label(GlobalizationUtil.globalize("cms.ui.welcome")); + Link nameLink = new Link(l); + + sc.add(welcomeLabel); + sc.add(nameLink); + return sc; + + } + + + /** + * Created the TabbedPane to use for this page. Sets the class + * attribute for this tabbed pane. The default implementation uses a + * {@link com.arsdigita.bebop.TabbedPane} and sets the class + * attribute to "CMS Admin." This implementation also adds tasks, + * content sections, and search panes. + * + *

+ * + * Developers can override this method to add only the tabs they + * want, or to add additional tabs after the default CMS tabs are + * added. + **/ + protected TabbedPane createTabbedPane() { + TabbedPane pane = new TabbedPane(); + pane.setClassAttr(XSL_CLASS); + addToPane(pane, "Tasks/Sections", getTasksPane(m_typeSel, m_sectionSel)); + addToPane(pane, "Search", getSearchPane()); + pane.addActionListener(this); + return pane; + } + + + /** + * Adds the specified component, with the specified tab name, to the + * tabbed pane only if it is not null. + * + * @param pane The pane to which to add the tab + * @param tabName The name of the tab if it's added + * @param comp The component to add to the pane + **/ + protected void addToPane(TabbedPane pane, String tabName, Component comp) { + if (comp != null) { + pane.addTab(tabName, comp); + } + } + + + /** + * When a new tab is selected, reset the state of the + * formerly-selected pane. + * + * @param event The event fired by selecting a tab + */ + public void actionPerformed(ActionEvent event) { + PageState state = event.getPageState(); + Component pane = m_tabbedPane.getCurrentPane(state); + + if ( pane == m_tasks ) { + m_tasks.reset(state); + } else if ( pane == m_search ) { + m_search.reset(state); + } + } +} diff --git a/ccm-cms/src/com/arsdigita/cms/ui/WorkspacePage.java b/ccm-cms/src/com/arsdigita/cms/ui/WorkspacePage.java index 62d1b1f17..48e871dcd 100755 --- a/ccm-cms/src/com/arsdigita/cms/ui/WorkspacePage.java +++ b/ccm-cms/src/com/arsdigita/cms/ui/WorkspacePage.java @@ -33,6 +33,7 @@ import com.arsdigita.cms.ContentItem; import com.arsdigita.cms.ContentSection; import com.arsdigita.cms.ContentType; import com.arsdigita.cms.dispatcher.CMSPage; +import com.arsdigita.cms.ui.workspace.TasksPanel; import com.arsdigita.cms.util.GlobalizationUtil; import com.arsdigita.kernel.KernelHelper; import com.arsdigita.kernel.User; @@ -45,7 +46,7 @@ import com.arsdigita.ui.DebugPanel; * * @author Jack Chung (flattop@arsdigita.com) * @author Michael Pih (pihman@arsdigita.com) - * @version $Id: WorkspacePage.java 2090 2010-04-17 08:04:14Z pboy $ + * @version $Id: CMSPageWorkspacePage.java 2090 2010-04-17 08:04:14Z pboy $ */ public class WorkspacePage extends CMSPage implements ActionListener { @@ -62,9 +63,9 @@ public class WorkspacePage extends CMSPage implements ActionListener { public static final String CONTENT_SECTION = "section_id"; /** - * Construct a new WorkspacePage + * Construct a new CMSPageWorkspacePage */ - public WorkspacePage() { + public WorkspacePage() { // Constructor Page super(new Label( GlobalizationUtil.globalize ("cms.ui.content_center")), new SimpleContainer()); @@ -80,10 +81,12 @@ public class WorkspacePage extends CMSPage implements ActionListener { (CONTENT_SECTION); addGlobalStateParam(sectionId); m_sectionSel = new ACSObjectSelectionModel - (ContentSection.class.getName(), ContentSection.BASE_DATA_OBJECT_TYPE, sectionId); + (ContentSection.class.getName(), + ContentSection.BASE_DATA_OBJECT_TYPE, + sectionId); - add(new WorkspaceContextBar()); - add(new GlobalNavigation()); + add( new WorkspaceContextBar() ); + add( new GlobalNavigation() ); m_tasks = getTasksPane(m_typeSel, m_sectionSel); m_search = getSearchPane(); @@ -99,7 +102,8 @@ public class WorkspacePage extends CMSPage implements ActionListener { * Creates, and then caches, the Tasks pane. Overriding this * method to return null will prevent this tab from appearing. **/ - protected TasksPanel getTasksPane(ACSObjectSelectionModel typeModel, ACSObjectSelectionModel sectionModel) { + protected TasksPanel getTasksPane(ACSObjectSelectionModel typeModel, + ACSObjectSelectionModel sectionModel) { if (m_tasks == null) { m_tasks = new TasksPanel(typeModel,sectionModel); } diff --git a/ccm-cms/src/com/arsdigita/cms/ui/ContentSectionContainer.java b/ccm-cms/src/com/arsdigita/cms/ui/workspace/ContentSectionContainer.java similarity index 82% rename from ccm-cms/src/com/arsdigita/cms/ui/ContentSectionContainer.java rename to ccm-cms/src/com/arsdigita/cms/ui/workspace/ContentSectionContainer.java index 8f99d4c9c..e303da20a 100755 --- a/ccm-cms/src/com/arsdigita/cms/ui/ContentSectionContainer.java +++ b/ccm-cms/src/com/arsdigita/cms/ui/workspace/ContentSectionContainer.java @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ -package com.arsdigita.cms.ui; +package com.arsdigita.cms.ui.workspace; import java.math.BigDecimal; @@ -44,12 +44,11 @@ import com.arsdigita.cms.ContentSectionCollection; import com.arsdigita.cms.Folder; import com.arsdigita.cms.PageLocations; import com.arsdigita.cms.SecurityManager; -import com.arsdigita.cms.dispatcher.Utilities; +import com.arsdigita.cms.ui.CMSContainer; import com.arsdigita.cms.ui.authoring.NewItemForm; import com.arsdigita.cms.util.GlobalizationUtil; import com.arsdigita.domain.DataObjectNotFoundException; import com.arsdigita.kernel.Kernel; -import com.arsdigita.kernel.SiteNode; import com.arsdigita.kernel.User; import com.arsdigita.kernel.permissions.PermissionService; import com.arsdigita.kernel.permissions.PrivilegeDescriptor; @@ -59,12 +58,11 @@ import com.arsdigita.web.Web; /** * Displays all the content sections in table, with links to the admin - * and public pages. Also displays a form for each content section to - * create an object of a given type. The list of available types is - * retrieved for each content section. + * (and in legacy mode to legacy public pages as well). Also displays a form for + * each content section to create an object of a given type. The list of + * available types retrieved for each content section. * *

- * * This class is a container for two other components: a form and a * table. The form represents the drop down list of the content types * available in a particular content section. It is an extension of @@ -110,11 +108,15 @@ public class ContentSectionContainer extends CMSContainer { add(m_table); } + @Override public void register(Page p) { super.register(p); p.setVisibleDefault(m_formContainer, false); } + /** + * + */ private class FormContainer extends CMSContainer { private StaticNewItemForm m_form; @@ -145,32 +147,36 @@ public class ContentSectionContainer extends CMSContainer { folder = section.getRootFolder(); } - if (! sm.canAccess(state.getRequest(), SecurityManager.NEW_ITEM, folder)) { - throw new FormProcessException( (String) GlobalizationUtil.globalize("cms.ui.insufficient_privileges").localize()); + if (! sm.canAccess(state.getRequest(), + SecurityManager.NEW_ITEM, folder)) { + throw new FormProcessException( + (String) GlobalizationUtil.globalize( + "cms.ui.insufficient_privileges").localize()); } } }); m_form.addProcessListener(new FormProcessListener() { - /** - * Process listener: redirects to the authoring kit to create a new item. - */ - public void process(FormSectionEvent e) throws FormProcessException { - StaticNewItemForm form = (StaticNewItemForm) e.getSource(); - PageState state = e.getPageState(); + /** + * Process listener: redirects to the authoring kit to create a new item. + */ + public void process(FormSectionEvent e) throws FormProcessException { + StaticNewItemForm form = (StaticNewItemForm) e.getSource(); + PageState state = e.getPageState(); - BigDecimal typeId = form.getTypeID(state); - if( typeId != null ) { - BigDecimal sectionId = form.getContentSectionID(state); - m_sectionSel.setSelectedKey(state, sectionId); - m_typeSel.setSelectedKey(state, typeId); - } + BigDecimal typeId = form.getTypeID(state); + if( typeId != null ) { + BigDecimal sectionId = form.getContentSectionID(state); + m_sectionSel.setSelectedKey(state, sectionId); + m_typeSel.setSelectedKey(state, typeId); } - }); + } + }); add(m_form); } + @Override public void register(Page p) { super.register(p); p.addComponentStateParam(this, m_sectionIdParam); @@ -272,6 +278,8 @@ public class ContentSectionContainer extends CMSContainer { **/ private ContentSectionTable() { super(); + + Integer colNo = 0; Label emptyView = new Label ("There are currently no content sections installed."); @@ -282,16 +290,20 @@ public class ContentSectionContainer extends CMSContainer { // add columns to the table TableColumnModel columnModel = getColumnModel(); - TableColumn contentSectionColumn = new TableColumn(0, COLUMN_SECTION); - TableColumn locationColumn = new TableColumn(1, COLUMN_LOCATION); - TableColumn actionColumn = new TableColumn(2, COLUMN_ACTION); - + + TableColumn contentSectionColumn = new TableColumn(colNo, COLUMN_SECTION); contentSectionColumn.setCellRenderer(new AdminURLTableCellRenderer()); - locationColumn.setCellRenderer(new URLTableCellRenderer()); - actionColumn.setCellRenderer(new ActionTableCellRenderer()); - columnModel.add(contentSectionColumn); - columnModel.add(locationColumn); + + if( !ContentSection.getConfig().getHideLegacyPublicSiteLink() ) { + TableColumn locationColumn = new TableColumn(colNo ++, + COLUMN_LOCATION); + locationColumn.setCellRenderer(new URLTableCellRenderer()); + columnModel.add(locationColumn); + } + + TableColumn actionColumn = new TableColumn(colNo ++, COLUMN_ACTION); + actionColumn.setCellRenderer(new ActionTableCellRenderer()); columnModel.add(actionColumn); setModelBuilder(new ContentSectionTableModelBuilder()); @@ -346,7 +358,7 @@ public class ContentSectionContainer extends CMSContainer { * table. This implementation orders the content sections by * lower(label). **/ - protected ContentSectionCollection getContentSectionCollection() { + private ContentSectionCollection getContentSectionCollection() { ContentSectionCollection sections = ContentSection.getAllSections(); sections.addOrder("lower(label)"); return sections; @@ -433,8 +445,14 @@ public class ContentSectionContainer extends CMSContainer { SecurityManager sm = new SecurityManager(section); if (! sm.canAccess(state.getRequest(), SecurityManager.NEW_ITEM, folder) - || !ContentSection.getConfig().getAllowContentCreateInSectionListing()) { - return new Label(" ", false); + || !ContentSection.getConfig().getAllowContentCreateInSectionListing() + ) { + return new Label("   - -   "+ + "       "+ + "       "+ + "       "+ + "        ", + false); } else { // set the value of the sectionIdParameter in the form // to this section @@ -454,70 +472,43 @@ public class ContentSectionContainer extends CMSContainer { **/ public static class URLTableCellRenderer implements TableCellRenderer { - private static final String URL_STUB = "/"; - /** * The object passed in is the current content section. This * returns a Link whose name and target are the url to the * public pages. - **/ - public Component getComponent(Table table, PageState state, Object value, - boolean isSelected, Object key, - int row, int column) { + * + * @return Link whose name and target are the url to the public pages + * of the current (passed in) content section + * or a Label if current use does not habe acces priviledge + * for the content section + */ + public Component getComponent(Table table, + PageState state, + Object value, + boolean isSelected, + Object key, + int row, + int column) { + + /* cast to ContentSection for further processing */ ContentSection section = (ContentSection) value; - String baseUrl = getBaseURL(); String name = section.getName(); + String path = section.getPath() ; // from Application + // If the user has no access, return a Label instead of a Link SecurityManager sm = new SecurityManager(section); - if (sm.canAccess(state.getRequest(), SecurityManager.PUBLIC_PAGES)) { - return new Link(baseUrl + name + "/", baseUrl + generateURL(name)); + if (sm.canAccess(state.getRequest(), SecurityManager.PUBLIC_PAGES) + && !ContentSection.getConfig().getHideLegacyPublicSiteLink() + ) { + + return new Link("/"+name+"/", path+"/"); } else { - return new Label(baseUrl + name + "/", false); + return new Label("/"+name+"/", false); } } - /** - * Trims leading slashes, if any, on the specified string. - * - * @param string The string for which we want to remove - * leading slashes - **/ - protected String trimSlashes(String string) { - while (string != null && string.length() > 0 && - string.charAt(0) == '/') { - string = string.substring(1); - } - return string; - } - - /** - * Generates the url for the specified prefix. Always returns - * something that does not start with a forward slash. - * - * @param prefix The prefix of the URL - **/ - protected String generateURL(String prefix) { - return trimSlashes(prefix) + URL_STUB; - } - - /** - * Returns the current url stub from the webapp context and - * the requested site node. Always returns something that ends - * with a forward slash. - **/ - protected String getBaseURL() { - // Generate the base URL stub. - StringBuffer buf = new StringBuffer(15); - buf.append(Utilities.getWebappContext()) - .append(SiteNode.getRootSiteNode().getURL()); - String url = buf.toString(); - if (url.endsWith("/")) { - return url; - } - return url + "/"; - } } @@ -532,6 +523,7 @@ public class ContentSectionContainer extends CMSContainer { /** * The object passed in is the current content section **/ + @Override public Component getComponent(Table table, PageState state, Object value, boolean isSelected, Object key, int row, int column) { diff --git a/ccm-cms/src/com/arsdigita/cms/ui/TasksPanel.java b/ccm-cms/src/com/arsdigita/cms/ui/workspace/TasksPanel.java similarity index 90% rename from ccm-cms/src/com/arsdigita/cms/ui/TasksPanel.java rename to ccm-cms/src/com/arsdigita/cms/ui/workspace/TasksPanel.java index 24f7965c9..bc14b3663 100755 --- a/ccm-cms/src/com/arsdigita/cms/ui/TasksPanel.java +++ b/ccm-cms/src/com/arsdigita/cms/ui/workspace/TasksPanel.java @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ -package com.arsdigita.cms.ui; +package com.arsdigita.cms.ui.workspace; import java.math.BigDecimal; @@ -52,6 +52,8 @@ import com.arsdigita.cms.ContentItem; import com.arsdigita.cms.ContentSection; import com.arsdigita.cms.ContentType; import com.arsdigita.cms.Folder; +import com.arsdigita.cms.ui.CMSContainer; +import com.arsdigita.cms.ui.ContentItemPage; import com.arsdigita.cms.ui.authoring.CreationSelector; import com.arsdigita.cms.ui.folder.FolderSelectionModel; import com.arsdigita.cms.util.GlobalizationUtil; @@ -121,8 +123,10 @@ public class TasksPanel extends CMSContainer { private static final String SORT_WORKFLOW = "workflow"; // IMAGES - public static final String UP_ARROW_IMAGE = "/themes/heirfloom/images/gray-triangle-up.gif"; - public static final String DOWN_ARROW_IMAGE = "/themes/heirfloom/images/gray-triangle-down.gif"; + public static final String UP_ARROW_IMAGE = + "/themes/heirfloom/images/gray-triangle-up.gif"; + public static final String DOWN_ARROW_IMAGE = + "/themes/heirfloom/images/gray-triangle-down.gif"; // CREATION PANE CONSTANTS private Label m_selectorLabel; @@ -168,7 +172,8 @@ public class TasksPanel extends CMSContainer { /** * Adds the components to this tasks panel **/ - protected void addComponents() { +// protected void addComponents() { + private void addComponents() { m_creationPane = new BoxPanel(BoxPanel.VERTICAL); // A label that says "Create $content_type in $section" @@ -181,7 +186,9 @@ public class TasksPanel extends CMSContainer { ContentSection sec = (ContentSection) m_sectionSel.getSelectedObject(s); - StringBuffer buf = new StringBuffer(GlobalizationUtil.globalize("cms.ui.create").localize() + " "); + StringBuffer buf = new StringBuffer( + GlobalizationUtil + .globalize("cms.ui.create").localize() + " "); buf.append(type.getLabel()); buf.append(" in "); buf.append(sec.getName()); @@ -217,7 +224,9 @@ public class TasksPanel extends CMSContainer { } }); - m_viewLockLink = new ActionLink(new Label(GlobalizationUtil.globalize("cms.ui.workflow.task.view_locked"))); + m_viewLockLink = new ActionLink(new + Label(GlobalizationUtil + .globalize("cms.ui.workflow.task.view_locked"))); m_viewLockLink.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { PageState ps = e.getPageState(); @@ -225,7 +234,9 @@ public class TasksPanel extends CMSContainer { } }); - m_viewUnlockLink = new ActionLink(new Label(GlobalizationUtil.globalize("cms.ui.workflow.task.view_unlocked"))); + m_viewUnlockLink = new ActionLink(new + Label(GlobalizationUtil + .globalize("cms.ui.workflow.task.view_unlocked"))); m_viewUnlockLink.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { PageState ps = e.getPageState(); @@ -233,7 +244,9 @@ public class TasksPanel extends CMSContainer { } }); - m_viewAllLockLink = new ActionLink(new Label(GlobalizationUtil.globalize("cms.ui.workflow.task.view_all"))); + m_viewAllLockLink = new ActionLink(new + Label(GlobalizationUtil + .globalize("cms.ui.workflow.task.view_all"))); m_viewAllLockLink.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { PageState ps = e.getPageState(); @@ -241,11 +254,14 @@ public class TasksPanel extends CMSContainer { } }); - m_viewLockLabel = new Label(GlobalizationUtil.globalize("cms.ui.workflow.task.view_locked")); + m_viewLockLabel = new Label(GlobalizationUtil + .globalize("cms.ui.workflow.task.view_locked")); m_viewLockLabel.setFontWeight(Label.BOLD); - m_viewUnlockLabel = new Label(GlobalizationUtil.globalize("cms.ui.workflow.task.view_unlocked")); + m_viewUnlockLabel = new Label(GlobalizationUtil + .globalize("cms.ui.workflow.task.view_unlocked")); m_viewUnlockLabel.setFontWeight(Label.BOLD); - m_viewAllLockLabel = new Label(GlobalizationUtil.globalize("cms.ui.workflow.task.view_all")); + m_viewAllLockLabel = new Label(GlobalizationUtil + .globalize("cms.ui.workflow.task.view_all")); m_viewAllLockLabel.setFontWeight(Label.BOLD); add(new Label("
",false)); @@ -267,6 +283,11 @@ public class TasksPanel extends CMSContainer { // m_actionLabel.setClassAttr("action"); } + /** + * + * @param p + */ + @Override public void register(Page p) { super.register(p); @@ -381,15 +402,18 @@ public class TasksPanel extends CMSContainer { CompoundFilter authorFilter = ff.and(); //cg query changed to refer to task type id authorFilter.addFilter(ff.equals("taskType",CMSTaskType.AUTHOR)); - authorFilter.addFilter(getTaskFilter(CMSTaskType.retrieve(CMSTaskType.AUTHOR), party, ff)); + authorFilter.addFilter(getTaskFilter(CMSTaskType.retrieve(CMSTaskType.AUTHOR), + party, ff)); CompoundFilter approveFilter = ff.and(); approveFilter.addFilter(ff.equals("taskType",CMSTaskType.EDIT)); - approveFilter.addFilter(getTaskFilter(CMSTaskType.retrieve(CMSTaskType.EDIT), party, ff)); + approveFilter.addFilter(getTaskFilter(CMSTaskType.retrieve(CMSTaskType.EDIT), + party, ff)); CompoundFilter deployFilter = ff.and(); deployFilter.addFilter(ff.equals("taskType",CMSTaskType.DEPLOY)); - deployFilter.addFilter(getTaskFilter(CMSTaskType.retrieve(CMSTaskType.DEPLOY), party, ff)); + deployFilter.addFilter(getTaskFilter(CMSTaskType.retrieve(CMSTaskType.DEPLOY), + party, ff)); CompoundFilter permissionFilter = ff.or(); permissionFilter.addFilter(authorFilter); @@ -416,6 +440,7 @@ public class TasksPanel extends CMSContainer { m_sectionSel = sectionSel; } + @Override protected BigDecimal getRootFolderID(PageState s) { ContentSection sec = (ContentSection) m_sectionSel.getSelectedObject(s); Assert.exists(sec); @@ -468,12 +493,14 @@ public class TasksPanel extends CMSContainer { } private RequestLocal m_taskCount = new RequestLocal() { + @Override public Object initialValue(PageState state) { DataQuery query = makeQuery(state); return new Long(query.size()); } }; + @Override public void generateXML(PageState state, Element parent) { Element content = parent.newChildElement("cms:tasksPanel", CMS.CMS_XML_NS); @@ -540,7 +567,8 @@ public class TasksPanel extends CMSContainer { sections.put(sectionID, sectionPath); } - Element task = content.newChildElement("cms:tasksPanelTask", CMS.CMS_XML_NS); + Element task = content.newChildElement("cms:tasksPanelTask", + CMS.CMS_XML_NS); BigDecimal itemID = (BigDecimal)query.get("itemID"); String taskType = (String)query.get("taskType"); @@ -590,9 +618,11 @@ public class TasksPanel extends CMSContainer { } if ("Deploy".equals(taskType)) { - task.addAttribute("editTabNumber", String.valueOf(ContentItemPage.PUBLISHING_TAB)); + task.addAttribute("editTabNumber", + String.valueOf(ContentItemPage.PUBLISHING_TAB)); } else { - task.addAttribute("editTabNumber", String.valueOf(ContentItemPage.AUTHORING_TAB)); + task.addAttribute("editTabNumber", + String.valueOf(ContentItemPage.AUTHORING_TAB)); } } @@ -635,6 +665,7 @@ public class TasksPanel extends CMSContainer { } + @Override public void respond(PageState state) throws ServletException { String key = state.getControlEventName(); String value = state.getControlEventValue(); @@ -666,7 +697,9 @@ public class TasksPanel extends CMSContainer { } } - String redirectURL = Web.getConfig().getDispatcherServletPath() + sectionPath + "/admin/item.jsp?item_id=" + itemID + "&set_tab=" + tabNumber; + String redirectURL = Web.getConfig().getDispatcherServletPath() + + sectionPath + "/admin/item.jsp?item_id=" + + itemID + "&set_tab=" + tabNumber; throw new RedirectSignal(redirectURL,true); } catch (DataObjectNotFoundException ex) { throw new ServletException("Unknown content ID" + itemID); @@ -684,7 +717,8 @@ public class TasksPanel extends CMSContainer { } } - private static Filter getTaskFilter(CMSTaskType taskType, Party party, FilterFactory factory) { + private static Filter getTaskFilter(CMSTaskType taskType + , Party party, FilterFactory factory) { PrivilegeDescriptor privilege; String queryName; String queryType; diff --git a/ccm-cms/web/packages/content-section/www/admin/index.jsp b/ccm-cms/web/templates/ccm-cms/content-section/admin/index.jsp similarity index 83% rename from ccm-cms/web/packages/content-section/www/admin/index.jsp rename to ccm-cms/web/templates/ccm-cms/content-section/admin/index.jsp index 39057f110..a6ab17905 100755 --- a/ccm-cms/web/packages/content-section/www/admin/index.jsp +++ b/ccm-cms/web/templates/ccm-cms/content-section/admin/index.jsp @@ -1,8 +1,8 @@ - + @@ -19,11 +19,11 @@ DispatcherHelper.cacheDisable(response); ContentSection section = - ContentSectionDispatcher.getContentSection(request); + ContentSectionServlet.getContentSection(request); if (Web.getContext().getUser() == null) { throw new LoginSignal(request); - } else if (! ContentSectionDispatcher.checkAdminAccess(request, section)) { + } else if (! ContentSectionServlet.checkAdminAccess(request, section)) { throw new com.arsdigita.cms.dispatcher.AccessDeniedException(); } diff --git a/ccm-cms/web/packages/content-section/www/admin/item.jsp b/ccm-cms/web/templates/ccm-cms/content-section/admin/item.jsp similarity index 90% rename from ccm-cms/web/packages/content-section/www/admin/item.jsp rename to ccm-cms/web/templates/ccm-cms/content-section/admin/item.jsp index d69e17871..58f0e9124 100755 --- a/ccm-cms/web/packages/content-section/www/admin/item.jsp +++ b/ccm-cms/web/templates/ccm-cms/content-section/admin/item.jsp @@ -2,7 +2,7 @@ - + @@ -28,12 +28,12 @@ request = DispatcherHelper.getRequest(); ContentSection section = - ContentSectionDispatcher.getContentSection(request); + ContentSectionServlet.getContentSection(request); if (Web.getContext().getUser() == null) { throw new LoginSignal(request); - } else if (! ContentSectionDispatcher.checkAdminAccess(request, section)) { + } else if (! ContentSectionServlet.checkAdminAccess(request, section)) { throw new com.arsdigita.cms.dispatcher.AccessDeniedException(); } diff --git a/ccm-cms/web/packages/content-section/www/admin/search.jsp b/ccm-cms/web/templates/ccm-cms/content-section/admin/search.jsp similarity index 80% rename from ccm-cms/web/packages/content-section/www/admin/search.jsp rename to ccm-cms/web/templates/ccm-cms/content-section/admin/search.jsp index 67afe1405..374f69457 100755 --- a/ccm-cms/web/packages/content-section/www/admin/search.jsp +++ b/ccm-cms/web/templates/ccm-cms/content-section/admin/search.jsp @@ -1,7 +1,7 @@ - + @@ -17,9 +17,9 @@ DispatcherHelper.cacheDisable(response); ContentSection section = - ContentSectionDispatcher.getContentSection(request); + ContentSectionServlet.getContentSection(request); - if (! ContentSectionDispatcher.checkAdminAccess(request, section)) { + if (! ContentSectionServlet.checkAdminAccess(request, section)) { throw new com.arsdigita.cms.dispatcher.AccessDeniedException(); } diff --git a/ccm-cms/web/packages/content-section/www/content-center-redirect.jsp b/ccm-cms/web/templates/ccm-cms/content-section/content-center-redirect.jsp similarity index 100% rename from ccm-cms/web/packages/content-section/www/content-center-redirect.jsp rename to ccm-cms/web/templates/ccm-cms/content-section/content-center-redirect.jsp diff --git a/ccm-cms/web/packages/content-section/www/index.jsp b/ccm-cms/web/templates/ccm-cms/content-section/index.jsp similarity index 59% rename from ccm-cms/web/packages/content-section/www/index.jsp rename to ccm-cms/web/templates/ccm-cms/content-section/index.jsp index 098d858df..7ae4b2e21 100755 --- a/ccm-cms/web/packages/content-section/www/index.jsp +++ b/ccm-cms/web/templates/ccm-cms/content-section/index.jsp @@ -6,6 +6,14 @@ // Version: $Revision: #1 $ $DateTime: 2003/11/06 11:50:38 $ // See: https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=108722 // FIXME: the text below needs to be prettified and globalized. + // + // Wild Guess: JSP to handle the legacy presentation based on either folder + // structure or content section specific categories. Now replaced by + // navigation and terms, therefore no longer used. + // Link to this jsp is still part of CMS UI (part of content section + // listing in content-center but hidden by configuration parameter + // com.arsdigita.cms.hide_legacy_public_site_link + // in CMSConfig diff --git a/ccm-cms/web/themes/heirloom/apps/content-section/xsl/admin.xsl b/ccm-cms/web/themes/heirloom/apps/content-section/xsl/content-admin.xsl similarity index 100% rename from ccm-cms/web/themes/heirloom/apps/content-section/xsl/admin.xsl rename to ccm-cms/web/themes/heirloom/apps/content-section/xsl/content-admin.xsl diff --git a/ccm-core/src/com/arsdigita/bebop/FormProcessException.java b/ccm-core/src/com/arsdigita/bebop/FormProcessException.java index 8ef9f2c08..55ab60270 100755 --- a/ccm-core/src/com/arsdigita/bebop/FormProcessException.java +++ b/ccm-core/src/com/arsdigita/bebop/FormProcessException.java @@ -60,6 +60,7 @@ public class FormProcessException extends ServletException { * printed twice, which is not that big of a deal in the grand scheme of * things. */ + @Override public void printStackTrace() { super.printStackTrace(); if (getRootCause() != null) { @@ -71,6 +72,7 @@ public class FormProcessException extends ServletException { /** * @see #printStackTrace() */ + @Override public void printStackTrace(java.io.PrintStream s) { super.printStackTrace(s); if (getRootCause() != null) { @@ -82,6 +84,7 @@ public class FormProcessException extends ServletException { /** * @see #printStackTrace() */ + @Override public void printStackTrace(java.io.PrintWriter s) { super.printStackTrace(s); if (getRootCause() != null) { @@ -95,7 +98,7 @@ public class FormProcessException extends ServletException { * #getRootCause()}.getMessage().

**/ public String getMessages() { - StringBuffer result = new StringBuffer(getMessage()); + StringBuilder result = new StringBuilder(getMessage()); if ( getRootCause() != null ) { result.append(" (root cause: ") .append(getRootCause().getMessage()) diff --git a/ccm-core/src/com/arsdigita/bebop/SimpleContainer.java b/ccm-core/src/com/arsdigita/bebop/SimpleContainer.java index dd54e2511..db43fc11f 100755 --- a/ccm-core/src/com/arsdigita/bebop/SimpleContainer.java +++ b/ccm-core/src/com/arsdigita/bebop/SimpleContainer.java @@ -161,6 +161,7 @@ public class SimpleContainer extends BlockStylable implements Container { * Returns all the components of this container. * @return all the components of this container. */ + @Override public Iterator children() { return m_components.iterator(); } diff --git a/ccm-core/src/com/arsdigita/dispatcher/MultipartHttpServletRequest.java b/ccm-core/src/com/arsdigita/dispatcher/MultipartHttpServletRequest.java index 76368802c..26313e665 100755 --- a/ccm-core/src/com/arsdigita/dispatcher/MultipartHttpServletRequest.java +++ b/ccm-core/src/com/arsdigita/dispatcher/MultipartHttpServletRequest.java @@ -63,7 +63,7 @@ import com.arsdigita.util.UncheckedWrapperException; public class MultipartHttpServletRequest implements HttpServletRequest { private static final Category s_log = Category.getInstance - (MultipartHttpServletRequest.class); + (MultipartHttpServletRequest.class); private HttpServletRequest m_request; private Map m_parameters = null; @@ -205,9 +205,17 @@ public class MultipartHttpServletRequest implements HttpServletRequest { return m_request.getRequestURI(); } +// public StringBuffer getRequestURL() { +// throw new UnsupportedOperationException +// ("This is a Servlet 2.3 feature that we do not currently support"); +// } + + /* Obviously there was a problem with this method in early implementations + * of Servlet specification 2.3 which was resolved later. So it should be + * save to use it now. (2012-02-06) + */ public StringBuffer getRequestURL() { - throw new UnsupportedOperationException - ("This is a Servlet 2.3 feature that we do not currently support"); + return m_request.getRequestURL(); } public String getServletPath() { diff --git a/ccm-core/src/com/arsdigita/kernel/KernelExcursion.java b/ccm-core/src/com/arsdigita/kernel/KernelExcursion.java index 99d4f8efb..3b47bded1 100755 --- a/ccm-core/src/com/arsdigita/kernel/KernelExcursion.java +++ b/ccm-core/src/com/arsdigita/kernel/KernelExcursion.java @@ -39,12 +39,9 @@ import java.util.Locale; * * rootExcursion.run(); * + * @version $Id: KernelExcursion.java 287 2005-02-22 00:29:02Z sskracic $ */ public abstract class KernelExcursion implements Runnable { - public static final String versionId = - "$Id: KernelExcursion.java 287 2005-02-22 00:29:02Z sskracic $" + - "$Author: sskracic $" + - "$DateTime: 2004/08/16 18:10:38 $"; private static final Logger s_log = Logger.getLogger (KernelExcursion.class); diff --git a/ccm-core/src/com/arsdigita/kernel/KernelRequestContext.java b/ccm-core/src/com/arsdigita/kernel/KernelRequestContext.java index 845963b25..189134dae 100755 --- a/ccm-core/src/com/arsdigita/kernel/KernelRequestContext.java +++ b/ccm-core/src/com/arsdigita/kernel/KernelRequestContext.java @@ -24,10 +24,12 @@ import com.arsdigita.dispatcher.InitialRequestContext; import com.arsdigita.dispatcher.RequestContext; import org.apache.log4j.Logger; +/** + * + * @version $Id: KernelRequestContext.java 287 2005-02-22 00:29:02Z sskracic $ + */ public class KernelRequestContext extends InitialRequestContext { - public static final String versionId = "$Id: KernelRequestContext.java 287 2005-02-22 00:29:02Z sskracic $ by $Author: sskracic $, $DateTime: 2004/08/16 18:10:38 $"; - private static final Logger s_cat = Logger.getLogger(KernelRequestContext.class.getName()); diff --git a/ccm-core/src/com/arsdigita/kernel/User.java b/ccm-core/src/com/arsdigita/kernel/User.java index ad87d5997..ef82ac4a9 100755 --- a/ccm-core/src/com/arsdigita/kernel/User.java +++ b/ccm-core/src/com/arsdigita/kernel/User.java @@ -57,8 +57,9 @@ public class User extends Party { * object type is either this base type or a subtype of this base type. */ public static final String BASE_DATA_OBJECT_TYPE = - "com.arsdigita.kernel.User"; + "com.arsdigita.kernel.User"; + @Override protected String getBaseDataObjectType() { return BASE_DATA_OBJECT_TYPE; } diff --git a/ccm-core/src/com/arsdigita/kernel/security/UserContext.java b/ccm-core/src/com/arsdigita/kernel/security/UserContext.java index 1ac62c910..ca9411dfb 100755 --- a/ccm-core/src/com/arsdigita/kernel/security/UserContext.java +++ b/ccm-core/src/com/arsdigita/kernel/security/UserContext.java @@ -482,14 +482,14 @@ public class UserContext { * parameter values are doubly-encoded so that they are decoded * appropriately. * - * @deprecated This should be moved to a more appropriate class. * * @param req the request to encode * * @return the URL-encoded parameter + * @deprecated This should be moved to a more appropriate class. */ public static String encodeReturnURL(HttpServletRequest req) { - StringBuffer returnURL = new StringBuffer(100); + StringBuilder returnURL = new StringBuilder(100); returnURL.append(Web.getContext().getRequestURL().getRequestURI()); returnURL.append('?'); diff --git a/ccm-core/src/com/arsdigita/templating/PatternStylesheetResolver.java b/ccm-core/src/com/arsdigita/templating/PatternStylesheetResolver.java index e7e13dccb..c898dbc62 100755 --- a/ccm-core/src/com/arsdigita/templating/PatternStylesheetResolver.java +++ b/ccm-core/src/com/arsdigita/templating/PatternStylesheetResolver.java @@ -66,10 +66,8 @@ import org.apache.log4j.Logger; * * *

- * You may use the - * com.arsdigita.templating.stylesheet_paths system - * property to change the file from which the stylesheet patterns are - * drawn. + * You may use the com.arsdigita.templating.stylesheet_paths system + * property to change the file from which the stylesheet patterns are drawn. *

* *

@@ -118,19 +116,19 @@ public class PatternStylesheetResolver implements StylesheetResolver { /** Logger instance for debugging. */ private static final Logger s_log = Logger.getLogger - (PatternStylesheetResolver.class); + (PatternStylesheetResolver.class); /** List of registered pattern generators which are queried in turn. */ private static final HashMap s_generators = new HashMap(); + /** * Registers a new pattern generator for the given key. * * @param key the key as it appears in the pattern string * @param gen a pattern generator for producing values to be * substituted for key - **/ - + */ public static void registerPatternGenerator(String key, PatternGenerator gen) { s_generators.put(key, gen); @@ -159,6 +157,10 @@ public class PatternStylesheetResolver implements StylesheetResolver { // This is a List of Lists. private List m_paths = null; + /** + * + * @param path + */ private void loadPaths(String path) { if (s_log.isInfoEnabled()) { s_log.info("Loading paths from " + path); @@ -200,6 +202,11 @@ public class PatternStylesheetResolver implements StylesheetResolver { } } + /** + * + * @param request + * @return + */ public URL resolve(HttpServletRequest request) { synchronized(this) { if (m_paths == null) { @@ -271,6 +278,13 @@ public class PatternStylesheetResolver implements StylesheetResolver { ("no path to XSL stylesheet found; " + "try modifying " + m_path); } + /** + * + * @param inBits + * @param paths + * @param values + * @param request + */ private void expandPlaceholders(String[] inBits, ArrayList paths, HashMap values, @@ -324,6 +338,13 @@ public class PatternStylesheetResolver implements StylesheetResolver { } } + /** + * + * @param key + * @param values + * @param request + * @return + */ private String[] getValues(String key, HashMap values, HttpServletRequest request) { diff --git a/ccm-core/src/com/arsdigita/templating/jsp/QueryTag.java b/ccm-core/src/com/arsdigita/templating/jsp/QueryTag.java index 2da059e42..760ba932e 100755 --- a/ccm-core/src/com/arsdigita/templating/jsp/QueryTag.java +++ b/ccm-core/src/com/arsdigita/templating/jsp/QueryTag.java @@ -30,8 +30,8 @@ import javax.servlet.jsp.tagext.BodyTagSupport; * *

Usage:

* - *
<acs:master path="path/to/master.jsp" />
- **/
+ * 
<acs:master path="path/to/master.jsp" />
+ */ public class QueryTag extends BodyTagSupport { private String name = null; @@ -46,6 +46,7 @@ public class QueryTag extends BodyTagSupport { this.name = name; } + @Override public int doStartTag() throws JspTagException { Session session = SessionManager.getSession(); diff --git a/ccm-core/src/com/arsdigita/templating/jsp/example/assets/README b/ccm-core/src/com/arsdigita/templating/jsp/example/assets/README new file mode 100644 index 000000000..4efcaa027 --- /dev/null +++ b/ccm-core/src/com/arsdigita/templating/jsp/example/assets/README @@ -0,0 +1,4 @@ +Only used by components/master.jsp and related files which seem to be +outdated. + +Might be deleted. \ No newline at end of file diff --git a/ccm-cms/web/packages/content-section/www/assets/blank.gif b/ccm-core/src/com/arsdigita/templating/jsp/example/assets/blank.gif similarity index 100% rename from ccm-cms/web/packages/content-section/www/assets/blank.gif rename to ccm-core/src/com/arsdigita/templating/jsp/example/assets/blank.gif diff --git a/ccm-cms/web/packages/content-section/www/assets/folder-closed.gif b/ccm-core/src/com/arsdigita/templating/jsp/example/assets/folder-closed.gif similarity index 100% rename from ccm-cms/web/packages/content-section/www/assets/folder-closed.gif rename to ccm-core/src/com/arsdigita/templating/jsp/example/assets/folder-closed.gif diff --git a/ccm-cms/web/packages/content-section/www/assets/folder-open.gif b/ccm-core/src/com/arsdigita/templating/jsp/example/assets/folder-open.gif similarity index 100% rename from ccm-cms/web/packages/content-section/www/assets/folder-open.gif rename to ccm-core/src/com/arsdigita/templating/jsp/example/assets/folder-open.gif diff --git a/ccm-cms/web/packages/content-section/www/assets/folder-selected.gif b/ccm-core/src/com/arsdigita/templating/jsp/example/assets/folder-selected.gif similarity index 100% rename from ccm-cms/web/packages/content-section/www/assets/folder-selected.gif rename to ccm-core/src/com/arsdigita/templating/jsp/example/assets/folder-selected.gif diff --git a/ccm-cms/web/packages/content-section/www/components/folder-links.jsp b/ccm-core/src/com/arsdigita/templating/jsp/example/folder-links.jsp similarity index 74% rename from ccm-cms/web/packages/content-section/www/components/folder-links.jsp rename to ccm-core/src/com/arsdigita/templating/jsp/example/folder-links.jsp index 5c91010b5..21356cd02 100755 --- a/ccm-cms/web/packages/content-section/www/components/folder-links.jsp +++ b/ccm-core/src/com/arsdigita/templating/jsp/example/folder-links.jsp @@ -24,7 +24,7 @@ "open" : "closed"; %> - 
<%=topFolders.get("folderLabel")%> + <%=topFolders.get("folderLabel")%> <% if (folderPath.startsWith((String) topFolders.get("folderName"))) { %> @@ -42,7 +42,7 @@ "selected" : "closed"; %> - <%=subFolders.get("folderLabel")%> + <%=subFolders.get("folderLabel")%> <% } %> diff --git a/ccm-cms/web/packages/content-section/www/components/master.jsp b/ccm-core/src/com/arsdigita/templating/jsp/example/master.jsp similarity index 99% rename from ccm-cms/web/packages/content-section/www/components/master.jsp rename to ccm-core/src/com/arsdigita/templating/jsp/example/master.jsp index 1bb7931a6..876a07292 100755 --- a/ccm-cms/web/packages/content-section/www/components/master.jsp +++ b/ccm-core/src/com/arsdigita/templating/jsp/example/master.jsp @@ -1,5 +1,4 @@ <%@ taglib uri="/WEB-INF/jsp-template.tld" prefix="acs" %> - diff --git a/ccm-core/src/com/arsdigita/templating/jsp/example/package.html b/ccm-core/src/com/arsdigita/templating/jsp/example/package.html new file mode 100755 index 000000000..d37c64119 --- /dev/null +++ b/ccm-core/src/com/arsdigita/templating/jsp/example/package.html @@ -0,0 +1,19 @@ + + + +com.arsdigita.templating.jsp + + + +

+ Example for using JSP tags with the templating system. +

+

+ File master.jsp is referenced as usabe example in + com.arsdigita.templating.jsp.QueryTag.java +

+

+ Content of this directory is probably outdated! +

+ + diff --git a/ccm-cms/web/packages/content-section/www/components/section-tabs.jsp b/ccm-core/src/com/arsdigita/templating/jsp/example/section-tabs.jsp similarity index 100% rename from ccm-cms/web/packages/content-section/www/components/section-tabs.jsp rename to ccm-core/src/com/arsdigita/templating/jsp/example/section-tabs.jsp diff --git a/ccm-core/src/com/arsdigita/templating/jsp/package.html b/ccm-core/src/com/arsdigita/templating/jsp/package.html index 219daf1b4..3f764f68f 100755 --- a/ccm-core/src/com/arsdigita/templating/jsp/package.html +++ b/ccm-core/src/com/arsdigita/templating/jsp/package.html @@ -1,15 +1,16 @@ - + com.arsdigita.templating.jsp - +

- -JSP tags that integrate with the templating system. - + JSP tags that integrate with the templating system.

- +

+ Now no longer in use. All pages are either dynamically created (and rendered + using XSL transformation) or exported in html format. +

diff --git a/ccm-core/src/com/arsdigita/web/Application.java b/ccm-core/src/com/arsdigita/web/Application.java index 0430827bb..1a24cf88f 100755 --- a/ccm-core/src/com/arsdigita/web/Application.java +++ b/ccm-core/src/com/arsdigita/web/Application.java @@ -597,9 +597,14 @@ public class Application extends Resource { } /** - * Returns the path to this application through the dispatcher. + * Returns the path to this application through the dispatcher. It does not + * contain the static prefix (if configured, "ccm" by default), so it can + * be used to construct url's for internal links. + * * The path does not end in a slash. This method will not return * null. + * + * @return Path string including w/o static prefix (if configured) */ public final String getPath() { final String path = (String) get(PRIMARY_URL); @@ -613,7 +618,7 @@ public class Application extends Resource { } } - // XXX primary URL doesn't keep in sync with sitenode hierarchY + // XXX primary URL doesn't keep in sync with sitenode hierarchy // We need to use a trigger-like mechanism to keep the primaryURL // denormalization correct. /** diff --git a/ccm-core/src/com/arsdigita/web/BaseApplicationServlet.java b/ccm-core/src/com/arsdigita/web/BaseApplicationServlet.java index 1ae45eaa6..148600bfc 100755 --- a/ccm-core/src/com/arsdigita/web/BaseApplicationServlet.java +++ b/ccm-core/src/com/arsdigita/web/BaseApplicationServlet.java @@ -30,7 +30,6 @@ import com.arsdigita.kernel.security.UserContext; import com.arsdigita.sitenode.SiteNodeRequestContext; import com.arsdigita.util.Assert; import com.arsdigita.util.UncheckedWrapperException; -import com.arsdigita.web.Application; import java.io.IOException; import javax.servlet.ServletException; diff --git a/ccm-core/src/com/arsdigita/web/HttpServletRequestWrapper.java b/ccm-core/src/com/arsdigita/web/HttpServletRequestWrapper.java index da61012d7..ebdbb06c3 100755 --- a/ccm-core/src/com/arsdigita/web/HttpServletRequestWrapper.java +++ b/ccm-core/src/com/arsdigita/web/HttpServletRequestWrapper.java @@ -24,6 +24,10 @@ import javax.servlet.http.HttpSession; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.Cookie; +/** + * + * @author unknown + */ public class HttpServletRequestWrapper extends ServletRequestWrapper implements HttpServletRequest { private final HttpServletRequest m_req; diff --git a/ccm-core/src/com/arsdigita/web/ResourceServlet.java b/ccm-core/src/com/arsdigita/web/ResourceServlet.java index 780813686..d2b42e18e 100755 --- a/ccm-core/src/com/arsdigita/web/ResourceServlet.java +++ b/ccm-core/src/com/arsdigita/web/ResourceServlet.java @@ -51,6 +51,14 @@ public class ResourceServlet extends BaseServlet { private static final Logger s_log = Logger.getLogger(ResourceServlet.class); + /** + * + * @param sreq + * @param sresp + * @throws ServletException + * @throws IOException + */ + @Override protected void doService(HttpServletRequest sreq, HttpServletResponse sresp) throws ServletException, IOException { diff --git a/ccm-core/src/com/arsdigita/web/URL.java b/ccm-core/src/com/arsdigita/web/URL.java index 971a011fc..7d850100f 100755 --- a/ccm-core/src/com/arsdigita/web/URL.java +++ b/ccm-core/src/com/arsdigita/web/URL.java @@ -916,7 +916,11 @@ public class URL { } } - public static final String getDispatcherPath() { + /** + * + * @return + */ + public static String getDispatcherPath() { final WebConfig config = Web.getConfig(); final HttpServletRequest req = Web.getRequest(); diff --git a/ccm-core/src/com/arsdigita/web/Web.java b/ccm-core/src/com/arsdigita/web/Web.java index 7fcb02b96..782d843bc 100755 --- a/ccm-core/src/com/arsdigita/web/Web.java +++ b/ccm-core/src/com/arsdigita/web/Web.java @@ -51,11 +51,11 @@ public class Web { private static final Logger s_log = Logger.getLogger(Web.class); private static final ThreadLocal s_request = - new InternalRequestLocal(); + new InternalRequestLocal(); private static final ThreadLocal s_servletContext = - new InternalRequestLocal(); + new InternalRequestLocal(); private static final ThreadLocal s_userContext = - new InternalRequestLocal(); + new InternalRequestLocal(); private static final Map s_contexts = new HashMap(); diff --git a/ccm-core/web/templates/README.servlet b/ccm-core/web/templates/README.servlet new file mode 100644 index 000000000..0523ce61b --- /dev/null +++ b/ccm-core/web/templates/README.servlet @@ -0,0 +1,9 @@ +The address + /templates/servlet/* +is used by some servlets to create a virtual temporary location to pass +in dynamic information at runtime. + +Example: +Servlet content-sectionr uses + /templates/servlet/content-item/* +to pass in runtime information. \ No newline at end of file diff --git a/ccm-core/web/themes/README.servlet b/ccm-core/web/themes/README.servlet new file mode 100644 index 000000000..aec959927 --- /dev/null +++ b/ccm-core/web/themes/README.servlet @@ -0,0 +1,11 @@ +The address + /themes/servlet/* +is used by some servlets to create a virtual temporary location to pass +in dynamic information for theme files (*.css / *.xsl) which need to be +collected at runtime. + +Example: +Servlet portlet-type-xsl used + /themes/servlet/portlet-type/* +to pass in at runtime a list of actually installed portlet's default xsl +templates to use as fallback. \ No newline at end of file diff --git a/ccm-ldn-aplaws/bundles/custom/cfg/project.xml b/ccm-ldn-aplaws/bundles/custom/cfg/project.xml index a74f1df16..bbf7f9eaf 100755 --- a/ccm-ldn-aplaws/bundles/custom/cfg/project.xml +++ b/ccm-ldn-aplaws/bundles/custom/cfg/project.xml @@ -70,7 +70,10 @@ - + diff --git a/ccm-ldn-aplaws/bundles/demo/cfg/integration.properties b/ccm-ldn-aplaws/bundles/demo/cfg/integration.properties index 4093a6d40..cc70dc909 100755 --- a/ccm-ldn-aplaws/bundles/demo/cfg/integration.properties +++ b/ccm-ldn-aplaws/bundles/demo/cfg/integration.properties @@ -4,7 +4,8 @@ waf.bebop.base_page=com.arsdigita.aplaws.ui.SimplePage # ; dhtml editor to use (system wide) ; Xinha is default -; waf.bebop.dhtml_editor=Xinha +; default: Xinha editor & src=/assets/xinha/XinhaLoader.js +; To use FCKeditor configure: ; waf.bebop.dhtml_editor=FCKeditor waf.categorization.show_internal_name=true @@ -13,9 +14,10 @@ waf.dispatcher.default_expiry=3600 ; waf.kernel.data_permission_check_enabled=false waf.kernel.primary_user_identifier=email -; if you activate screen_name, forum loader doesn't work. +; if you activate screen_name, forum loader does not work. ; waf.kernel.primary_user_identifier=screen_name waf.kernel.supported_languages=en,de +waf.kernel.language_independent_items=true ; security.properties: waf.auto_registration_on=false @@ -98,7 +100,6 @@ com.arsdigita.cms.contenttypes.newsitem.start_year=2000 com.arsdigita.cms.contenttypes.newsitem.end_year_delta=5 - # Forum application com.arsdigita.forum.show_new_tabs=true com.arsdigita.forum.use_wysiwyg_editor=true @@ -116,18 +117,21 @@ com.arsdigita.london.atoz.root_category_picker=com.arsdigita.london.terms.ui.Roo com.arsdigita.navigation.category_menu_show_grand_children=false ; com.arsdigita.navigation.category_menu_show_nephews=false com.arsdigita.navigation.default_cat_root_path=/navigation/ -com.arsdigita.navigation.default_template=/packages/navigation/templates/default.jsp +com.arsdigita.navigation.default_template=/templates/ccm-navigation/navigation/sci-default.jsp +; com.arsdigita.navigation.templates_file=bundle/navigation/sci-templates.txt -# ccm-ldn-search application +# ccm-search application com.arsdigita.london.search.show_sponsored_links=true -# ccm-ldn-subsite application -com.arsdigita.london.subsite.root_category_picker=com.arsdigita.london.terms.ui.RootCategoryPicker +# ccm-subsite application +com.arsdigita.subsite.root_category_picker=com.arsdigita.london.terms.ui.RootCategoryPicker # ccm-themedirector application +themedirector.default_theme_context= +# themedirector.default_theme_manifest=ccm-zes-aplaws.web.mf themedirector.default_theme_path=themes/static/aplaws com.arsdigita.london.cms.dublin.audience_domain=LGAL diff --git a/ccm-ldn-aplaws/bundles/devel/cfg/project.xml b/ccm-ldn-aplaws/bundles/devel/cfg/project.xml index 58ae4512b..72c5f49c8 100755 --- a/ccm-ldn-aplaws/bundles/devel/cfg/project.xml +++ b/ccm-ldn-aplaws/bundles/devel/cfg/project.xml @@ -50,7 +50,10 @@ - + diff --git a/ccm-ldn-aplaws/bundles/extended/cfg/project.xml b/ccm-ldn-aplaws/bundles/extended/cfg/project.xml index 62d5d5cd8..fd435356a 100755 --- a/ccm-ldn-aplaws/bundles/extended/cfg/project.xml +++ b/ccm-ldn-aplaws/bundles/extended/cfg/project.xml @@ -86,8 +86,12 @@ - - + + + diff --git a/ccm-ldn-aplaws/web/themes/static/aplaws/content-section-admin.xsl b/ccm-ldn-aplaws/web/themes/static/aplaws/content-section-content-admin.xsl similarity index 95% rename from ccm-ldn-aplaws/web/themes/static/aplaws/content-section-admin.xsl rename to ccm-ldn-aplaws/web/themes/static/aplaws/content-section-content-admin.xsl index 7fa9efb68..70dc7223f 100644 --- a/ccm-ldn-aplaws/web/themes/static/aplaws/content-section-admin.xsl +++ b/ccm-ldn-aplaws/web/themes/static/aplaws/content-section-content-admin.xsl @@ -7,7 +7,7 @@ exclude-result-prefixes="bebop cms ui aplaws xsl" version="1.0"> - + diff --git a/ccm-navigation/src/com/arsdigita/navigation/NavigationFileResolver.java b/ccm-navigation/src/com/arsdigita/navigation/NavigationFileResolver.java index 8ef2df1f7..81d51ea01 100755 --- a/ccm-navigation/src/com/arsdigita/navigation/NavigationFileResolver.java +++ b/ccm-navigation/src/com/arsdigita/navigation/NavigationFileResolver.java @@ -60,6 +60,9 @@ public class NavigationFileResolver extends DefaultApplicationFileResolver { public static final String PATH_COOKIE_NAME = "ad_path"; public static final char PATH_COOKIE_SEPARATOR = '|'; + /** + * + */ @Override public RequestDispatcher resolve(String templatePath, HttpServletRequest sreq, diff --git a/ccm-portalserver/src/com/arsdigita/portalserver/ApplicationPage.java b/ccm-portalserver/src/com/arsdigita/portalserver/ApplicationPage.java index a72d11e50..5dc6fb757 100644 --- a/ccm-portalserver/src/com/arsdigita/portalserver/ApplicationPage.java +++ b/ccm-portalserver/src/com/arsdigita/portalserver/ApplicationPage.java @@ -49,16 +49,13 @@ import com.arsdigita.util.Assert; * * @author Tracy Adams * @version $Revision: #6 $ $Date: 2004/08/17 $ - */ - -/* XXX Have to control links with permissions and - * add access control + * @version $Id: //portalserver/dev/src/com/arsdigita/portalserver/ApplicationPage.java#6 $ */ public class ApplicationPage extends CWPage { - public static final String versionId = - "$Id: //portalserver/dev/src/com/arsdigita/portalserver/ApplicationPage.java#6 $" + - "$Author: dennis $" + - "$DateTime: 2004/08/17 23:19:25 $"; + + /* XXX Have to control links with permissions and + * add access control + */ private static org.apache.log4j.Logger log = org.apache.log4j.Logger.getLogger(ApplicationPage.class.getName()); @@ -75,6 +72,7 @@ public class ApplicationPage extends CWPage { } } + @Override public void lock() { buildPage(); @@ -108,7 +106,9 @@ public class ApplicationPage extends CWPage { } protected void buildGlobal(Container global) { - Link link = new Link( new Label(GlobalizationUtil.globalize("cw.workspace.sign_out")), "/register/logout"); + Link link = new Link( new Label( + GlobalizationUtil.globalize("cw.workspace.sign_out")), + "/register/logout"); link.setClassAttr("signoutLink"); @@ -145,7 +145,8 @@ public class ApplicationPage extends CWPage { // Assert.assertNotNull(party, "Party party"); Assert.exists(party, "Party party"); - link.setChild(new Label(GlobalizationUtil.globalize("cw.workspace.personal_workspace"))); + link.setChild(new Label(GlobalizationUtil + .globalize("cw.workspace.personal_workspace"))); link.setTarget("/personal-portal/" + party.getID() + "/"); } } diff --git a/ccm-portalserver/src/com/arsdigita/portalserver/CWPage.java b/ccm-portalserver/src/com/arsdigita/portalserver/CWPage.java index 6090ff77e..a35d334d6 100644 --- a/ccm-portalserver/src/com/arsdigita/portalserver/CWPage.java +++ b/ccm-portalserver/src/com/arsdigita/portalserver/CWPage.java @@ -40,19 +40,16 @@ import org.apache.log4j.Logger; * * @author Eric Lorenzo * @version $Revision: #5 $ $Date: 2004/08/17 $ - */ - -/* XXX Have to control links with permissions and - * add access control + * @version $Id: //portalserver/dev/src/com/arsdigita/portalserver/CWPage.java#5 $ */ public class CWPage extends Page { - public static final String versionId = - "$Id: //portalserver/dev/src/com/arsdigita/portalserver/CWPage.java#5 $" + - "$Author: dennis $" + - "$DateTime: 2004/08/17 23:19:25 $"; private static final Logger s_log = Logger.getLogger(CWPage.class); + /* XXX Have to control links with permissions and + * add access control + */ + private final Container m_global; private final Container m_header; private final Container m_body; @@ -133,7 +130,11 @@ public class CWPage extends Page { setSelected(ps, null); } + /** + * + */ private class Panel extends SimpleContainer { + @Override public void generateXML(PageState ps, Element p) { Component selected = getSelected(ps); if (selected == null) { diff --git a/ccm-sci-bundle/application.xml b/ccm-sci-bundle/application.xml index 3160a7062..c0d929103 100644 --- a/ccm-sci-bundle/application.xml +++ b/ccm-sci-bundle/application.xml @@ -16,8 +16,8 @@ - + diff --git a/ccm-sci-bundle/bundles/demo/cfg/integration.properties b/ccm-sci-bundle/bundles/demo/cfg/integration.properties index 3a2006b84..dfcd3df85 100644 --- a/ccm-sci-bundle/bundles/demo/cfg/integration.properties +++ b/ccm-sci-bundle/bundles/demo/cfg/integration.properties @@ -17,6 +17,7 @@ waf.kernel.primary_user_identifier=email ; if you activate screen_name, forum loader does not work. ; waf.kernel.primary_user_identifier=screen_name waf.kernel.supported_languages=de,en +waf.kernel.language_independent_items=true ; security.properties: waf.auto_registration_on=false @@ -46,7 +47,7 @@ com.arsdigita.cms.default_item_template_path=/default/aplaws-item.jsp com.arsdigita.cms.default_template_resolver_class=com.arsdigita.subsite.dispatcher.SubsiteItemTemplateResolver ; Configure dhtml editor for use in cms content-center -; Xinha is default and should work out of the box +; Xinha is default and does work out of the box ; A CCM specific configuration file is used to prevent a mess with the standard ; configuration, default is: ; com.arsdigita.cms.dhtml_editor_config=Xinha.Config,/assets/xinha/CCMcmsXinhaConfig.js @@ -94,7 +95,12 @@ com.arsdigita.forum.disable_page_caching=true # ccm-navigation application +; com.arsdigita.navigation.category_menu_show_grand_children_min=1 +; com.arsdigita.navigation.category_menu_show_grand_children=adaptive +; com.arsdigita.navigation.category_menu_show_grand_children_limit=1 +; com.arsdigita.navigation.category_menu_show_grand_children_max=65536 com.arsdigita.navigation.category_menu_show_grand_children=false +; com.arsdigita.navigation.category_menu_show_nephews=false com.arsdigita.navigation.default_cat_root_path=/navigation/ com.arsdigita.navigation.default_template=/templates/ccm-navigation/navigation/sci-default.jsp com.arsdigita.navigation.templates_file=bundle/navigation/sci-templates.txt @@ -112,7 +118,6 @@ com.arsdigita.subsite.root_category_picker=com.arsdigita.london.terms.ui.RootCat themedirector.default_theme_context= # themedirector.default_theme_manifest=ccm-zes-aplaws.web.mf themedirector.default_theme_path=themes/static/aplaws-generic -themedirector.file_extensions=bmp css gif jpeg jpg js png xml xsl # ccm-sci-bundle (Loader only) diff --git a/ccm-sci-bundle/bundles/demo/cfg/project.xml b/ccm-sci-bundle/bundles/demo/cfg/project.xml index 618955af2..747ea0d8b 100644 --- a/ccm-sci-bundle/bundles/demo/cfg/project.xml +++ b/ccm-sci-bundle/bundles/demo/cfg/project.xml @@ -84,8 +84,8 @@ - @@ -104,7 +104,7 @@ - + - + - + + - rss-files + rssfeed-files com.arsdigita.web.ApplicationFileServlet template-path - /templates/ccm-ldn-rss + /templates/ccm-rssfeed file-resolver - com.arsdigita.london.rss.RSSFileResolver + com.arsdigita.rssfeed.RSSFileResolver - + @@ -347,11 +347,12 @@ /ccm-navigation/files/* - + - rss-files - /ccm-ldn-rss/files/* + rssfeed-files + /ccm-rssfeed/files/* + @@ -420,7 +421,7 @@ legacy-adapter - /themes/servlet/legacy-adapter/* + /templates/servlet/legacy-adapter/* @@ -460,7 +461,7 @@ content-item-xsl - /themes/servlet/content-item/* + /templates/servlet/content-item/* diff --git a/ccm-sci-bundle/bundles/devel/cfg/integration.properties b/ccm-sci-bundle/bundles/devel/cfg/integration.properties index 3061e32bf..0aad3f8b9 100644 --- a/ccm-sci-bundle/bundles/devel/cfg/integration.properties +++ b/ccm-sci-bundle/bundles/devel/cfg/integration.properties @@ -17,6 +17,7 @@ waf.kernel.primary_user_identifier=email ; if you activate screen_name, forum loader does not work. ; waf.kernel.primary_user_identifier=screen_name waf.kernel.supported_languages=de,en +waf.kernel.language_independent_items=true ; security.properties: waf.auto_registration_on=false @@ -56,6 +57,7 @@ com.arsdigita.cms.default_template_resolver_class=com.arsdigita.subsite.dispatch ; com.arsdigita.cms.dhtml_editor_hidden_buttons= ; com.arsdigita.cms.dhtml_editor_plugins=TableOperations,CSS +com.arsdigita.cms.allow_content_create_in_section_listing=false com.arsdigita.cms.disable_item_pfs=true com.arsdigita.cms.hide_admin_tabs=true @@ -94,7 +96,12 @@ com.arsdigita.forum.disable_page_caching=true # ccm-navigation application +; com.arsdigita.navigation.category_menu_show_grand_children_min=1 +; com.arsdigita.navigation.category_menu_show_grand_children=adaptive +; com.arsdigita.navigation.category_menu_show_grand_children_limit=1 +; com.arsdigita.navigation.category_menu_show_grand_children_max=65536 com.arsdigita.navigation.category_menu_show_grand_children=false +; com.arsdigita.navigation.category_menu_show_nephews=false com.arsdigita.navigation.default_cat_root_path=/navigation/ com.arsdigita.navigation.default_template=/templates/ccm-navigation/navigation/sci-default.jsp com.arsdigita.navigation.templates_file=bundle/navigation/sci-templates.txt diff --git a/ccm-sci-bundle/bundles/devel/cfg/project.xml b/ccm-sci-bundle/bundles/devel/cfg/project.xml index ce9a5230f..685279dcf 100644 --- a/ccm-sci-bundle/bundles/devel/cfg/project.xml +++ b/ccm-sci-bundle/bundles/devel/cfg/project.xml @@ -106,7 +106,7 @@ - + @@ -135,7 +135,8 @@ several others. --> - + + + - - + - - diff --git a/ccm-sci-bundle/bundles/devel/cfg/web-sci.xml b/ccm-sci-bundle/bundles/devel/cfg/web-sci.xml index 2fd5ca56e..74f9d554a 100644 --- a/ccm-sci-bundle/bundles/devel/cfg/web-sci.xml +++ b/ccm-sci-bundle/bundles/devel/cfg/web-sci.xml @@ -421,7 +421,7 @@ legacy-adapter - /themes/servlet/legacy-adapter/* + /templates/servlet/legacy-adapter/* @@ -461,7 +461,7 @@ content-item-xsl - /themes/servlet/content-item/* + /templates/servlet/content-item/* diff --git a/ccm-sci-bundle/bundles/local/jensp-dev/cfg/integration.properties b/ccm-sci-bundle/bundles/local/jensp-dev/cfg/integration.properties index d850438ae..851dd14f0 100644 --- a/ccm-sci-bundle/bundles/local/jensp-dev/cfg/integration.properties +++ b/ccm-sci-bundle/bundles/local/jensp-dev/cfg/integration.properties @@ -1,14 +1,14 @@ # Scientific CMS devel bundle integration.properties # -waf.bebop.base_page=com.arsdigita.aplaws.ui.SimplePage +waf.bebop.base_page=com.arsdigita.bundle.ui.SimplePage # ; dhtml editor to use (system wide) ; Xinha is default ; default: Xinha editor & src=/assets/xinha/XinhaLoader.js -#waf.bebop.dhtml_editor=FCKeditor +; To use FCKeditor configure: +; waf.bebop.dhtml_editor=FCKeditor waf.categorization.show_internal_name=true -waf.categorization.supported_languages=de,en waf.dispatcher.default_expiry=3600 ; @@ -40,25 +40,22 @@ waf.xml.activate_full_date_formatter=true # ccm-cms parameters -com.arsdigita.cms.category_authoring_add_form=com.arsdigita.aplaws.ui.ItemCategoryPicker +com.arsdigita.cms.category_authoring_add_form=com.arsdigita.bundle.ui.ItemCategoryPicker com.arsdigita.cms.default_folder_template_path=/default/aplaws-folder.jsp com.arsdigita.cms.default_item_template_path=/default/aplaws-item.jsp com.arsdigita.cms.default_template_resolver_class=com.arsdigita.subsite.dispatcher.SubsiteItemTemplateResolver ; Configure dhtml editor for use in cms content-center -; Xinha is default and should work out of the box -; com.arsdigita.cms.dhtml_editor_config=XinhaConfig,/assets/xinha/XinhaConfig.js -; as a temporary measure a different configuration file which includes a link selection box for CCM items -; and CCM images should be specified: -com.arsdigita.cms.dhtml_editor_config=XinhaConfig,/assets/xinha/CCMcmsXinhaConfig.js +; Xinha is default and does work out of the box +; A CCM specific configuration file is used to prevent a mess with the standard +; configuration, default is: +; com.arsdigita.cms.dhtml_editor_config=Xinha.Config,/assets/xinha/CCMcmsXinhaConfig.js ; to use FCKeditor: ; com.arsdigita.cms.dhtml_editor_config=FCKEditor.Config.StyleDefault?,/assets/fckeditor/config/fckconfigOpenCCM.js -; com.arsdigita.cms.dhtml_editor_config=XinhaConfig,/assets/xinha/XinhaConfig.js ; com.arsdigita.cms.dhtml_editor_hidden_buttons= ; com.arsdigita.cms.dhtml_editor_plugins=TableOperations,CSS -com.arsdigita.cms.dhtml_editor_plugins= com.arsdigita.cms.disable_item_pfs=true @@ -75,7 +72,10 @@ com.arsdigita.cms.use_streamlined_creation=true # ccm-cms-types-event parameters com.arsdigita.cms.contenttypes.event.hide_cost=true +com.arsdigita.cms.contenttypes.event.hide_date_description=false +com.arsdigita.cms.contenttypes.event.hide_event_type=true com.arsdigita.cms.contenttypes.event.hide_link_to_map=true +com.arsdigita.cms.contenttypes.event.hide_main_contributor=true com.arsdigita.cms.contenttypes.event.use_html_date_description=false com.arsdigita.cms.contenttypes.event.start_year=2000 com.arsdigita.cms.contenttypes.event.end_year_delta=5 @@ -101,15 +101,15 @@ com.arsdigita.navigation.default_template=/templates/ccm-navigation/navigation/s com.arsdigita.navigation.templates_file=bundle/navigation/sci-templates.txt -# ccm-ldn-search application +# ccm-search application com.arsdigita.london.search.show_sponsored_links=true -# ccm-ldn-subsite application -com.arsdigita.london.subsite.root_category_picker=com.arsdigita.london.terms.ui.RootCategoryPicker +# ccm-subsite application +com.arsdigita.subsite.root_category_picker=com.arsdigita.london.terms.ui.RootCategoryPicker -# ccm-ldn-themedirector application +# ccm-themedirector application themedirector.default_theme_context= #themedirector.default_theme_manifest=ccm-jp-aplaws.web.mf themedirector.default_theme_path=themes/static/aplaws-generic @@ -117,8 +117,9 @@ themedirector.file_extensions=bmp css gif jpeg jpg js png xml xsl # ccm-sci-bundle (Loader only) -# com.arsdigita.bundle.category_files=bundle/categories/sci-nav-domain-1.00.xml,WEB-INF/sci/sci-nav-hierarchy-1.00.xml - +#com.arsdigita.bundle.loader.category_files=bundle/categories/sci-nav-domain-1.00.xml,bundle/categories/sci-nav-hierarchy-1.00.xml +#com.arsdigita.bundle.loader.custom_app_instances=com.arsdigita.navigation.Navigation:scimenu:ScientificCMS Navigation Menu,com.arsdigita.navigation.Navigation:libmenu:LibreCMS Navigation Menu +#com.arsdigita.bundle.loader.domain_mappings=STD-NAV:/navigation/,STD-NAV:/generic/,STD-NAV:/portal/ # ============================================================================================= # runtime specific configurations diff --git a/ccm-sci-bundle/bundles/local/jensp-dev/cfg/web-sci.xml b/ccm-sci-bundle/bundles/local/jensp-dev/cfg/web-sci.xml new file mode 100644 index 000000000..74f9d554a --- /dev/null +++ b/ccm-sci-bundle/bundles/local/jensp-dev/cfg/web-sci.xml @@ -0,0 +1,540 @@ + + + + Scientific CMS + Content and Collaboration Management for Scientific Institutions + + + + log4j-conf-file + WEB-INF/conf/log4j.properties + + + + + + + + shortcuts + com.arsdigita.london.shortcuts.ShortcutFilter + + + + subsite + com.arsdigita.subsite.SubsiteFilter + + + + + + subsite + /* + + + + shortcuts + /* + + + + + com.arsdigita.web.CCMApplicationContextListener + + + + + + reg + com.arsdigita.web.ContextRegistrationServlet + + uri + / + + 1 + + + + legacy-dispatcher + com.arsdigita.sitenode.SiteNodeDispatcher + 3 + + + + ccm-dispatcher + com.arsdigita.web.DispatcherServlet + + fallback-servlet + legacy-dispatcher + + 2 + + + + legacy-adapter + com.arsdigita.web.LegacyAdapterServlet + + + + cache-manager + com.arsdigita.caching.CacheServlet + + + + db-test + com.arsdigita.web.monitoring.DBTestServlet + + + + versioning-log + com.arsdigita.versioning.VersioningServlet + + + + oid-redirect + com.arsdigita.web.OIDRedirectServlet + + + + resource-resolver + com.arsdigita.web.ResourceServlet + + + + + + content-section + com.arsdigita.cms.ContentSectionServlet + + + + content-type-xsl + com.arsdigita.cms.dispatcher.ContentTypeXSLServlet + + + + content-item-xsl + com.arsdigita.cms.dispatcher.ContentItemXSLServlet + + + + template-xsl + com.arsdigita.cms.dispatcher.TemplateXSLServlet + + + + TextOnlyServlet + Text Only Servlet + + com.arsdigita.web.InternalPrefixerServlet + + + prefix + /text + + + + + PrintFriendlyServlet + Printer Friendly Output Servlet + + com.arsdigita.web.InternalPrefixerServlet + + + prefix + /print + + + + + + + + + forum-main + com.arsdigita.forum.ForumServlet + + + + + portalworkspace-files + com.arsdigita.web.ApplicationFileServlet + + template-path + /templates/ccm-portalworkspace + + + + + navigation-files + com.arsdigita.web.ApplicationFileServlet + + template-path + /templates/ccm-navigation + + + file-resolver + com.arsdigita.navigation.NavigationFileResolver + + + + + portlet-type-xsl + com.arsdigita.dispatcher.PortletTypeXSLServlet + + + + + rssfeed-files + com.arsdigita.web.ApplicationFileServlet + + template-path + /templates/ccm-rssfeed + + + file-resolver + com.arsdigita.rssfeed.RSSFileResolver + + + + + + + worker + com.arsdigita.london.search.SearchWorkerServlet + 4 + + + + search-files + com.arsdigita.web.ApplicationFileServlet + + template-path + /templates/ccm-ldn-search + + + + + AxisServlet + Apache-Axis Servlet + + org.apache.axis.transport.http.AxisServlet + + + + + + + shortcuts-files + com.arsdigita.web.ApplicationFileServlet + + template-path + /templates/ccm-ldn-shortcuts + + + + + + subsite-files + com.arsdigita.web.ApplicationFileServlet + + template-path + /templates/ccm-subsite + + + + + + + terms-files + com.arsdigita.web.ApplicationFileServlet + + template-path + /templates/ccm-ldn-terms + + + + + + + theme-files + com.arsdigita.web.ApplicationFileServlet + + template-path + /templates/ccm-themedirector + + + + + ThemeDownload + com.arsdigita.themedirector.dispatcher.ThemeDownloadServlet + + + + ThemePreviewServlet + Servlet to allow admins to preview look/feel + + com.arsdigita.themedirector.dispatcher.InternalThemePrefixerServlet + + + prefix + /theme + + + + + + + + + + forum-main + /forum-main/main/* + + + + + portlet-type-xsl + /themes/servlet/portlet-type/* + + + + portalworkspace-files + /ccm-portalworkspace/files/* + + + + navigation-files + /ccm-navigation/files/* + + + + + rssfeed-files + /ccm-rssfeed/files/* + + + + + + search-files + /ccm-ldn-search/files/* + + + + AxisServlet + /services/* + + + + + + shortcuts-files + /ccm-ldn-shortcuts/files/* + + + + + subsite-files + /ccm-subsite/files/* + + + + + + terms-files + /ccm-ldn-terms/files/* + + + + + + theme-files + /theme-files/* + + + + ThemeDownload + /theme-files/download/* + + + + ThemePreviewServlet + /theme/* + + + + + + + + reg + /themes/null/reg/* + + + + ccm-dispatcher + /ccm/* + + + + legacy-adapter + /templates/servlet/legacy-adapter/* + + + + cache-manager + /expireCache/* + + + + db-test + /dbtest + + + + versioning-log + /versioning/* + + + + oid-redirect + /redirect/* + + + + resource-resolver + /resource/* + + + + + + content-section + /themes/servlet/content-section/* + + + + content-item-xsl + /templates/servlet/content-item/* + + + + content-type-xsl + /themes/servlet/content-type/* + + + + template-xsl + /themes/servlet/template/* + + + + TextOnlyServlet + /text/* + + + + PrintFriendlyServlet + /print/* + + + + + + com.arsdigita.dispatcher.AccessDeniedException + /error/access-denied.jsp + + + + com.arsdigita.dispatcher.ObjectNotFoundException + /error/object-not-found.jsp + + + + com.arsdigita.kernel.permissions.PermissionException + /error/permission-denied.jsp + + + + com.arsdigita.persistence.DbNotAvailableException + /error/db-not-available.jsp + + + + com.arsdigita.db.DbNotAvailableException + /error/db-not-available.jsp + + + + java.lang.Exception + /error/general.jsp + + + + java.lang.Error + /error/general.jsp + + + + + + /WEB-INF/bebop-show.tld + /WEB-INF/bebop-show.tld + + + + /WEB-INF/bebop-define.tld + /WEB-INF/bebop-define.tld + + + diff --git a/ccm-sci-bundle/src/com/arsdigita/bundle/Loader.java b/ccm-sci-bundle/src/com/arsdigita/bundle/Loader.java index 6cc38e89e..278fe470d 100644 --- a/ccm-sci-bundle/src/com/arsdigita/bundle/Loader.java +++ b/ccm-sci-bundle/src/com/arsdigita/bundle/Loader.java @@ -49,6 +49,10 @@ import java.util.StringTokenizer; * * Creates category domains in the terms application according to * configuration files and adds jsp templates to navigation. + * + * NOTE: Configuration parameters used at load time MUST be part of Loader + * class and can not delegated to a Config object (derived from AbstractConfig). + * They will (and can) not be persisted into an registry object (file). * * @author Justin Ross <jross@redhat.com> * @author Peter Boy <pboy@barkhof.uni-bremen.de> @@ -70,9 +74,11 @@ public class Loader extends PackageLoader { * FULL_QUALIFIED_CLASS_NAME : URL : TITLE , * .... , * FULL_QUALIFIED_CLASS_NAME : URL : TITLE " + * E.G. + * "com.arsdigita.navigation.Navigation:local:Local Navigation" */ private Parameter m_customApplicationInstances = new StringArrayParameter( - "com.arsdigita.bundle.loader.local_app_instances", + "com.arsdigita.bundle.loader.custom_app_instances", Parameter.OPTIONAL, null ); diff --git a/ccm-sci-bundle/web/packages/content-section/www/admin/auto-cat.jsp b/ccm-sci-bundle/web/templates/ccm-cms/content-section/admin/auto-cat.jsp similarity index 100% rename from ccm-sci-bundle/web/packages/content-section/www/admin/auto-cat.jsp rename to ccm-sci-bundle/web/templates/ccm-cms/content-section/admin/auto-cat.jsp diff --git a/ccm-sci-bundle/web/packages/content-section/www/admin/load-cat.jsp b/ccm-sci-bundle/web/templates/ccm-cms/content-section/admin/load-cat.jsp similarity index 100% rename from ccm-sci-bundle/web/packages/content-section/www/admin/load-cat.jsp rename to ccm-sci-bundle/web/templates/ccm-cms/content-section/admin/load-cat.jsp diff --git a/ccm-sci-bundle/web/packages/content-section/www/crash-me.jsp b/ccm-sci-bundle/web/templates/ccm-cms/content-section/crash-me.jsp similarity index 100% rename from ccm-sci-bundle/web/packages/content-section/www/crash-me.jsp rename to ccm-sci-bundle/web/templates/ccm-cms/content-section/crash-me.jsp diff --git a/ccm-sci-bundle/web/templates/ccm-cms/content-section/person4homepages.jsp b/ccm-sci-bundle/web/templates/ccm-cms/content-section/person4homepages.jsp new file mode 100644 index 000000000..d5de9a0dc --- /dev/null +++ b/ccm-sci-bundle/web/templates/ccm-cms/content-section/person4homepages.jsp @@ -0,0 +1,49 @@ + + + + + + + + + + long age = Navigation.getConfig().getIndexPageCacheLifetime(); + if (age == 0) { + DispatcherHelper.cacheDisable(response); + } else { + DispatcherHelper.cacheForWorld(response, (int)age); + } + + + + + + + ((com.arsdigita.navigation.ui.object.ComplexObjectList) personList).setDefinition(new CMSDataCollectionDefinition()); + ((com.arsdigita.navigation.ui.object.ComplexObjectList) personList).setRenderer(new CMSDataCollectionRenderer()); + ((com.arsdigita.navigation.ui.object.ComplexObjectList) personList).getDefinition().setObjectType("com.arsdigita.cms.contenttypes.GenericPerson"); + ((com.arsdigita.navigation.ui.object.ComplexObjectList) personList).getRenderer().setSpecializeObjects(true); + ((com.arsdigita.navigation.ui.object.ComplexObjectList) personList).getDefinition().setDescendCategories(true); + ((com.arsdigita.navigation.ui.object.ComplexObjectList) personList).getDefinition().setExcludeIndexObjects(false); + ((com.arsdigita.navigation.ui.object.ComplexObjectList) personList).getDefinition().setFilterCategory(false); + ((com.arsdigita.navigation.ui.object.ComplexObjectList) personList).getRenderer().setPageSize(99999); + if((request.getParameterMap().get("DaBInId") != null) && (((String[])request.getParameterMap().get("DaBInId")).length > 0)) { + String[] params = (String[]) request.getParameterMap().get("DaBInId"); + String dabinid = params[0]; + ((com.arsdigita.navigation.ui.object.ComplexObjectList) personList).setSQLFilter(String.format("pageDescription LIKE '%%DaBInId={%s}%%'", dabinid)); + } + + + + + + + \ No newline at end of file diff --git a/ccm-sci-bundle/web/templates/ccm-cms/content-section/projects4homepages.jsp b/ccm-sci-bundle/web/templates/ccm-cms/content-section/projects4homepages.jsp new file mode 100644 index 000000000..9dae2663c --- /dev/null +++ b/ccm-sci-bundle/web/templates/ccm-cms/content-section/projects4homepages.jsp @@ -0,0 +1,52 @@ + + + + + + + + + + long age = Navigation.getConfig().getIndexPageCacheLifetime(); + if (age == 0) { + DispatcherHelper.cacheDisable(response); + } else { + DispatcherHelper.cacheForWorld(response, (int)age); + } + + + + + + + ((com.arsdigita.navigation.ui.object.ComplexObjectList) projectList).setDefinition(new CMSDataCollectionDefinition()); + ((com.arsdigita.navigation.ui.object.ComplexObjectList) projectList).setRenderer(new CMSDataCollectionRenderer()); + ((com.arsdigita.navigation.ui.object.ComplexObjectList) projectList).getDefinition().setObjectType("com.arsdigita.cms.contenttypes.SciProject"); + ((com.arsdigita.navigation.ui.object.ComplexObjectList) projectList).getRenderer().setSpecializeObjects(true); + ((com.arsdigita.navigation.ui.object.ComplexObjectList) projectList).getDefinition().setDescendCategories(true); + ((com.arsdigita.navigation.ui.object.ComplexObjectList) projectList).getDefinition().setExcludeIndexObjects(false); + ((com.arsdigita.navigation.ui.object.ComplexObjectList) projectList).getDefinition().setFilterCategory(false); + ((com.arsdigita.navigation.ui.object.ComplexObjectList) projectList).getDefinition().setAddOrder("title"); + ((com.arsdigita.navigation.ui.object.ComplexObjectList) projectList).getRenderer().setSpecializeObjectsContext("sciProjectList"); + if((request.getParameterMap().get("DaBInId") != null) && (((String[])request.getParameterMap().get("DaBInId")).length > 0)) { + String[] params = (String[]) request.getParameterMap().get("DaBInId"); + String dabinid = params[0]; + ((com.arsdigita.navigation.ui.object.ComplexObjectList) projectList).setSQLFilter(String.format("persons.pageDescription LIKE '%%DaBInId={%s}%%'", dabinid)); + + } + + ((com.arsdigita.navigation.ui.object.ComplexObjectList) projectList).getRenderer().setPageSize(99999); + + + + + + diff --git a/ccm-sci-bundle/web/templates/ccm-cms/content-section/publications4homepages.jsp b/ccm-sci-bundle/web/templates/ccm-cms/content-section/publications4homepages.jsp new file mode 100644 index 000000000..cf3a400e4 --- /dev/null +++ b/ccm-sci-bundle/web/templates/ccm-cms/content-section/publications4homepages.jsp @@ -0,0 +1,51 @@ + + + + + + + + + + long age = Navigation.getConfig().getIndexPageCacheLifetime(); + if (age == 0) { + DispatcherHelper.cacheDisable(response); + } else { + DispatcherHelper.cacheForWorld(response, (int)age); + } + + + + + + + ((com.arsdigita.navigation.ui.object.ComplexObjectList) publicationList).setDefinition(new CMSDataCollectionDefinition()); + ((com.arsdigita.navigation.ui.object.ComplexObjectList) publicationList).setRenderer(new CMSDataCollectionRenderer()); + ((com.arsdigita.navigation.ui.object.ComplexObjectList) publicationList).getDefinition().setObjectType("com.arsdigita.cms.contenttypes.Publication"); + ((com.arsdigita.navigation.ui.object.ComplexObjectList) publicationList).getRenderer().setSpecializeObjects(true); + ((com.arsdigita.navigation.ui.object.ComplexObjectList) publicationList).getDefinition().setDescendCategories(true); + ((com.arsdigita.navigation.ui.object.ComplexObjectList) publicationList).getDefinition().setExcludeIndexObjects(false); + ((com.arsdigita.navigation.ui.object.ComplexObjectList) publicationList).getDefinition().setFilterCategory(false); + ((com.arsdigita.navigation.ui.object.ComplexObjectList) publicationList).getDefinition().addOrder("yearOfPublication desc"); + if((request.getParameterMap().get("DaBInId") != null) && (((String[])request.getParameterMap().get("DaBInId")).length > 0)) { + String[] params = (String[]) request.getParameterMap().get("DaBInId"); + String dabinid = params[0]; + ((com.arsdigita.navigation.ui.object.ComplexObjectList) publicationList).setSQLFilter(String.format("authors.pageDescription LIKE '%%DaBInId={%s}%%'", dabinid)); + + } + + ((com.arsdigita.navigation.ui.object.ComplexObjectList) publicationList).getRenderer().setPageSize(99999); + + + + + + diff --git a/ccm-sci-bundle/web/packages/content-section/www/textonly.jsp b/ccm-sci-bundle/web/templates/ccm-cms/content-section/textonly.jsp similarity index 100% rename from ccm-sci-bundle/web/packages/content-section/www/textonly.jsp rename to ccm-sci-bundle/web/templates/ccm-cms/content-section/textonly.jsp diff --git a/ccm-sci-bundle/web/themes/static/aplaws-generic/content-section-admin.xsl b/ccm-sci-bundle/web/themes/static/aplaws-generic/content-section-content-admin.xsl similarity index 95% rename from ccm-sci-bundle/web/themes/static/aplaws-generic/content-section-admin.xsl rename to ccm-sci-bundle/web/themes/static/aplaws-generic/content-section-content-admin.xsl index 7fa9efb68..70dc7223f 100644 --- a/ccm-sci-bundle/web/themes/static/aplaws-generic/content-section-admin.xsl +++ b/ccm-sci-bundle/web/themes/static/aplaws-generic/content-section-content-admin.xsl @@ -7,7 +7,7 @@ exclude-result-prefixes="bebop cms ui aplaws xsl" version="1.0"> - + diff --git a/ccm-sci-bundle/web/themes/static/aplaws-generic/forum-index.xsl b/ccm-sci-bundle/web/themes/static/aplaws-generic/forum-index.xsl index 82314d163..cac13d5c8 100644 --- a/ccm-sci-bundle/web/themes/static/aplaws-generic/forum-index.xsl +++ b/ccm-sci-bundle/web/themes/static/aplaws-generic/forum-index.xsl @@ -10,9 +10,9 @@ version="1.0">