You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by cz...@apache.org on 2005/01/06 17:02:27 UTC
svn commit: r124397 - in cocoon/branches/BRANCH_2_1_X/src/blocks/portal: conf java/org/apache/cocoon/portal java/org/apache/cocoon/portal/impl java/org/apache/cocoon/portal/layout
Author: cziegeler
Date: Thu Jan 6 08:02:24 2005
New Revision: 124397
URL: http://svn.apache.org/viewcvs?view=rev&rev=124397
Log:
Add initial skin support
Added:
cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/layout/SkinDescription.java (contents, props changed)
Modified:
cocoon/branches/BRANCH_2_1_X/src/blocks/portal/conf/authportal.samplesxconf
cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/PortalService.java
cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/impl/PortalServiceImpl.java
Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/conf/authportal.samplesxconf
Url: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/conf/authportal.samplesxconf?view=diff&rev=124397&p1=cocoon/branches/BRANCH_2_1_X/src/blocks/portal/conf/authportal.samplesxconf&r1=124396&p2=cocoon/branches/BRANCH_2_1_X/src/blocks/portal/conf/authportal.samplesxconf&r2=124397
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/conf/authportal.samplesxconf (original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/conf/authportal.samplesxconf Thu Jan 6 08:02:24 2005
@@ -13,12 +13,25 @@
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
--->
+ CVS $Id: portlet.xml 30932 2004-07-29 17:35:38Z vgritsenko $
+-->
<samplesxconf xpath="/cocoon/*[@role='org.apache.cocoon.portal.PortalService']/portals" unless="portal[@name='portal']">
<portal name="portal">
+ <!-- This is the sample portal:
+ - we use the auth profile manager
+ -->
<profile-manager>org.apache.cocoon.portal.profile.ProfileManager/Auth</profile-manager>
+ <!-- These are the skins the user can choose from: -->
+ <skins>
+ <skin name="basic" base-path="context://samples/blocks/portal/skins/basic">
+ <thumbnail-path>images/thumbnail.jpg</thumbnail-path>
+ </skin>
+ <skin name="common" base-path="context://samples/blocks/portal/skins/common">
+ <thumbnail-path>images/thumbnail.jpg</thumbnail-path>
+ </skin>
+ </skins>
</portal>
</samplesxconf>
Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/PortalService.java
Url: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/PortalService.java?view=diff&rev=124397&p1=cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/PortalService.java&r1=124396&p2=cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/PortalService.java&r2=124397
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/PortalService.java (original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/PortalService.java Thu Jan 6 08:02:24 2005
@@ -16,7 +16,7 @@
package org.apache.cocoon.portal;
import java.util.Iterator;
-
+import java.util.List;
import org.apache.avalon.framework.component.Component;
import org.apache.cocoon.portal.layout.Layout;
@@ -111,4 +111,8 @@
*/
String getDefaultLayoutKey();
+ /**
+ * Return all skins
+ */
+ List getSkinDescriptions();
}
Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/impl/PortalServiceImpl.java
Url: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/impl/PortalServiceImpl.java?view=diff&rev=124397&p1=cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/impl/PortalServiceImpl.java&r1=124396&p2=cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/impl/PortalServiceImpl.java&r2=124397
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/impl/PortalServiceImpl.java (original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/impl/PortalServiceImpl.java Thu Jan 6 08:02:24 2005
@@ -15,8 +15,10 @@
*/
package org.apache.cocoon.portal.impl;
+import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
+import java.util.List;
import java.util.Map;
import org.apache.avalon.framework.activity.Disposable;
@@ -37,6 +39,7 @@
import org.apache.cocoon.portal.PortalComponentManager;
import org.apache.cocoon.portal.PortalService;
import org.apache.cocoon.portal.layout.Layout;
+import org.apache.cocoon.portal.layout.SkinDescription;
/**
* Default implementation of a portal service using a session to store
@@ -64,6 +67,8 @@
protected Map portalConfigurations = new HashMap();
+ protected Map skins = new HashMap();
+
final protected static String KEY = PortalServiceImpl.class.getName();
/* (non-Javadoc)
@@ -198,6 +203,22 @@
ContainerUtil.initialize( c );
this.portalConfigurations.put( name, current );
+
+ // scan for skins
+ final List skinList = new ArrayList();
+ this.skins.put(name, skinList);
+ final Configuration[] skinConfs = current.getChild("skin").getChildren("skins");
+ if ( skinConfs != null ) {
+ for(int s=0;s<skinConfs.length;s++) {
+ final Configuration currentSkin = skinConfs[s];
+ final String skinName = currentSkin.getAttribute("name");
+ final SkinDescription desc = new SkinDescription();
+ desc.setName(skinName);
+ desc.setBasePath(currentSkin.getAttribute("base-path"));
+ desc.setThumbnailPath(currentSkin.getChild("thumbnail-path").getValue(null));
+ skinList.add(desc);
+ }
+ }
} catch (Exception e) {
throw new ConfigurationException("Unable to setup new portal component manager for portal " + name, e);
}
@@ -255,4 +276,10 @@
return key;
}
+ /* (non-Javadoc)
+ * @see org.apache.cocoon.portal.PortalService#getSkinDescriptions()
+ */
+ public List getSkinDescriptions() {
+ return (List)this.skins.get(this.getPortalName());
+ }
}
Added: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/layout/SkinDescription.java
Url: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/layout/SkinDescription.java?view=auto&rev=124397
==============================================================================
--- (empty file)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/layout/SkinDescription.java Thu Jan 6 08:02:24 2005
@@ -0,0 +1,65 @@
+/*
+ * Copyright 1999-2002,2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.cocoon.portal.layout;
+
+/**
+*
+* @version CVS $Id: Parameters.java 30932 2004-07-29 17:35:38Z vgritsenko $
+*/
+public class SkinDescription {
+
+ protected String name;
+ protected String basePath;
+ protected String thumbnailPath;
+
+
+ /**
+ * @return Returns the basePath.
+ */
+ public String getBasePath() {
+ return basePath;
+ }
+ /**
+ * @param basePath The basePath to set.
+ */
+ public void setBasePath(String basePath) {
+ this.basePath = basePath;
+ }
+ /**
+ * @return Returns the name.
+ */
+ public String getName() {
+ return name;
+ }
+ /**
+ * @param name The name to set.
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+ /**
+ * @return Returns the thumbnailPath.
+ */
+ public String getThumbnailPath() {
+ return thumbnailPath;
+ }
+ /**
+ * @param thumbnailPath The thumbnailPath to set.
+ */
+ public void setThumbnailPath(String thumbnailPath) {
+ this.thumbnailPath = thumbnailPath;
+ }
+}
\ No newline at end of file
Re: svn commit: r124397 - skins
Posted by Ralph Goers <Ra...@dslextreme.com>.
Thanks, Carsten.
Yeah, I have some changes to xconf too and it is kind of a pain. However,
I like the 2.2 way better.
Ralph
Carsten Ziegeler said:
> The xconf was wrong :( (syncing between 2.1.x and 2.2 is now much harder
> because of different configuration files) But it's fixed now.
>
> Carsten
>
Re: svn commit: r124397 - skins
Posted by Carsten Ziegeler <cz...@apache.org>.
The xconf was wrong :( (syncing between 2.1.x and 2.2 is now much harder
because of different configuration files) But it's fixed now.
Carsten
Carsten Ziegeler wrote:
> Hmm, "common" should be correct. 2.2 doesn't work for me currently :(
> I will look into it asap.
>
> Carsten
>
> Ralph Goers wrote:
>
>> Carsten,
>>
>> The Portal in 2.2 still doesn't work. I get an error locating
>> row.xsl. I believe the global skin definition should be skins/common/.
>> However, when I change it to that I then get an error locating
>> /styles/portal-page.xsl. I'm not sure what is up with that.
>>
>> Ralph
>>
>> Ralph Goers wrote:
>>
>>> Carsten Ziegeler wrote:
>>>
>>>> Ralph Goers wrote:
>>>>
>>>>> Is this stuff working??? I built the latest and the portal looks
>>>>> horrible. Is something not configured?
>>>>>
>>>> Horrible? Or just different? :)
>>>> It's working, I just accidentally changed the default skin from
>>>> "common" to "basic". I just fixed this in SVN, so everything should
>>>> look nice again :)
>>>>
>>>> Carsten
>>>
>>>
>>>
>>>
>>> OK. Thanks. I never looked at basic before. I guess basic describes it.
>>>
>>> Ralph
>>>
>>
>>
>>
>
>
>
Re: svn commit: r124397 - skins
Posted by Ralph Goers <Ra...@dslextreme.com>.
OK. Well, I've got a pretty large change I'm getting ready to check in
and I would like to verify it in 2.2 before I do. I really don't like
checking in stuff I haven't tested.
Ralph
Carsten Ziegeler wrote:
> Hmm, "common" should be correct. 2.2 doesn't work for me currently :(
> I will look into it asap.
>
> Carsten
>
Re: svn commit: r124397 - skins
Posted by Carsten Ziegeler <cz...@apache.org>.
Hmm, "common" should be correct. 2.2 doesn't work for me currently :(
I will look into it asap.
Carsten
Ralph Goers wrote:
> Carsten,
>
> The Portal in 2.2 still doesn't work. I get an error locating row.xsl.
> I believe the global skin definition should be skins/common/. However,
> when I change it to that I then get an error locating
> /styles/portal-page.xsl. I'm not sure what is up with that.
>
> Ralph
>
> Ralph Goers wrote:
>
>> Carsten Ziegeler wrote:
>>
>>> Ralph Goers wrote:
>>>
>>>> Is this stuff working??? I built the latest and the portal looks
>>>> horrible. Is something not configured?
>>>>
>>> Horrible? Or just different? :)
>>> It's working, I just accidentally changed the default skin from
>>> "common" to "basic". I just fixed this in SVN, so everything should
>>> look nice again :)
>>>
>>> Carsten
>>
>>
>>
>> OK. Thanks. I never looked at basic before. I guess basic describes it.
>>
>> Ralph
>>
>
>
>
Re: svn commit: r124397 - skins
Posted by Ralph Goers <Ra...@dslextreme.com>.
Carsten,
The Portal in 2.2 still doesn't work. I get an error locating row.xsl.
I believe the global skin definition should be skins/common/. However,
when I change it to that I then get an error locating
/styles/portal-page.xsl. I'm not sure what is up with that.
Ralph
Ralph Goers wrote:
> Carsten Ziegeler wrote:
>
>> Ralph Goers wrote:
>>
>>> Is this stuff working??? I built the latest and the portal looks
>>> horrible. Is something not configured?
>>>
>> Horrible? Or just different? :)
>> It's working, I just accidentally changed the default skin from
>> "common" to "basic". I just fixed this in SVN, so everything should
>> look nice again :)
>>
>> Carsten
>
>
> OK. Thanks. I never looked at basic before. I guess basic describes it.
>
> Ralph
>
Re: svn commit: r124397 - skins
Posted by Ralph Goers <Ra...@dslextreme.com>.
Carsten Ziegeler wrote:
> Ralph Goers wrote:
>
>> Is this stuff working??? I built the latest and the portal looks
>> horrible. Is something not configured?
>>
> Horrible? Or just different? :)
> It's working, I just accidentally changed the default skin from
> "common" to "basic". I just fixed this in SVN, so everything should
> look nice again :)
>
> Carsten
OK. Thanks. I never looked at basic before. I guess basic describes it.
Ralph
Re: svn commit: r124397 - skins
Posted by Carsten Ziegeler <cz...@apache.org>.
Ralph Goers wrote:
> Is this stuff working??? I built the latest and the portal looks
> horrible. Is something not configured?
>
Horrible? Or just different? :)
It's working, I just accidentally changed the default skin from "common"
to "basic". I just fixed this in SVN, so everything should look nice
again :)
Carsten
Re: svn commit: r124397 - skins
Posted by Ralph Goers <Ra...@dslextreme.com>.
Is this stuff working??? I built the latest and the portal looks
horrible. Is something not configured?
Ralph
cziegeler@apache.org said:
> Author: cziegeler
> Date: Thu Jan 6 08:02:24 2005
> New Revision: 124397
>
> URL: http://svn.apache.org/viewcvs?view=rev&rev=124397
> Log:
> Add initial skin support
> Added:
> cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/layout/SkinDescription.java
> (contents, props changed)
> Modified:
> cocoon/branches/BRANCH_2_1_X/src/blocks/portal/conf/authportal.samplesxconf
> cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/PortalService.java
> cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/impl/PortalServiceImpl.java
>
> Modified:
> cocoon/branches/BRANCH_2_1_X/src/blocks/portal/conf/authportal.samplesxconf
> Url:
>