Blog

redrocketcms.classes.provider.Blog

Bucket

redrocketcms.classes.bucket.Bucket

 

The base class for all content buckets. These instances get created as an object named "_api" on the timeline of the movie that matches either the class name, (i.e. Splitview) or the id (my-bucket-39e490).

 

For example, if you create a "Splitview" in the library and set the linkage to "Splitview" to create the baseline, when the movie gets attached to the Body, an object named "_api" will be created within that movie that you can interact with.

p parity:String

Read-only. Returns one of two strings: "EVEN" or "ODD".

p previousSibling:MovieClip

Read-only. Returns the movieclip ahead in the assembly progression.

p nextSibiling:MovieClip

Read-only. Returns the movieclip behind in the assembly progression.

p isFirst:Boolean

Read-only. Returns true or false if this item is the first in the assembly chain.

p isLast:Boolean

Read-only. Returns true or false if this item is the last item in the assembly chain.

p index:Number

Read-only. Returns the numerical value of this items’s position in the assembly chain. Zero-based.

p data:Object

Read/Write. This data is the most raw form of data. This data object holds all the xml data of the original xml file for this content bucket. You can access any of the data with the following knowledge:

 

Each XML node has 3 parts. "attributes", "_value", and "_label".

Same name nodes are put into an array of the same name.

Each node can be accessed with dot syntax.

 

So, for the following xml structure:

 

<stuff>

<member id="1">mike</member>

<member id="2">dave</member>

<more>info</more>

</stuff>

 

all of the following methods are valid:

 

stuff.member.length // equals 2

stuff.member[0].attributes.id // equals "1"

stuff.more._value // equals "info"

stuff.member[1]._label // equals "member"

m invalidate():Void

Calling invalidate() begins a chain of resize/positioning events. If the bucket is part of an assembly, that assembly will reposition all the child elements, and then invalidate itself, and it’s owner as well, until the body is reached creating a cascading effect.

 

You should call this function if any resizing of your content occurs after the first frame.

p isChild:Boolean

Read-only. If it is an aggregate, this will return true for any child content buckets. It will also return true for any child elements such as blogs or indexPairs.

 

This is the best way to determine if a content bucket is part of an aggregate chain.

p parent:MovieClip

Read/Write. Returns the containing movieclip. Since Buckets (_api) are objects, they do not have the _parent property. This allows you to reference the parent object from within the _api.

p owner:MovieClip

Read/Write. Returns the next larger provider class Movieclip. For example, if it is a non-aggregated Splitview, the owner will be the instance of the RRBody. If it is a Blog, the owner will be the Blogs component within the Blogset Movieclip.

 

This is an important distinction to keep in mind. If you are trying to access the timeline of a Blogset From a Blog, you would need to write it like so from within the Blog timeline:

var blogsetTimeline = _api.owner._parent;

LinkableChild

m getAnchor():Array

Returns a 2-value array. The first value is the url, or src of the anchor. the second value is the frame/browser traget of the anchor.

m getURI():Void

Calls the getURL for the anchor automatically.

m getIsLink():Boolean

Returns a boolean if the bucket is a link. You can use this in conjuction with getURI() to automatically set an object to be clickable. Example:

 

 

if (_api.getIsLink()) { onRelease = function () { _api.getURI(); } }

Page

m getTitle():String

Returns a plain text string.

m getDescription():String

Returns a html entity.

m getGraphicObject(id:String):Object

param id:String

the id string of the graphic object to return. This graphic must be part of this content bucket.

 

returns:Object

 

The object has all the properties of the graphic xml node which are as follows:

 

  • type:String - the 3-letter file extension in all caps. i.e. "PNG"
  • id:String - the unique identifier within the system
  • reference:String - the original filename before it was uploaded
  • src:String - the relative path of the actual file
  • width:String - the width of the actual image
  • height:String - the height of the actual image
  • alt:String - the alternate textual data, if any, to describe the image.

m getData():String

Returns the text from the data field in the content manager. This content is typiccally wild-card. It might be a string, it might be html, it is dependant on the developer to parse and manage.

Provider

redrocketcms.interfaces.Provider

 

Every Content Bucket is a Provider. Depending on the typology of the content, it will fall into one of 3 types of providers, and the methods available are all in the _api object in the timeline.