org.apache.cocoon.portal.coplets.basket
Class ContentItem

java.lang.Object
  extended by org.apache.cocoon.portal.coplets.basket.AbstractItem
      extended by org.apache.cocoon.portal.coplets.basket.ContentItem
All Implemented Interfaces:
Serializable

public class ContentItem
extends AbstractItem
implements Serializable

This is an item that contains a link or a content. The item can either reference a coplet or an URL.

Version:
CVS $Id: ContentItem.html 1304258 2012-03-23 10:09:27Z ilgrosso $
See Also:
Serialized Form

Field Summary
protected  byte[] content
          The content
protected  String copletId
          The id of the referenced coplet
protected  boolean storesContent
          Do we store the content or just the link?
protected  String stringRep
          The cached string rep
protected  String url
          The referenced url
 
Fields inherited from class org.apache.cocoon.portal.coplets.basket.AbstractItem
attributes, currentId, id
 
Constructor Summary
ContentItem(CopletInstanceData cid, boolean content)
          Create a new item referencing a coplet instance data
ContentItem(String url, boolean content)
          Create a new item referencing to a url
 
Method Summary
 boolean equalsItem(ContentItem ci)
          Compare one item with another
 byte[] getContent()
          Get the content or null
 String getCopletId()
          Return the referenced coplet or null for a url
 String getURL()
          Return the url of null for a coplet
 boolean isContent()
          Do we store the content?
 void setContent(byte[] c)
          Set the content
 void setTitle(String title)
           
 int size()
          Return the size if content is stored Otherwise -1 is returned
 String toString()
           
 
Methods inherited from class org.apache.cocoon.portal.coplets.basket.AbstractItem
getAttribute, getAttributeNames, getId, hasAttribute, removeAttribute, setAttribute
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

copletId

protected String copletId
The id of the referenced coplet


storesContent

protected boolean storesContent
Do we store the content or just the link?


url

protected String url
The referenced url


stringRep

protected String stringRep
The cached string rep


content

protected byte[] content
The content

Constructor Detail

ContentItem

public ContentItem(CopletInstanceData cid,
                   boolean content)
Create a new item referencing a coplet instance data

Parameters:
cid - The coplet
content - Do we store the content (false: a link)

ContentItem

public ContentItem(String url,
                   boolean content)
Create a new item referencing to a url

Parameters:
url - The url
content - Do we store the content (false: a link)
Method Detail

getURL

public String getURL()
Return the url of null for a coplet


getCopletId

public String getCopletId()
Return the referenced coplet or null for a url


isContent

public boolean isContent()
Do we store the content? (or just the link)


setContent

public void setContent(byte[] c)
Set the content


getContent

public byte[] getContent()
Get the content or null


size

public int size()
Return the size if content is stored Otherwise -1 is returned


toString

public String toString()
Overrides:
toString in class Object

equalsItem

public boolean equalsItem(ContentItem ci)
Compare one item with another


setTitle

public void setTitle(String title)


Copyright © 1999-2010 The Apache Software Foundation. All Rights Reserved.