You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

First of, it's handy to add a convenience method to your "page" component to define this "list" of objects:

protected void addObjectToPathComponents(Object anObject, String aPageName, Object aTitle)
{
if ( anObject !=null)
____

Unknown macro: {______Map__aMap_=_new_HashMap();____________aMap.put(_Path.ObjectKey,_anObject_);______aMap.put(_Path.PageNameKey,_aPageName_);______aMap.put(_Path.TitleKey,_aTitle_);____________this.pathComponents().add(_aMap_);____________return;____}

____
___throw_new_IllegalArgumentException(_"Page.addObjectWithPageNameAndTitleToPath:_null_object.");
__}

Now,_in_each_concrete_page_you_could_initialize_the_path_components:

__protected_void_initPathComponents()
__{
___EnvelopeanEnvelope=_this.value();
___Date__aDate=_anEnvelope.creationDate();
___List__aList=_anEnvelope.list();
____
___this.addObjectToPathComponents(_aDate,"Timeline","TIMELINE");
___this.addObjectToPathComponents(_aDate);
____
___if(aList!= null )

Unknown macro: { this.addObjectToPathComponents( aList ); }

this.addObjectToPathComponents( anEnvelope );
}

Finally, the path component itself could look like this:

{panel}
  <webobject name = "IsMain">
    <webobject name = "MainLink"><webobject name = "MainLabel"></webobject></webobject>
  </webobject>
  
  <webobject name = "IsNotMain">
    <webobject name = "Components">
      <webobject name = "HasPrefix">&nbsp;<webobject name = "Prefix"></webobject>&nbsp;</webobject><webobject name = "Component"></webobject>
    </webobject>
  
    <webobject name = "HasPrefix">&nbsp;<webobject name = "Prefix"></webobject>&nbsp;</webobject><webobject name = "LastComponent"></webobject>
  </webobject>
{panel}

Components: WORepetition

Unknown macro: { count = count; index = index; }

;
IsMain: WOConditional

Unknown macro: { condition = isMain; }

;
IsNotMain: WOConditional

Unknown macro: { condition = isMain; negate = true; }

;
ainLink: WOHyperlink

Unknown macro: { action = getMail; title = "get new mail"; }

;
MainLabel: SpanString

Unknown macro: { value = "get mail"; isSmall = true; isUpperCase = true; //isBold = true; class = "Label"; length = 30; }

;

HasPrefix: WOConditional

Unknown macro: { condition = hasPrefix; }

;
Prefix: WOImage

Unknown macro: { src = prefixUrl; border = 0; align = "middle"; }

;
Component: Link

Unknown macro: { value = component.object; description = component.title; altDescription = component.title; value = component.object; pageName = component.pageName; isUpperCase = true; isSmall = true; //isBold = true; class = "Label"; }

;
LastComponent: SpanString

Unknown macro: { value = lastComponentTitle; isSmall = true; isUpperCase = true; //isBold = true; class = "Label"; length = 30; }

;

That's all folks.

Category:WebObjects

  • No labels