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/09/01 11:10:38 UTC
svn commit: r265679 [3/12] - in /cocoon/blocks/portal-sample/trunk: ./
WEB-INF/ WEB-INF/xconf/ conf/ java/ java/org/ java/org/apache/
java/org/apache/cocoon/ java/org/apache/cocoon/portal/
java/org/apache/cocoon/portal/coplets/ java/org/apache/cocoon/p...
Added: cocoon/blocks/portal-sample/trunk/java/org/apache/cocoon/portal/coplets/basket/UserConfiguration.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal-sample/trunk/java/org/apache/cocoon/portal/coplets/basket/UserConfiguration.java?rev=265679&view=auto
==============================================================================
--- cocoon/blocks/portal-sample/trunk/java/org/apache/cocoon/portal/coplets/basket/UserConfiguration.java (added)
+++ cocoon/blocks/portal-sample/trunk/java/org/apache/cocoon/portal/coplets/basket/UserConfiguration.java Thu Sep 1 02:08:10 2005
@@ -0,0 +1,84 @@
+/*
+ * Copyright 2004-2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.cocoon.portal.coplets.basket;
+
+import java.util.Map;
+
+import org.apache.cocoon.environment.ObjectModelHelper;
+import org.apache.cocoon.environment.Request;
+import org.apache.cocoon.environment.Session;
+import org.apache.cocoon.portal.PortalService;
+import org.apache.cocoon.portal.coplet.CopletInstanceData;
+import org.apache.cocoon.portal.profile.ProfileManager;
+
+/**
+ * This data object holds the configuration of a user for the basket
+ *
+ * @version CVS $Id$
+ */
+public class UserConfiguration {
+
+ /** The attribute name used to store this configuration in the session */
+ public static final String ATTR_NAME = "basket-config";
+
+ protected boolean basketEnabled = true;
+ protected boolean briefcaseEnabled = false;
+ protected boolean folderEnabled = false;
+
+ /**
+ * Get/create the user configuration
+ */
+ public static UserConfiguration get(Map objectModel,
+ PortalService service) {
+ final Request req = ObjectModelHelper.getRequest(objectModel);
+ final Session session = req.getSession();
+ UserConfiguration uc = (UserConfiguration)session.getAttribute(ATTR_NAME);
+ if ( uc == null ) {
+ final ProfileManager pm = service.getComponentManager().getProfileManager();
+ final CopletInstanceData cid = pm.getCopletInstanceData("basket");
+ if ( cid != null ) {
+ uc = new UserConfiguration(cid.getAttributes());
+ session.setAttribute(ATTR_NAME, uc);
+ }
+ }
+ return uc;
+ }
+
+ /**
+ * Constructor
+ * Read the configuration from the map
+ */
+ public UserConfiguration(Map attributes) {
+ final String enabledKinds = (String)attributes.get("basket:enabled-storages");
+ if ( enabledKinds != null ) {
+ this.basketEnabled = (enabledKinds.indexOf("basket") != -1);
+ this.briefcaseEnabled = (enabledKinds.indexOf("briefcase") != -1);
+ this.folderEnabled = (enabledKinds.indexOf("folder") != -1);
+ }
+ }
+
+ public boolean isBasketEnabled() {
+ return this.basketEnabled;
+ }
+
+ public boolean isBriefcaseEnabled() {
+ return this.briefcaseEnabled;
+ }
+
+ public boolean isFolderEnabled() {
+ return this.folderEnabled;
+ }
+}
Propchange: cocoon/blocks/portal-sample/trunk/java/org/apache/cocoon/portal/coplets/basket/UserConfiguration.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cocoon/blocks/portal-sample/trunk/java/org/apache/cocoon/portal/coplets/basket/UserConfiguration.java
------------------------------------------------------------------------------
svn:keywords = Id
Added: cocoon/blocks/portal-sample/trunk/java/org/apache/cocoon/portal/coplets/basket/events/AddItemEvent.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal-sample/trunk/java/org/apache/cocoon/portal/coplets/basket/events/AddItemEvent.java?rev=265679&view=auto
==============================================================================
--- cocoon/blocks/portal-sample/trunk/java/org/apache/cocoon/portal/coplets/basket/events/AddItemEvent.java (added)
+++ cocoon/blocks/portal-sample/trunk/java/org/apache/cocoon/portal/coplets/basket/events/AddItemEvent.java Thu Sep 1 02:08:10 2005
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2004-2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.cocoon.portal.coplets.basket.events;
+
+import org.apache.cocoon.portal.coplets.basket.ContentStore;
+
+/**
+ * This event is used to add an item to the content store
+ *
+ * @version CVS $Id$
+ */
+public class AddItemEvent extends ContentStoreEvent {
+
+ /** The item to add */
+ protected Object item;
+
+ /**
+ * Constructor
+ * @param store The content store
+ * @param item The item that will be added to the content store
+ */
+ public AddItemEvent(ContentStore store, Object item) {
+ super(store);
+ this.item = item;
+ }
+
+ /**
+ * The item
+ */
+ public Object getItem() {
+ return this.item;
+ }
+}
Propchange: cocoon/blocks/portal-sample/trunk/java/org/apache/cocoon/portal/coplets/basket/events/AddItemEvent.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cocoon/blocks/portal-sample/trunk/java/org/apache/cocoon/portal/coplets/basket/events/AddItemEvent.java
------------------------------------------------------------------------------
svn:keywords = Id
Added: cocoon/blocks/portal-sample/trunk/java/org/apache/cocoon/portal/coplets/basket/events/CleanBriefcaseEvent.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal-sample/trunk/java/org/apache/cocoon/portal/coplets/basket/events/CleanBriefcaseEvent.java?rev=265679&view=auto
==============================================================================
--- cocoon/blocks/portal-sample/trunk/java/org/apache/cocoon/portal/coplets/basket/events/CleanBriefcaseEvent.java (added)
+++ cocoon/blocks/portal-sample/trunk/java/org/apache/cocoon/portal/coplets/basket/events/CleanBriefcaseEvent.java Thu Sep 1 02:08:10 2005
@@ -0,0 +1,44 @@
+/*
+ * Copyright 2004-2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.cocoon.portal.coplets.basket.events;
+
+import org.apache.cocoon.portal.coplets.basket.Briefcase;
+
+/**
+ * Clean all briefcases or a single one
+ *
+ * @version CVS $Id$
+ */
+public class CleanBriefcaseEvent extends ContentStoreEvent {
+
+ /**
+ * Constructor
+ * If this constructor is used all baskets will be cleaned
+ */
+ public CleanBriefcaseEvent() {
+ // nothing to do here
+ }
+
+ /**
+ * Constructor
+ * One briefcase will be cleaned
+ * @param briefcaseId The briefcase
+ */
+ public CleanBriefcaseEvent(Briefcase briefcase) {
+ super(briefcase);
+ }
+
+}
Propchange: cocoon/blocks/portal-sample/trunk/java/org/apache/cocoon/portal/coplets/basket/events/CleanBriefcaseEvent.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cocoon/blocks/portal-sample/trunk/java/org/apache/cocoon/portal/coplets/basket/events/CleanBriefcaseEvent.java
------------------------------------------------------------------------------
svn:keywords = Id
Added: cocoon/blocks/portal-sample/trunk/java/org/apache/cocoon/portal/coplets/basket/events/ContentStoreEvent.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal-sample/trunk/java/org/apache/cocoon/portal/coplets/basket/events/ContentStoreEvent.java?rev=265679&view=auto
==============================================================================
--- cocoon/blocks/portal-sample/trunk/java/org/apache/cocoon/portal/coplets/basket/events/ContentStoreEvent.java (added)
+++ cocoon/blocks/portal-sample/trunk/java/org/apache/cocoon/portal/coplets/basket/events/ContentStoreEvent.java Thu Sep 1 02:08:10 2005
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2004-2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.cocoon.portal.coplets.basket.events;
+
+import org.apache.cocoon.portal.coplets.basket.ContentStore;
+import org.apache.cocoon.portal.event.Event;
+
+/**
+ * This is the base class for all content store events
+ *
+ * @version CVS $Id$
+ */
+public abstract class ContentStoreEvent implements Event {
+
+ protected final ContentStore store;
+
+ /**
+ * this is a general event for a set of content stores
+ */
+ public ContentStoreEvent() {
+ this.store = null;
+ }
+
+ /**
+ * This event is for a defined content store
+ */
+ public ContentStoreEvent(ContentStore store) {
+ this.store = store;
+ }
+
+ public ContentStore getContentStore() {
+ return this.store;
+ }
+}
Propchange: cocoon/blocks/portal-sample/trunk/java/org/apache/cocoon/portal/coplets/basket/events/ContentStoreEvent.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cocoon/blocks/portal-sample/trunk/java/org/apache/cocoon/portal/coplets/basket/events/ContentStoreEvent.java
------------------------------------------------------------------------------
svn:keywords = Id
Added: cocoon/blocks/portal-sample/trunk/java/org/apache/cocoon/portal/coplets/basket/events/MoveItemEvent.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal-sample/trunk/java/org/apache/cocoon/portal/coplets/basket/events/MoveItemEvent.java?rev=265679&view=auto
==============================================================================
--- cocoon/blocks/portal-sample/trunk/java/org/apache/cocoon/portal/coplets/basket/events/MoveItemEvent.java (added)
+++ cocoon/blocks/portal-sample/trunk/java/org/apache/cocoon/portal/coplets/basket/events/MoveItemEvent.java Thu Sep 1 02:08:10 2005
@@ -0,0 +1,58 @@
+/*
+ * Copyright 2004-2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.cocoon.portal.coplets.basket.events;
+
+import org.apache.cocoon.portal.coplets.basket.ContentStore;
+
+/**
+ * Move an item from one store to another
+ *
+ * @version CVS $Id$
+ */
+public class MoveItemEvent extends ContentStoreEvent {
+
+ /** The item to move */
+ protected Object item;
+
+ /** The target store */
+ protected final ContentStore target;
+
+ /**
+ * Constructor
+ * @param store The content store
+ * @param item The item to move
+ * @param target The target store
+ */
+ public MoveItemEvent(ContentStore store, Object item, ContentStore target) {
+ super(store);
+ this.item = item;
+ this.target = target;
+ }
+
+ /**
+ * Return the item to remove
+ */
+ public Object getItem() {
+ return this.item;
+ }
+
+ /**
+ * Return the target
+ */
+ public ContentStore getTarget() {
+ return this.target;
+ }
+}
Propchange: cocoon/blocks/portal-sample/trunk/java/org/apache/cocoon/portal/coplets/basket/events/MoveItemEvent.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cocoon/blocks/portal-sample/trunk/java/org/apache/cocoon/portal/coplets/basket/events/MoveItemEvent.java
------------------------------------------------------------------------------
svn:keywords = Id
Added: cocoon/blocks/portal-sample/trunk/java/org/apache/cocoon/portal/coplets/basket/events/RefreshBasketEvent.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal-sample/trunk/java/org/apache/cocoon/portal/coplets/basket/events/RefreshBasketEvent.java?rev=265679&view=auto
==============================================================================
--- cocoon/blocks/portal-sample/trunk/java/org/apache/cocoon/portal/coplets/basket/events/RefreshBasketEvent.java (added)
+++ cocoon/blocks/portal-sample/trunk/java/org/apache/cocoon/portal/coplets/basket/events/RefreshBasketEvent.java Thu Sep 1 02:08:10 2005
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2004-2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.cocoon.portal.coplets.basket.events;
+
+
+
+/**
+ * Refresh the list of baskets for the administration
+ *
+ * @version CVS $Id$
+ */
+public class RefreshBasketEvent extends ContentStoreEvent {
+
+ /**
+ * Constructor
+ */
+ public RefreshBasketEvent() {
+ // nothing to do here
+ }
+
+}
Propchange: cocoon/blocks/portal-sample/trunk/java/org/apache/cocoon/portal/coplets/basket/events/RefreshBasketEvent.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cocoon/blocks/portal-sample/trunk/java/org/apache/cocoon/portal/coplets/basket/events/RefreshBasketEvent.java
------------------------------------------------------------------------------
svn:keywords = Id
Added: cocoon/blocks/portal-sample/trunk/java/org/apache/cocoon/portal/coplets/basket/events/RemoveItemEvent.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal-sample/trunk/java/org/apache/cocoon/portal/coplets/basket/events/RemoveItemEvent.java?rev=265679&view=auto
==============================================================================
--- cocoon/blocks/portal-sample/trunk/java/org/apache/cocoon/portal/coplets/basket/events/RemoveItemEvent.java (added)
+++ cocoon/blocks/portal-sample/trunk/java/org/apache/cocoon/portal/coplets/basket/events/RemoveItemEvent.java Thu Sep 1 02:08:10 2005
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2004-2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.cocoon.portal.coplets.basket.events;
+
+import org.apache.cocoon.portal.coplets.basket.ContentStore;
+
+/**
+ * Remove an item from the content store
+ *
+ * @version CVS $Id$
+ */
+public class RemoveItemEvent extends ContentStoreEvent {
+
+ /** The item to remove */
+ protected Object item;
+
+ /**
+ * Constructor
+ * @param store The icontent store
+ * @param item The item to remove
+ */
+ public RemoveItemEvent(ContentStore store, Object item) {
+ super(store);
+ this.item = item;
+ }
+
+ /**
+ * Return the item to remove
+ */
+ public Object getItem() {
+ return this.item;
+ }
+}
Propchange: cocoon/blocks/portal-sample/trunk/java/org/apache/cocoon/portal/coplets/basket/events/RemoveItemEvent.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cocoon/blocks/portal-sample/trunk/java/org/apache/cocoon/portal/coplets/basket/events/RemoveItemEvent.java
------------------------------------------------------------------------------
svn:keywords = Id
Added: cocoon/blocks/portal-sample/trunk/java/org/apache/cocoon/portal/coplets/basket/events/ShowBasketEvent.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal-sample/trunk/java/org/apache/cocoon/portal/coplets/basket/events/ShowBasketEvent.java?rev=265679&view=auto
==============================================================================
--- cocoon/blocks/portal-sample/trunk/java/org/apache/cocoon/portal/coplets/basket/events/ShowBasketEvent.java (added)
+++ cocoon/blocks/portal-sample/trunk/java/org/apache/cocoon/portal/coplets/basket/events/ShowBasketEvent.java Thu Sep 1 02:08:10 2005
@@ -0,0 +1,44 @@
+/*
+ * Copyright 2004-2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.cocoon.portal.coplets.basket.events;
+
+
+
+/**
+ * Show the contents of one basket
+ *
+ * @version CVS $Id$
+ */
+public class ShowBasketEvent extends ContentStoreEvent {
+
+ /** The basket to show */
+ protected String basketId;
+
+ /**
+ * Constructor
+ * @param basketId The id of the basket
+ */
+ public ShowBasketEvent(String basketId) {
+ this.basketId = basketId;
+ }
+
+ /**
+ * Return the basket id
+ */
+ public String getBasketId() {
+ return this.basketId;
+ }
+}
Propchange: cocoon/blocks/portal-sample/trunk/java/org/apache/cocoon/portal/coplets/basket/events/ShowBasketEvent.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cocoon/blocks/portal-sample/trunk/java/org/apache/cocoon/portal/coplets/basket/events/ShowBasketEvent.java
------------------------------------------------------------------------------
svn:keywords = Id
Added: cocoon/blocks/portal-sample/trunk/java/org/apache/cocoon/portal/coplets/basket/events/ShowItemEvent.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal-sample/trunk/java/org/apache/cocoon/portal/coplets/basket/events/ShowItemEvent.java?rev=265679&view=auto
==============================================================================
--- cocoon/blocks/portal-sample/trunk/java/org/apache/cocoon/portal/coplets/basket/events/ShowItemEvent.java (added)
+++ cocoon/blocks/portal-sample/trunk/java/org/apache/cocoon/portal/coplets/basket/events/ShowItemEvent.java Thu Sep 1 02:08:10 2005
@@ -0,0 +1,71 @@
+/*
+ * Copyright 2004-2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.cocoon.portal.coplets.basket.events;
+
+import org.apache.cocoon.portal.coplets.basket.ContentStore;
+import org.apache.cocoon.portal.layout.Layout;
+
+/**
+ * Show one item of a content store
+ *
+ * @version CVS $Id$
+ */
+public class ShowItemEvent extends ContentStoreEvent {
+
+ /** The item to show */
+ protected final Object item;
+
+ /** The layout object to use */
+ protected final Layout layout;
+
+ /** The id of the coplet data used to display the content */
+ protected final String copletData;
+
+ /**
+ * Constructor
+ * @param store The content store
+ * @param item The item to show
+ * @param layout The layout object where the item is displayed
+ * @param copletData The coplet data id of a content coplet
+ */
+ public ShowItemEvent(ContentStore store, Object item, Layout layout, String copletData) {
+ super(store);
+ this.item = item;
+ this.layout = layout;
+ this.copletData = copletData;
+ }
+
+ /**
+ * Return item
+ */
+ public Object getItem() {
+ return this.item;
+ }
+
+ /**
+ * Return the layout
+ */
+ public Layout getLayout() {
+ return this.layout;
+ }
+
+ /**
+ * Return the coplet data id
+ */
+ public String getCopletDataId() {
+ return this.copletData;
+ }
+}
Propchange: cocoon/blocks/portal-sample/trunk/java/org/apache/cocoon/portal/coplets/basket/events/ShowItemEvent.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cocoon/blocks/portal-sample/trunk/java/org/apache/cocoon/portal/coplets/basket/events/ShowItemEvent.java
------------------------------------------------------------------------------
svn:keywords = Id
Added: cocoon/blocks/portal-sample/trunk/java/org/apache/cocoon/portal/coplets/basket/events/UploadItemEvent.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal-sample/trunk/java/org/apache/cocoon/portal/coplets/basket/events/UploadItemEvent.java?rev=265679&view=auto
==============================================================================
--- cocoon/blocks/portal-sample/trunk/java/org/apache/cocoon/portal/coplets/basket/events/UploadItemEvent.java (added)
+++ cocoon/blocks/portal-sample/trunk/java/org/apache/cocoon/portal/coplets/basket/events/UploadItemEvent.java Thu Sep 1 02:08:10 2005
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2004-2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.cocoon.portal.coplets.basket.events;
+
+import java.util.List;
+
+import org.apache.cocoon.portal.coplets.basket.ContentStore;
+
+/**
+ * This event adds uploaded files to the content store
+ *
+ * @version CVS $Id$
+ */
+public class UploadItemEvent extends ContentStoreEvent {
+
+ /** List of parameter names containing uploaded files */
+ protected final List itemNames;
+
+ /**
+ * Constructor
+ * @param itemNames List of parameter names with uploaded files
+ */
+ public UploadItemEvent(ContentStore store, List itemNames) {
+ super(store);
+ this.itemNames = itemNames;
+ }
+
+ /**
+ * Return the list of parameter names
+ */
+ public List getItemNames() {
+ return this.itemNames;
+ }
+}
Propchange: cocoon/blocks/portal-sample/trunk/java/org/apache/cocoon/portal/coplets/basket/events/UploadItemEvent.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cocoon/blocks/portal-sample/trunk/java/org/apache/cocoon/portal/coplets/basket/events/UploadItemEvent.java
------------------------------------------------------------------------------
svn:keywords = Id
Added: cocoon/blocks/portal-sample/trunk/java/org/apache/cocoon/portal/security/DBSecurityHandler.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal-sample/trunk/java/org/apache/cocoon/portal/security/DBSecurityHandler.java?rev=265679&view=auto
==============================================================================
--- cocoon/blocks/portal-sample/trunk/java/org/apache/cocoon/portal/security/DBSecurityHandler.java (added)
+++ cocoon/blocks/portal-sample/trunk/java/org/apache/cocoon/portal/security/DBSecurityHandler.java Thu Sep 1 02:08:10 2005
@@ -0,0 +1,77 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.cocoon.portal.security;
+
+import java.util.Collection;
+import java.util.Map;
+
+import org.apache.avalon.framework.parameters.Parameters;
+import org.apache.cocoon.ojb.samples.bean.User;
+import org.apache.ojb.broker.PersistenceBroker;
+import org.apache.ojb.broker.PersistenceBrokerFactory;
+import org.apache.ojb.broker.query.Criteria;
+import org.apache.ojb.broker.query.Query;
+import org.apache.ojb.broker.query.QueryByCriteria;
+import org.osoco.cowarp.AbstractSecurityHandler;
+import org.osoco.cowarp.ApplicationManager;
+
+/**
+ * @version $Id$
+ */
+public class DBSecurityHandler
+ extends AbstractSecurityHandler {
+
+ /**
+ * @see org.osoco.cowarp.SecurityHandler#login(Map)
+ */
+ public org.osoco.cowarp.User login(Map loginContext) throws Exception {
+ PersistenceBroker broker = PersistenceBrokerFactory.defaultPersistenceBroker();
+
+ try {
+ Parameters para = (Parameters) loginContext.get(ApplicationManager.LOGIN_CONTEXT_PARAMETERS_KEY);
+
+ final Criteria criteria = new Criteria();
+ criteria.addEqualTo("username", para.getParameter("name"));
+ criteria.addEqualTo("password", para.getParameter("password"));
+ final Query query = new QueryByCriteria(User.class, criteria);
+ final Collection c = broker.getCollectionByQuery(query);
+
+ if ( c.size() == 1 ) {
+ User u = (User)c.iterator().next();
+ PortalUser pUser = new PortalUser(u.getUsername());
+ pUser.setUid(u.getUid());
+ pUser.setFirstname(u.getFirstname());
+ pUser.setLastname(u.getLastname());
+ pUser.setPassword(u.getPassword());
+ pUser.setRole(u.getRole());
+ if ( this.getLogger().isInfoEnabled() ) {
+ this.getLogger().info("Loggedin as: " + u.getFirstname() + " " + u.getLastname() + " (" + u.getUsername() + " " + u.getRole() +")");
+ }
+ return pUser;
+ }
+ } finally {
+ broker.close();
+ }
+ return null;
+ }
+
+ /**
+ * @see org.osoco.cowarp.SecurityHandler#logout(Map, org.osoco.cowarp.User)
+ */
+ public void logout(Map context, org.osoco.cowarp.User user) {
+ // nothing to do
+ }
+}
Propchange: cocoon/blocks/portal-sample/trunk/java/org/apache/cocoon/portal/security/DBSecurityHandler.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cocoon/blocks/portal-sample/trunk/java/org/apache/cocoon/portal/security/DBSecurityHandler.java
------------------------------------------------------------------------------
svn:keywords = Id
Added: cocoon/blocks/portal-sample/trunk/java/org/apache/cocoon/portal/security/PortalUser.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal-sample/trunk/java/org/apache/cocoon/portal/security/PortalUser.java?rev=265679&view=auto
==============================================================================
--- cocoon/blocks/portal-sample/trunk/java/org/apache/cocoon/portal/security/PortalUser.java (added)
+++ cocoon/blocks/portal-sample/trunk/java/org/apache/cocoon/portal/security/PortalUser.java Thu Sep 1 02:08:10 2005
@@ -0,0 +1,86 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.cocoon.portal.security;
+
+import java.util.ArrayList;
+
+import org.osoco.cowarp.StandardUser;
+
+/**
+ * @version $Id$
+ */
+public class PortalUser extends StandardUser {
+
+ private int uid;
+ private String lastname;
+ private String firstname;
+ private String password;
+
+ public PortalUser(String uid) {
+ super(uid);
+ this.roles = new ArrayList();
+ }
+
+ public String getFirstname() {
+ return firstname;
+ }
+
+ public void setFirstname(String firstname) {
+ this.firstname = firstname;
+ }
+
+ public String getLastname() {
+ return lastname;
+ }
+
+ public void setLastname(String lastname) {
+ this.lastname = lastname;
+ }
+
+ public String getPassword() {
+ return password;
+ }
+
+ public void setPassword(String password) {
+ this.password = password;
+ }
+
+ public String getRole() {
+ return (String) roles.get(0);
+ }
+
+ public void setRole(String role) {
+ this.roles.clear();
+ this.roles.add(role);
+ }
+
+ public int getUid() {
+ return uid;
+ }
+
+ public void setUid(int uid) {
+ this.uid = uid;
+ }
+
+ public String getUsername() {
+ return id;
+ }
+
+ public void setUsername(String username) {
+ this.id = username;
+ }
+
+}
Propchange: cocoon/blocks/portal-sample/trunk/java/org/apache/cocoon/portal/security/PortalUser.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cocoon/blocks/portal-sample/trunk/java/org/apache/cocoon/portal/security/PortalUser.java
------------------------------------------------------------------------------
svn:keywords = Id
Added: cocoon/blocks/portal-sample/trunk/samples/coplets/basket/basket.admin.xsl
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal-sample/trunk/samples/coplets/basket/basket.admin.xsl?rev=265679&view=auto
==============================================================================
--- cocoon/blocks/portal-sample/trunk/samples/coplets/basket/basket.admin.xsl (added)
+++ cocoon/blocks/portal-sample/trunk/samples/coplets/basket/basket.admin.xsl Thu Sep 1 02:08:10 2005
@@ -0,0 +1,69 @@
+<?xml version="1.0"?>
+<!--
+ Copyright 1999-2004 The Apache Software Foundation
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!-- $Id$
+
+-->
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+<xsl:template match="basket-content">
+<h1>Basket Content</h1>
+<p>There are <xsl:value-of select="item-count"/> items in the basket.</p>
+<xsl:apply-templates select="items"/>
+</xsl:template>
+<xsl:template match="items">
+<table>
+<xsl:for-each select="item">
+<tr>
+<td>
+<a href="{show-url}"><xsl:value-of select="id"/></a>
+</td>
+<td>
+<xsl:value-of select="size"/>
+</td>
+<td>
+<a href="{remove-url}">Remove Item</a>
+</td>
+</tr>
+</xsl:for-each>
+</table>
+</xsl:template>
+
+<xsl:template match="basket-admin">
+<h1>Basket Administration</h1>
+<xsl:apply-templates select="baskets"/>
+<p><a href="{refresh-url}">Refresh list</a> - <a href="{clean-url}">Clean all baskets</a></p>
+</xsl:template>
+
+<xsl:template match="baskets">
+<table>
+<xsl:for-each select="basket">
+<tr>
+<td>
+<a href="{show-url}"><xsl:value-of select="id"/></a>
+</td>
+<td>
+<xsl:value-of select="size"/>
+</td>
+<td>
+<a href="{remove-url}">Clean Basket</a>
+</td>
+</tr>
+</xsl:for-each>
+</table>
+</xsl:template>
+
+</xsl:stylesheet>
Propchange: cocoon/blocks/portal-sample/trunk/samples/coplets/basket/basket.admin.xsl
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cocoon/blocks/portal-sample/trunk/samples/coplets/basket/basket.admin.xsl
------------------------------------------------------------------------------
svn:keywords = Id
Added: cocoon/blocks/portal-sample/trunk/samples/coplets/basket/basket.js
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal-sample/trunk/samples/coplets/basket/basket.js?rev=265679&view=auto
==============================================================================
--- cocoon/blocks/portal-sample/trunk/samples/coplets/basket/basket.js (added)
+++ cocoon/blocks/portal-sample/trunk/samples/coplets/basket/basket.js Thu Sep 1 02:08:10 2005
@@ -0,0 +1,366 @@
+/*
+ * Copyright 1999-2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+//
+// @version $Id$
+//
+cocoon.load("resource://org/apache/cocoon/forms/flow/javascript/Form.js");
+
+// This function is invoked by every coplet to check if the basket is already full
+function add() {
+ var copletId = cocoon.parameters["id"];
+ var type = cocoon.parameters["type"];
+ var storage = "basket";
+
+ var pu = cocoon.createObject(Packages.org.apache.cocoon.components.flow.util.PipelineUtil);
+ var dom = pu.processToDOM("fetch-quota", { "storage": storage, "type": type});
+
+ var node = org.apache.excalibur.xml.xpath.XPathUtil.getFirstNodeFromPath(dom,
+ org.apache.excalibur.xml.xpath.XPathUtil.buildPathArray("result/attribute/item"), false);
+ var itemCount = org.apache.cocoon.xml.dom.DOMUtil.getValueOfNode(node);
+ node = org.apache.excalibur.xml.xpath.XPathUtil.getFirstNodeFromPath(dom,
+ org.apache.excalibur.xml.xpath.XPathUtil.buildPathArray("result/attribute/size"), false);
+ var maxSize = org.apache.cocoon.xml.dom.DOMUtil.getValueOfNode(node);
+
+ var manager = cocoon.getComponent(org.apache.cocoon.portal.coplets.basket.BasketManager.ROLE);
+ var store;
+ if ( storage.equals("basket" ) ) {
+ store = manager.getBasket();
+ } else {
+ store = manager.getBriefcase();
+ }
+ var isFull = true;
+
+ if ( store.size() < itemCount && store.contentSize() < maxSize ) {
+ isFull = false;
+ }
+ cocoon.sendPage(cocoon.parameters["view"], {"bookmark" : type, "isBasketFull" : isFull});
+}
+
+// This function is invoked by every coplet to check if the basket is already full
+function getQuota() {
+ var type = cocoon.parameters["type"];
+ var storage = "basket";
+
+ var pu = cocoon.createObject(Packages.org.apache.cocoon.components.flow.util.PipelineUtil);
+ var dom = pu.processToDOM("fetch-quota", { "storage": storage, "type": type});
+
+ var node = org.apache.excalibur.xml.xpath.XPathUtil.getFirstNodeFromPath(dom,
+ org.apache.excalibur.xml.xpath.XPathUtil.buildPathArray("result/attribute/item"), false);
+ var itemCount = org.apache.cocoon.xml.dom.DOMUtil.getValueOfNode(node);
+ node = org.apache.excalibur.xml.xpath.XPathUtil.getFirstNodeFromPath(dom,
+ org.apache.excalibur.xml.xpath.XPathUtil.buildPathArray("result/attribute/size"), false);
+ var maxSize = org.apache.cocoon.xml.dom.DOMUtil.getValueOfNode(node);
+ if ( maxSize != null && maxSize.length() > 0 ) {
+ var d = new java.lang.Double(maxSize).doubleValue();
+ d = d / 10.24;
+ d = Math.floor(d) / 100.0;
+ if ( d < 0.1 && d != 0.0 ) { d = 0.1; }
+ maxSize = java.lang.String.valueOf(d);
+ }
+ cocoon.sendPage(cocoon.parameters["view"], {"itemCount" : itemCount, "maxSize" : maxSize});
+}
+
+// This function is invoked by the coplet with input process
+function eval() {
+ var copletId = cocoon.parameters["id"];
+ var type = cocoon.parameters["type"];
+ var storage = "basket";
+
+ var manager = cocoon.getComponent(org.apache.cocoon.portal.coplets.basket.BasketManager.ROLE);
+ var store;
+ if ( storage.equals("basket" ) ) {
+ store = manager.getBasket();
+ } else {
+ store = manager.getBriefcase();
+ }
+
+ // get the portal service
+ var service = cocoon.getComponent(org.apache.cocoon.portal.PortalService.ROLE);
+ var linkService = service.getComponentManager().getLinkService();
+ var profileManager = service.getComponentManager().getProfileManager();
+ // update the attribute of the current coplet:
+ var coplet = profileManager.getCopletInstanceData(copletId);
+ coplet.setAttribute("value", cocoon.request["text"]);
+
+ var url;
+
+ // let's check the action
+ if ( cocoon.request["content"] != null ) {
+ // the content button has been pressed
+ var target = profileManager.getCopletInstanceData("basket-sample-7");
+ target.setAttribute("value", cocoon.request["text"]);
+ var item = new Packages.org.apache.cocoon.portal.coplets.basket.ContentItem(target, true);
+ var event = new Packages.org.apache.cocoon.portal.coplets.basket.events.AddItemEvent(store, item);
+ url = linkService.getLinkURI(event);
+ // now use a bookmark to switch the tab
+ var pos = url.indexOf('?');
+ url = "bookmark?baskettab=2&" + url.substring(pos+1);
+ } else if ( cocoon.request["link"] != null ) {
+ // the link button has been pressed
+ var target = profileManager.getCopletInstanceData("basket-sample-7");
+ target.setAttribute("value", cocoon.request["text"]);
+ var item = new Packages.org.apache.cocoon.portal.coplets.basket.ContentItem(target, false);
+ var event = new Packages.org.apache.cocoon.portal.coplets.basket.events.AddItemEvent(store, item);
+ url = linkService.getLinkURI(event);
+ // now use a bookmark to switch the tab
+ var pos = url.indexOf('?');
+ url = "bookmark?baskettab=2&" + url.substring(pos+1);
+ } else {
+ // we redirect to the main page
+ url = "portal";
+ }
+
+ // we have to reset our state
+ coplet.setTemporaryAttribute("doNotCache", "1");
+ coplet.setTemporaryAttribute("application-uri", coplet.getCopletData().getAttribute("temporary:application-uri"));
+
+ // and now do a redirect
+ cocoon.redirectTo(url, true);
+}
+
+// This function changes the title
+function changeTitle() {
+ var copletId = cocoon.parameters["id"];
+
+ // get the portal service
+ var service = cocoon.getComponent(org.apache.cocoon.portal.PortalService.ROLE);
+ var profileManager = service.getComponentManager().getProfileManager();
+ var coplet = profileManager.getCopletInstanceData(copletId);
+
+ // title is the first 25 characters
+ var title = coplet.getAttribute("value");
+ if ( title != null ) {
+ var l = 25;
+ if ( title.length() < 25 ) { l = title.length(); }
+ title = title.substring(0, l);
+ }
+ coplet.setAttribute("title", title);
+ cocoon.sendPage(cocoon.parameters["view"]);
+}
+
+// This function is invoked by the query sample
+function query() {
+ var copletId = cocoon.parameters["id"];
+
+ // get the portal service
+ var service = cocoon.getComponent(org.apache.cocoon.portal.PortalService.ROLE);
+ var profileManager = service.getComponentManager().getProfileManager();
+ var coplet = profileManager.getCopletInstanceData(copletId);
+
+ var target = profileManager.getCopletInstanceData("basket-sample-2");
+ var value = target.getAttribute("value");
+ if ( value == null ) value = 0;
+ var millis = Packages.java.lang.System.currentTimeMillis();
+ millis = millis + ((new Packages.java.lang.Long(value).longValue()) * 60000);
+ var date = new Packages.java.util.Date(millis);
+ coplet.setAttribute("value", date);
+
+ cocoon.sendPage(cocoon.parameters["view"], {"date" : date});
+}
+
+function showresult() {
+ var copletId = cocoon.parameters["id"];
+
+ // get the portal service
+ var service = cocoon.getComponent(org.apache.cocoon.portal.PortalService.ROLE);
+ var profileManager = service.getComponentManager().getProfileManager();
+ var coplet = profileManager.getCopletInstanceData(copletId);
+
+ cocoon.sendPage(cocoon.parameters["view"], {"date" : coplet.getAttribute("value")});
+}
+
+// This function is invoked to add the result of the query
+function result() {
+ var copletId = cocoon.parameters["id"];
+ var storage = "basket";
+
+ var manager = cocoon.getComponent(org.apache.cocoon.portal.coplets.basket.BasketManager.ROLE);
+ var store;
+ if ( storage.equals("basket" ) ) {
+ store = manager.getBasket();
+ } else {
+ store = manager.getBriefcase();
+ }
+
+ // get the portal service
+ var service = cocoon.getComponent(org.apache.cocoon.portal.PortalService.ROLE);
+ var profileManager = service.getComponentManager().getProfileManager();
+ var coplet = profileManager.getCopletInstanceData(copletId);
+
+ var item = new Packages.org.apache.cocoon.portal.coplets.basket.ContentItem("cocoon://samples/blocks/portal/coplets/basket/copletwithappresult.showresult.flow", true);
+ var event = new Packages.org.apache.cocoon.portal.coplets.basket.events.AddItemEvent(store, item);
+
+ service.getComponentManager().getEventManager().getPublisher().publish(event);
+
+ cocoon.sendPage(cocoon.parameters["view"]);
+}
+
+// this function is invoked to show the dialog after the query
+function dialog() {
+ var copletId = cocoon.parameters["id"];
+ var storage = "basket";
+
+ // get the portal service
+ var service = cocoon.getComponent(org.apache.cocoon.portal.PortalService.ROLE);
+ var profileManager = service.getComponentManager().getProfileManager();
+ var coplet = profileManager.getCopletInstanceData(copletId);
+
+ var manager = cocoon.getComponent(org.apache.cocoon.portal.coplets.basket.BasketManager.ROLE);
+ var store;
+ if ( storage.equals("basket" ) ) {
+ store = manager.getBasket();
+ } else {
+ store = manager.getBriefcase();
+ }
+
+ var item = new Packages.org.apache.cocoon.portal.coplets.basket.ContentItem(coplet, false);
+ var event = new Packages.org.apache.cocoon.portal.coplets.basket.events.AddItemEvent(store, item);
+
+ service.getComponentManager().getEventManager().getPublisher().publish(event);
+
+ var action;
+ if ( storage.equals("basket" ) ) {
+ action = manager.getBasketAction(cocoon.request["action"]);
+ } else {
+ action = manager.getBriefcaseAction(cocoon.request["action"]);
+ }
+ var freq = new Packages.java.lang.Integer(cocoon.request["frequency"]).intValue();
+ item.setAttribute("action-replay", "true");
+ item.setAttribute("action-name", cocoon.request["action"]);
+ item.setAttribute("action-freq", new java.lang.Long(freq).toString());
+
+ manager.addBatch(item, freq, action);
+
+ cocoon.sendPage(cocoon.parameters["view"]);
+}
+
+// This function is invoked by the coplet list sample
+function list() {
+ var copletId = cocoon.parameters["id"];
+ var storage = "basket";
+
+ var manager = cocoon.getComponent(org.apache.cocoon.portal.coplets.basket.BasketManager.ROLE);
+ var store;
+ if ( storage.equals("basket" ) ) {
+ store = manager.getBasket();
+ } else {
+ store = manager.getBriefcase();
+ }
+
+ // get the portal service
+ var service = cocoon.getComponent(org.apache.cocoon.portal.PortalService.ROLE);
+ var profileManager = service.getComponentManager().getProfileManager();
+ var coplet = profileManager.getCopletInstanceData(copletId);
+
+ // now test check boxes
+ if ( cocoon.request["sample1"] != null ) {
+ addCoplet(profileManager, service, store, "basket-sample-1");
+ }
+ if ( cocoon.request["sample2"] != null ) {
+ addCoplet(profileManager, service, store, "basket-sample-2");
+ }
+ if ( cocoon.request["sample3"] != null ) {
+ addCoplet(profileManager, service, store, "basket-sample-3");
+ }
+ if ( cocoon.request["sample4"] != null ) {
+ addCoplet(profileManager, service, store, "basket-sample-4");
+ }
+ if ( cocoon.request["sample5"] != null ) {
+ addCoplet(profileManager, service, store, "basket-sample-5");
+ }
+
+ // we have to reset our state
+ coplet.setTemporaryAttribute("application-uri", coplet.getCopletData().getAttribute("temporary:application-uri"));
+
+ cocoon.redirectTo(coplet.getTemporaryAttribute("application-uri"), false);
+}
+
+// helper function
+function addCoplet(profileManager, service, store, copletId) {
+ var coplet = profileManager.getCopletInstanceData(copletId);
+ var item = new Packages.org.apache.cocoon.portal.coplets.basket.ContentItem(coplet, true);
+ var event = new Packages.org.apache.cocoon.portal.coplets.basket.events.AddItemEvent(store, item);
+
+ service.getComponentManager().getEventManager().getPublisher().publish(event);
+}
+
+// process the form of the content portlet
+function processBasket() {
+ var manager = cocoon.getComponent(org.apache.cocoon.portal.coplets.basket.BasketManager.ROLE);
+ var service = cocoon.getComponent(org.apache.cocoon.portal.PortalService.ROLE);
+ if ( service.getPortalName() == null ) {
+ service.setPortalName("portal");
+ }
+
+ // test parameters
+ var names = cocoon.request.getParameterNames();
+ while ( names.hasMoreElements()) {
+ var name = names.nextElement();
+ if ( name.startsWith("c" )) {
+ var id = name.substring(1);
+ var actionName = cocoon.request["a"+id];
+ var storage = cocoon.request["s"+id]
+ var store;
+ if ( storage.equals("basket" ) ) {
+ store = manager.getBasket();
+ } else if ( storage.equals("folger") ) {
+ store = manager.getFolder();
+ } else {
+ store = manager.getBriefcase();
+ }
+ var item = store.getItem(new Packages.java.lang.Long(id));
+
+ if ( "delete".equals(actionName) ) {
+ // delete
+ var event = new Packages.org.apache.cocoon.portal.coplets.basket.events.RemoveItemEvent(store, item);
+ service.getComponentManager().getEventManager().getPublisher().publish(event);
+ } else if ( "briefcase".equals(actionName) ) {
+ // move to briefcase
+ var event = new Packages.org.apache.cocoon.portal.coplets.basket.events.MoveItemEvent(store, item, manager.getBriefcase());
+ service.getComponentManager().getEventManager().getPublisher().publish(event);
+ } else if ( "basket".equals(actionName) ) {
+ // move to basket
+ var event = new Packages.org.apache.cocoon.portal.coplets.basket.events.MoveItemEvent(store, item, manager.getBasket());
+ service.getComponentManager().getEventManager().getPublisher().publish(event);
+ } else {
+ // this is a real action
+ var action;
+ if ( storage.equals("basket" ) ) {
+ action = manager.getBasketAction(actionName);
+ } else {
+ action = manager.getBriefcaseAction(actionName);
+ }
+ var freq = new Packages.java.lang.Integer(cocoon.request["f"+id]).intValue();
+ if ( cocoon.request["r"+id] != null ) {
+ // store values
+ item.setAttribute("action-replay", cocoon.request["r"+id]);
+ item.setAttribute("action-name", actionName);
+ item.setAttribute("action-freq", new java.lang.Long(freq).toString());
+ } else {
+ item.removeAttribute("action-name");
+ item.removeAttribute("action-freq");
+ item.removeAttribute("action-replay");
+ freq = -1;
+ }
+ manager.update(store);
+
+ // call batch
+ manager.addBatch(item, freq, action);
+ }
+ }
+ }
+ cocoon.redirectTo("../../portal", true);
+}
\ No newline at end of file
Propchange: cocoon/blocks/portal-sample/trunk/samples/coplets/basket/basket.js
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cocoon/blocks/portal-sample/trunk/samples/coplets/basket/basket.js
------------------------------------------------------------------------------
svn:keywords = Id
Added: cocoon/blocks/portal-sample/trunk/samples/coplets/basket/content-error.xml
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal-sample/trunk/samples/coplets/basket/content-error.xml?rev=265679&view=auto
==============================================================================
--- cocoon/blocks/portal-sample/trunk/samples/coplets/basket/content-error.xml (added)
+++ cocoon/blocks/portal-sample/trunk/samples/coplets/basket/content-error.xml Thu Sep 1 02:08:10 2005
@@ -0,0 +1,20 @@
+<?xml version="1.0"?>
+<!--
+ Copyright 1999-2004 The Apache Software Foundation
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!-- SVN $Id$ -->
+<p>
+The item is not XML.
+</p>
\ No newline at end of file
Propchange: cocoon/blocks/portal-sample/trunk/samples/coplets/basket/content-error.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cocoon/blocks/portal-sample/trunk/samples/coplets/basket/content-error.xml
------------------------------------------------------------------------------
svn:keywords = Id
Added: cocoon/blocks/portal-sample/trunk/samples/coplets/basket/sample.xml
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal-sample/trunk/samples/coplets/basket/sample.xml?rev=265679&view=auto
==============================================================================
--- cocoon/blocks/portal-sample/trunk/samples/coplets/basket/sample.xml (added)
+++ cocoon/blocks/portal-sample/trunk/samples/coplets/basket/sample.xml Thu Sep 1 02:08:10 2005
@@ -0,0 +1,22 @@
+<?xml version="1.0"?>
+<!--
+ Copyright 1999-2004 The Apache Software Foundation
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!-- SVN $Id$ -->
+<p xmlns:basket="http://apache.org/cocoon/portal/basket/1.0">
+This is a sample for the basket portlet.<br/>
+<basket:add-item href="context://samples/blocks/portal/coplets/basket/sample.xml" content="true">Add the content</basket:add-item> 
+<basket:add-item href="context://samples/blocks/portal/coplets/basket/sample.xml">Add the link</basket:add-item>
+</p>
Propchange: cocoon/blocks/portal-sample/trunk/samples/coplets/basket/sample.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cocoon/blocks/portal-sample/trunk/samples/coplets/basket/sample.xml
------------------------------------------------------------------------------
svn:keywords = Id
Added: cocoon/blocks/portal-sample/trunk/samples/coplets/basket/sitemap.xmap
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal-sample/trunk/samples/coplets/basket/sitemap.xmap?rev=265679&view=auto
==============================================================================
--- cocoon/blocks/portal-sample/trunk/samples/coplets/basket/sitemap.xmap (added)
+++ cocoon/blocks/portal-sample/trunk/samples/coplets/basket/sitemap.xmap Thu Sep 1 02:08:10 2005
@@ -0,0 +1,239 @@
+<?xml version="1.0"?>
+<!--
+ Copyright 1999-2004 The Apache Software Foundation
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!-- SVN $Id$ -->
+<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
+<map:components>
+ <map:generators default="file">
+ <map:generator name="basket" src="org.apache.cocoon.portal.coplets.basket.BasketGenerator"/>
+ <map:generator name="content" src="org.apache.cocoon.portal.coplets.basket.BasketContentGenerator"/>
+ </map:generators>
+ <map:transformers default="xslt">
+ <map:transformer name="basket" src="org.apache.cocoon.portal.coplets.basket.BasketTransformer"/>
+ <map:transformer name="folder" src="org.apache.cocoon.portal.coplets.basket.FolderTransformer"/>
+ </map:transformers>
+</map:components>
+
+ <!-- indicates what flowscript to attach to this sitemap -->
+ <map:flow language="javascript">
+ <map:script src="basket.js"/>
+ </map:flow>
+
+<map:pipelines>
+ <map:pipeline>
+
+ <map:match pattern="application">
+ <map:generate src="{coplet:temporaryAttributes/application-uri}?copletid={coplet:#}"/>
+ <map:transform type="portal-html-eventlink">
+ <map:parameter name="attribute-name" value="application-uri"/>
+ </map:transform>
+ <map:serialize type="xml"/>
+ </map:match>
+
+ <!-- This is the preprocessing pipeline:
+ First a function in flow script is called which in turn
+ calls the view
+ -->
+ <map:match pattern="*.*.preflow">
+ <map:call function="{2}">
+ <map:parameter name="id" value="{coplet:#}"/>
+ <map:parameter name="type" value="{coplet:copletData/attributes/group}"/>
+ <map:parameter name="view" value="{1}"/>
+ </map:call>
+ </map:match>
+
+ <map:match pattern="*.*.flow">
+ <map:act type="portal-set-object-model">
+ <map:parameter name="cocoon-portal-copletId" value="{request-param:copletid}"/>
+ <map:parameter name="cocoon-portal-portalName" value="portal"/>
+ </map:act>
+ <map:call function="{2}">
+ <map:parameter name="id" value="{request-param:copletid}"/>
+ <map:parameter name="type" value="{coplet:copletData/attributes/group}"/>
+ <map:parameter name="view" value="{1}"/>
+ </map:call>
+ </map:match>
+
+ <map:match pattern="*.process">
+ <map:call function="{1}">
+ </map:call>
+ </map:match>
+
+ <map:match pattern="sample">
+ <map:generate src="sample.xml"/>
+ <map:transform type="basket"/>
+ <map:serialize type="xml"/>
+ </map:match>
+
+ <!-- this is a coplet showing one item -->
+ <map:match pattern="content">
+ <map:generate type="content" src="content-error.xml">
+ <map:parameter name="attribute-name" value="item-content"/>
+ </map:generate>
+ <map:serialize type="xml"/>
+ </map:match>
+
+ <!-- show the whole basket -->
+ <map:match pattern="basket">
+ <map:call function="getQuota">
+ <map:parameter name="type" value="{coplet:attributes/type}"/>
+ <map:parameter name="view" value="basket-view"/>
+ </map:call>
+ </map:match>
+
+ <map:match pattern="basket-view">
+ <map:generate type="basket">
+ <map:parameter name="show-coplet" value="BasketContent"/>
+ <map:parameter name="show-layout" value="basket-content"/>
+ <map:parameter name="admin-mode" value="false"/>
+ <map:parameter name="type" value="{coplet:attributes/type}"/>
+ <map:parameter name="type-location" value="group"/>
+ </map:generate>
+ <map:transform src="xsl/basket-pre.xsl">
+ <map:parameter name="itemCount" value="{flow-attribute:itemCount}"/>
+ <map:parameter name="maxSize" value="{flow-attribute:maxSize}"/>
+ </map:transform>
+ <map:transform type="basket"/>
+ <map:transform src="xsl/basket-post.xsl"/>
+ <map:serialize type="xml"/>
+ </map:match>
+
+ <map:match pattern="basket.admin">
+ <map:generate type="basket">
+ <map:parameter name="show-coplet" value="BasketContent"/>
+ <map:parameter name="show-layout" value="basket-content-admin"/>
+ <map:parameter name="admin-mode" value="false"/>
+ </map:generate>
+ <map:transform type="xslt" src="basket.admin.xsl"/>
+ <map:serialize type="xml"/>
+ </map:match>
+
+ <map:match pattern="basket-admin">
+ <map:generate type="basket">
+ <map:parameter name="show-coplet" value="BasketContent"/>
+ <map:parameter name="show-layout" value="basket-content-admin"/>
+ <map:parameter name="admin-mode" value="true"/>
+ </map:generate>
+ <map:transform src="xsl/basket-pre.xsl"/>
+ <map:serialize type="xml"/>
+ </map:match>
+
+ <!-- This is the static sample coplet -->
+ <map:match pattern="staticcoplet">
+ <map:generate src="xml/staticcoplet.xml" type="jx"/>
+ <map:transform type="basket"/>
+ <map:serialize type="xml"/>
+ </map:match>
+
+ <!-- This is the coplet list sample-->
+ <map:match pattern="copletlist">
+ <map:generate src="xml/copletlist.xml" type="jx"/>
+ <map:serialize type="xml"/>
+ </map:match>
+
+ <!-- This is the pipeline for the coplet with attribute sample -->
+ <map:match pattern="copletwithattr">
+ <map:generate src="xml/copletwithattr.xml" type="jx"/>
+ <map:transform type="basket"/>
+ <map:transform src="xsl/copletwithattr.xsl">
+ <map:parameter name="value" value="{coplet:attributes/value}"/>
+ <map:parameter name="coplet" value="{coplet:#}"/>
+ </map:transform>
+ <map:serialize type="xml"/>
+ </map:match>
+
+ <!-- This is the pipeline for the coplet with inline process sample -->
+ <map:match pattern="copletwithinline">
+ <map:generate src="xml/copletwithinline.xml" type="jx"/>
+ <map:transform src="xsl/copletwithinline.xsl">
+ <map:parameter name="value" value="{coplet:attributes/value}"/>
+ <map:parameter name="coplet" value="{coplet:#}"/>
+ </map:transform>
+ <map:transform type="basket">
+ <map:parameter name="link-element" value="parameter"/>
+ <map:parameter name="link-element-ns" value="http://apache.org/cocoon/portal/coplet/1.0"/>
+ </map:transform>
+ <map:serialize type="xml"/>
+ </map:match>
+
+ <!-- This is the pipeline for the coplet with input process sample -->
+ <map:match pattern="copletwithinput">
+ <map:generate src="xml/copletwithinput.xml" type="jx">
+ <map:parameter name="value" value="{coplet:attributes/value}"/>
+ </map:generate>
+ <map:serialize type="xml"/>
+ </map:match>
+ <!-- This is the pipeline for the coplet with input process show sample -->
+ <map:match pattern="copletwithinputshow">
+ <map:generate src="xml/copletwithinputshow.xml" type="jx">
+ <map:parameter name="value" value="{coplet:attributes/value}"/>
+ <map:parameter name="title" value="{coplet:attributes/title}"/>
+ </map:generate>
+ <map:serialize type="xml"/>
+ </map:match>
+
+ <!-- This is the pipeline for the coplet with application sample -->
+ <map:match pattern="copletwithapp">
+ <map:generate src="xml/copletwithapp.xml" type="jx"/>
+ <map:serialize type="xml"/>
+ </map:match>
+
+ <!-- This is the pipeline for the coplet with application sample -->
+ <map:match pattern="copletwithappresult">
+ <map:generate src="xml/copletwithappresult.xml" type="jx">
+ <map:parameter name="copletId" value="{coplet:#}"/>
+ </map:generate>
+ <map:transform type="basket"/>
+ <map:transform src="xsl/copletwithappresult.xsl"/>
+ <map:serialize type="xml"/>
+ </map:match>
+
+ <!-- This is the pipeline for the coplet with upload sample -->
+ <map:match pattern="copletwithupload">
+ <map:generate src="xml/copletwithupload.xml" type="jx"/>
+ <map:transform type="folder"/>
+ <map:serialize type="xml"/>
+ </map:match>
+
+ <!-- This pipeline is used to fetch the quota for a user -->
+ <map:match pattern="fetch-quota">
+ <!-- we need the user ID -->
+ <map:act type="auth-protect">
+ <map:parameter name="handler" value="portal-handler"/>
+ <map:parameter name="application" value="portal"/>
+
+ <map:select type="resource-exists">
+ <map:when test="context://samples/blocks/portal/profiles/basket/quotas-user-{ID}.xml">
+ <map:generate src="context://samples/blocks/portal/profiles/basket/quotas-user-{ID}.xml"/>
+ </map:when>
+ <map:when test="context://samples/blocks/portal/profiles/basket/quotas-role-{role}.xml">
+ <map:generate src="context://samples/blocks/portal/profiles/basket/quotas-role-{role}.xml"/>
+ </map:when>
+ <map:otherwise>
+ <map:generate src="context://samples/blocks/portal/profiles/basket/quotas.xml"/>
+ </map:otherwise>
+ </map:select>
+ <map:transform src="xsl/quota2result.xsl">
+ <map:parameter name="storage" value="{flow-attribute:storage}"/>
+ <map:parameter name="type" value="{flow-attribute:type}"/>
+ </map:transform>
+ <map:serialize type="xml"/>
+ </map:act>
+ </map:match>
+
+ </map:pipeline>
+</map:pipelines>
+</map:sitemap>
Propchange: cocoon/blocks/portal-sample/trunk/samples/coplets/basket/sitemap.xmap
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cocoon/blocks/portal-sample/trunk/samples/coplets/basket/sitemap.xmap
------------------------------------------------------------------------------
svn:keywords = Id
Added: cocoon/blocks/portal-sample/trunk/samples/coplets/basket/xml/copletlist.xml
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal-sample/trunk/samples/coplets/basket/xml/copletlist.xml?rev=265679&view=auto
==============================================================================
--- cocoon/blocks/portal-sample/trunk/samples/coplets/basket/xml/copletlist.xml (added)
+++ cocoon/blocks/portal-sample/trunk/samples/coplets/basket/xml/copletlist.xml Thu Sep 1 02:08:10 2005
@@ -0,0 +1,31 @@
+<?xml version="1.0"?>
+<!--
+ Copyright 1999-2004 The Apache Software Foundation
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!-- SVN $Id$ -->
+<p xmlns:basket="http://apache.org/cocoon/portal/basket/1.0">
+Add one (or more) coplets to your basket.
+<form method="POST" action="copletlist.list.flow">
+ <table>
+ <tr><th> </th><th>Title</th></tr>
+ <tr><td><input type="checkbox" name="sample1" value="sample1"/></td><td>Static Coplet</td></tr>
+ <tr><td><input type="checkbox" name="sample2" value="sample2"/></td><td>Coplet with Attribute</td></tr>
+ <tr><td><input type="checkbox" name="sample3" value="sample3"/></td><td>Coplet with Inline Processing</td></tr>
+ <tr><td><input type="checkbox" name="sample4" value="sample4"/></td><td>Coplet with Input Processing</td></tr>
+ <tr><td><input type="checkbox" name="sample5" value="sample5"/></td><td>Coplet with Application</td></tr>
+ </table>
+ <input type="submit" name="Add" value="Add"/>
+</form>
+</p>
\ No newline at end of file
Propchange: cocoon/blocks/portal-sample/trunk/samples/coplets/basket/xml/copletlist.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cocoon/blocks/portal-sample/trunk/samples/coplets/basket/xml/copletlist.xml
------------------------------------------------------------------------------
svn:keywords = Id
Added: cocoon/blocks/portal-sample/trunk/samples/coplets/basket/xml/copletwithapp.xml
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal-sample/trunk/samples/coplets/basket/xml/copletwithapp.xml?rev=265679&view=auto
==============================================================================
--- cocoon/blocks/portal-sample/trunk/samples/coplets/basket/xml/copletwithapp.xml (added)
+++ cocoon/blocks/portal-sample/trunk/samples/coplets/basket/xml/copletwithapp.xml Thu Sep 1 02:08:10 2005
@@ -0,0 +1,24 @@
+<?xml version="1.0"?>
+<!--
+ Copyright 1999-2004 The Apache Software Foundation
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!-- SVN $Id$ -->
+<p>
+This application adds the number stored in the 'Coplet with attribute'
+to the current time.
+<form method="POST" action="copletwithappresult.query.flow">
+ <input type="submit" name="query" value="Query"/>
+</form>
+</p>
\ No newline at end of file
Propchange: cocoon/blocks/portal-sample/trunk/samples/coplets/basket/xml/copletwithapp.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cocoon/blocks/portal-sample/trunk/samples/coplets/basket/xml/copletwithapp.xml
------------------------------------------------------------------------------
svn:keywords = Id
Added: cocoon/blocks/portal-sample/trunk/samples/coplets/basket/xml/copletwithappdialog.xml
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal-sample/trunk/samples/coplets/basket/xml/copletwithappdialog.xml?rev=265679&view=auto
==============================================================================
--- cocoon/blocks/portal-sample/trunk/samples/coplets/basket/xml/copletwithappdialog.xml (added)
+++ cocoon/blocks/portal-sample/trunk/samples/coplets/basket/xml/copletwithappdialog.xml Thu Sep 1 02:08:10 2005
@@ -0,0 +1,22 @@
+<?xml version="1.0"?>
+<!--
+ Copyright 1999-2004 The Apache Software Foundation
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!-- SVN $Id$ -->
+<p xmlns:basket="http://apache.org/cocoon/portal/basket/1.0">
+The stored time is ${date}.
+<a href="copletwithappdialog">Add the query</a> 
+<a href="copletwithapp.result.flow">Add the result</a>
+</p>
\ No newline at end of file
Propchange: cocoon/blocks/portal-sample/trunk/samples/coplets/basket/xml/copletwithappdialog.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cocoon/blocks/portal-sample/trunk/samples/coplets/basket/xml/copletwithappdialog.xml
------------------------------------------------------------------------------
svn:keywords = Id
Added: cocoon/blocks/portal-sample/trunk/samples/coplets/basket/xml/copletwithappresult.xml
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal-sample/trunk/samples/coplets/basket/xml/copletwithappresult.xml?rev=265679&view=auto
==============================================================================
--- cocoon/blocks/portal-sample/trunk/samples/coplets/basket/xml/copletwithappresult.xml (added)
+++ cocoon/blocks/portal-sample/trunk/samples/coplets/basket/xml/copletwithappresult.xml Thu Sep 1 02:08:10 2005
@@ -0,0 +1,28 @@
+<?xml version="1.0"?>
+<!--
+ Copyright 1999-2004 The Apache Software Foundation
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!-- SVN $Id$ -->
+<p xmlns:basket="http://apache.org/cocoon/portal/basket/1.0">
+The stored time is ${date}.
+<a href="copletwithapp.result.flow">Add the result</a><br/>
+<form method="POST" action="copletwithapp.dialog.flow">
+ Frequency: <input type="text" name="frequency" value="1"/><br/>
+ Action: <select name="action" size="2">
+ <basket:show-actions/>
+ </select><br/>
+ <input type="submit" value="Add the query"/>
+</form>
+</p>
\ No newline at end of file
Propchange: cocoon/blocks/portal-sample/trunk/samples/coplets/basket/xml/copletwithappresult.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cocoon/blocks/portal-sample/trunk/samples/coplets/basket/xml/copletwithappresult.xml
------------------------------------------------------------------------------
svn:keywords = Id
Added: cocoon/blocks/portal-sample/trunk/samples/coplets/basket/xml/copletwithattr.xml
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal-sample/trunk/samples/coplets/basket/xml/copletwithattr.xml?rev=265679&view=auto
==============================================================================
--- cocoon/blocks/portal-sample/trunk/samples/coplets/basket/xml/copletwithattr.xml (added)
+++ cocoon/blocks/portal-sample/trunk/samples/coplets/basket/xml/copletwithattr.xml Thu Sep 1 02:08:10 2005
@@ -0,0 +1,26 @@
+<?xml version="1.0"?>
+<!--
+ Copyright 1999-2004 The Apache Software Foundation
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!-- SVN $Id$ -->
+<p xmlns:basket="http://apache.org/cocoon/portal/basket/1.0">
+This number (<value/>) is stored in an attribute.<br/>
+<buttons/>
+<basket:add-item coplet="basket-sample-2" content="true">Add the content</basket:add-item> 
+<basket:add-item coplet="basket-sample-2">Add the link</basket:add-item>
+<jx:if test="#{isBasketFull}" xmlns:jx="http://apache.org/cocoon/templates/jx/1.0">
+<br/><b>You have reached the allowed quota for your basket.</b>
+</jx:if>
+</p>
\ No newline at end of file
Propchange: cocoon/blocks/portal-sample/trunk/samples/coplets/basket/xml/copletwithattr.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cocoon/blocks/portal-sample/trunk/samples/coplets/basket/xml/copletwithattr.xml
------------------------------------------------------------------------------
svn:keywords = Id
Added: cocoon/blocks/portal-sample/trunk/samples/coplets/basket/xml/copletwithinline.xml
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal-sample/trunk/samples/coplets/basket/xml/copletwithinline.xml?rev=265679&view=auto
==============================================================================
--- cocoon/blocks/portal-sample/trunk/samples/coplets/basket/xml/copletwithinline.xml (added)
+++ cocoon/blocks/portal-sample/trunk/samples/coplets/basket/xml/copletwithinline.xml Thu Sep 1 02:08:10 2005
@@ -0,0 +1,39 @@
+<?xml version="1.0"?>
+<!--
+ Copyright 1999-2004 The Apache Software Foundation
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!-- SVN $Id$ -->
+<p xmlns:basket="http://apache.org/cocoon/portal/basket/1.0" xmlns:coplet="http://apache.org/cocoon/portal/coplet/1.0">
+ This number (<value/>) is stored in an attribute.<br/>
+ <table><tr>
+ <td>
+ <coplet:links format="html-form" method="POST" base-url="bookmark">
+ <coplet:parameter href="baskettab=1"/>
+ <plus>Plus one and add the content</plus>
+ <basket:add-item coplet="basket-sample-3" content="true"/>
+ </coplet:links>
+ </td>
+ <td>
+ <coplet:links format="html-form" method="POST" base-url="bookmark">
+ <coplet:parameter href="baskettab=1"/>
+ <plus>Plus one and add the link</plus>
+ <basket:add-item coplet="basket-sample-3"/>
+ </coplet:links>
+ </td>
+ </tr></table>
+<jx:if test="#{isBasketFull}" xmlns:jx="http://apache.org/cocoon/templates/jx/1.0">
+<br/><b>You have reached the allowed quota for your basket.</b>
+</jx:if>
+</p>
\ No newline at end of file
Propchange: cocoon/blocks/portal-sample/trunk/samples/coplets/basket/xml/copletwithinline.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cocoon/blocks/portal-sample/trunk/samples/coplets/basket/xml/copletwithinline.xml
------------------------------------------------------------------------------
svn:keywords = Id
Added: cocoon/blocks/portal-sample/trunk/samples/coplets/basket/xml/copletwithinput.xml
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal-sample/trunk/samples/coplets/basket/xml/copletwithinput.xml?rev=265679&view=auto
==============================================================================
--- cocoon/blocks/portal-sample/trunk/samples/coplets/basket/xml/copletwithinput.xml (added)
+++ cocoon/blocks/portal-sample/trunk/samples/coplets/basket/xml/copletwithinput.xml Thu Sep 1 02:08:10 2005
@@ -0,0 +1,29 @@
+<?xml version="1.0"?>
+<!--
+ Copyright 1999-2004 The Apache Software Foundation
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!-- SVN $Id$ -->
+<p>
+ Enter some text:<br/>
+<form method="POST" action="copletwithinput.eval.flow">
+ <textarea name="text" cols="30" rows="7">${parameters.getParameter('value')}</textarea> 
+ <input type="submit" name="save" value="Save"/>
+ <input type="submit" name="content" value="Add the content and goto basket"/>
+ <input type="submit" name="link" value="Add the link and goto basket"/>
+</form>
+<jx:if test="#{isBasketFull}" xmlns:jx="http://apache.org/cocoon/templates/jx/1.0">
+<br/><b>You have reached the allowed quota for your basket.</b>
+</jx:if>
+</p>
\ No newline at end of file
Propchange: cocoon/blocks/portal-sample/trunk/samples/coplets/basket/xml/copletwithinput.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cocoon/blocks/portal-sample/trunk/samples/coplets/basket/xml/copletwithinput.xml
------------------------------------------------------------------------------
svn:keywords = Id
Added: cocoon/blocks/portal-sample/trunk/samples/coplets/basket/xml/copletwithinputshow.xml
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal-sample/trunk/samples/coplets/basket/xml/copletwithinputshow.xml?rev=265679&view=auto
==============================================================================
--- cocoon/blocks/portal-sample/trunk/samples/coplets/basket/xml/copletwithinputshow.xml (added)
+++ cocoon/blocks/portal-sample/trunk/samples/coplets/basket/xml/copletwithinputshow.xml Thu Sep 1 02:08:10 2005
@@ -0,0 +1,21 @@
+<?xml version="1.0"?>
+<!--
+ Copyright 1999-2004 The Apache Software Foundation
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!-- SVN $Id$ -->
+<p>
+ Title: ${parameters.getParameter('title')}<br/>
+ Your message was: ${parameters.getParameter('value')}
+</p>
\ No newline at end of file
Propchange: cocoon/blocks/portal-sample/trunk/samples/coplets/basket/xml/copletwithinputshow.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cocoon/blocks/portal-sample/trunk/samples/coplets/basket/xml/copletwithinputshow.xml
------------------------------------------------------------------------------
svn:keywords = Id
Added: cocoon/blocks/portal-sample/trunk/samples/coplets/basket/xml/copletwithupload.xml
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal-sample/trunk/samples/coplets/basket/xml/copletwithupload.xml?rev=265679&view=auto
==============================================================================
--- cocoon/blocks/portal-sample/trunk/samples/coplets/basket/xml/copletwithupload.xml (added)
+++ cocoon/blocks/portal-sample/trunk/samples/coplets/basket/xml/copletwithupload.xml Thu Sep 1 02:08:10 2005
@@ -0,0 +1,27 @@
+<?xml version="1.0"?>
+<!--
+ Copyright 1999-2004 The Apache Software Foundation
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!-- SVN $Id$ -->
+<basket:upload-form method="POST" enctype="multipart/form-data" xmlns:basket="http://apache.org/cocoon/portal/basket/1.0">
+Upload Test
+ <basket:upload-item type="file" name="doc"/><br/>
+ <input type="submit"/>
+<jx:if test="#{isBasketFull}" xmlns:jx="http://apache.org/cocoon/templates/jx/1.0">
+<br/><b>You have reached the allowed quota for your basket.</b>
+</jx:if>
+<br/>
+This sample does only work, if you enabled uploads for Cocoon!
+</basket:upload-form>
\ No newline at end of file
Propchange: cocoon/blocks/portal-sample/trunk/samples/coplets/basket/xml/copletwithupload.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cocoon/blocks/portal-sample/trunk/samples/coplets/basket/xml/copletwithupload.xml
------------------------------------------------------------------------------
svn:keywords = Id
Added: cocoon/blocks/portal-sample/trunk/samples/coplets/basket/xml/staticcoplet.xml
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal-sample/trunk/samples/coplets/basket/xml/staticcoplet.xml?rev=265679&view=auto
==============================================================================
--- cocoon/blocks/portal-sample/trunk/samples/coplets/basket/xml/staticcoplet.xml (added)
+++ cocoon/blocks/portal-sample/trunk/samples/coplets/basket/xml/staticcoplet.xml Thu Sep 1 02:08:10 2005
@@ -0,0 +1,27 @@
+<?xml version="1.0"?>
+<!--
+ Copyright 1999-2004 The Apache Software Foundation
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!-- SVN $Id$ -->
+<p xmlns:basket="http://apache.org/cocoon/portal/basket/1.0">
+This is a sample for the basket portlet.<br/>
+ <basket:add-item href="context://samples/blocks/portal/coplets/basket/sample.xml" content="true">Add the content</basket:add-item> 
+ <basket:add-item href="context://samples/blocks/portal/coplets/basket/sample.xml">Add the link</basket:add-item>  
+ <basket:add-item store="briefcase" href="context://samples/blocks/portal/coplets/basket/sample.xml" content="true">Add the content to the briefcase</basket:add-item> 
+ <basket:add-item store="briefcase" href="context://samples/blocks/portal/coplets/basket/sample.xml">Add the link to the briefcase</basket:add-item>
+<jx:if test="#{isBasketFull}" xmlns:jx="http://apache.org/cocoon/templates/jx/1.0">
+<br/><b>You have reached the allowed quota for your basket.</b>
+</jx:if>
+</p>
Propchange: cocoon/blocks/portal-sample/trunk/samples/coplets/basket/xml/staticcoplet.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cocoon/blocks/portal-sample/trunk/samples/coplets/basket/xml/staticcoplet.xml
------------------------------------------------------------------------------
svn:keywords = Id