Posts in Category "Uncategorized"

“LiveCycle Mosaic” Rebranded to “Adobe Digital Enterprise Platform Composite Application Framework” (ADEP CAF)

In the upcoming release, the LiveCycle suite has been rebranded to the “Adobe Digital Enterprise Platform” (ADEP) [http://www.adobe.com/solutions/customer-experience/enterprise-platform.html] and is now part of our “Adobe Customer Experience Solutions” suite [http://www.adobe.com/solutions/customer-experience.html].

Mosaic has been renamed to “Composite Application Framework” (CAF) [http://www.adobe.com/solutions/customer-experience/enterprise-platform/capabilities.html#build].

More information on this rebranding is in this article entitled Adobe Retires the “LiveCycle” Brand, Its Services Become Part of Broader Capability:
http://blogs.adobe.com/livecycle/2011/06/adobe-retires-the-livecycle-brand-its-services-become-part-of-broader-capability.html

Adobe Digital Enterprise Platform Developer Center:
http://www.adobe.com/devnet/enterprise-platform.html

The new ADEP Developers channel on YouTube:
http://www.youtube.com/user/ADEPDevelopers

Adobe Enterprise Platform Techies blog with lots of tips on ADEP CAF development:
https://blogs.adobe.com/eptech/

Instructional videos on working with LiveCycle Mosaic 9.5

We have created some new instructional videos on working with Adobe LiveCycle Mosaic ES2 9.5:

Inter Tile Communications:

http://tv.adobe.com/watch/working-with-adobe-livecycle-es2/livecycle-mosaic-95-inter-tile-communications/

View and Panel Templates:

http://tv.adobe.com/watch/working-with-adobe-livecycle-es2/livecycle-mosaic-95-view-and-panel-templates/

Authorization and Policies:

http://tv.adobe.com/watch/working-with-adobe-livecycle-es2/livecycle-mosaic-es2-authorization-policies/

Skinning Applications:

http://tv.adobe.com/watch/working-with-adobe-livecycle-es2/livecycle-mosaic-es2-skinning-applications/

Programmatically creating panels with layouts

Adobe LiveCycle Mosaic ES2 9.5 introduces a method of programmatically creating panels with a wide variety of layouts.  Layouts allow you to specify the absolute or relative positions of tiles within a panel.  This can be done with both the ActionScript and JavaScript versions of the APIs.

You first create a Layout object of one of these types:

  • AbsoluteLayout
  • ColumnLayout
  • DynamicColumnLayout
  • DynamicRowLayout
  • FlowLayout
  • HDividedBoxLayout
  • HorizontalLayout
  • RowLayout
  • StackLayout
  • TileLayout
  • VDividedBoxLayout
  • VerticalLayout

Then when you create the panel, you supply it with the Layout object.

To create a panel with “DynamicColumnLayout” layout in ActionScript:

    // Create a new layout for the panel
    var layoutPanel:ILayout = this.mosaicApp.createLayout("DynamicColumnLayout");

    // Modify the attributes of the panel layout from the default values
    layoutPanel.numColumns = 4;

    // Create a panel that use this layout
    var panelToAdd:IPanel = this.mosaicApp.createBlankPanel(layoutPanel);

    // Set the panel's label
    panelToAdd.nodeLabel = "DynamicColumnLayout Panel";

    // Add the panel to the view
    this.parentView.addPanel(panelToAdd);

    // Add tiles to the panel...

To create a panel with “DynamicColumnLayout” layout in JavaScript:

    // Create a new layout for the panel
    var layoutPanel = mosaicApp.createLayout("DynamicColumnLayout");

    // Modify the attributes of the panel layout from the default values
    layoutPanel.setNumColumns(4);

    // Create a panel that use this layout
    var panelToAdd = mosaicApp.createNode("panel", layoutPanel);

    // Set the panel's label
    panelToAdd.setNodeLabel("DynamicColumnLayout Panel");

    // Add the panel to the view
    parentView.addPanel(panelToAdd);

    // Add tiles to the panel...

The resulting panel looks like this:

Example of panel with DynamicColumn layout

Example of panel with DynamicColumn layout

Here is a table of which attributes are supported for each layout:

Column
Layout
Flow
Layout
HDividedBox
Layout
Horizontal
Layout
Row
Layout
Stack
Layout
Tile
Layout
VDividedBox
Layout
Vertical
Layout
columnAlign X
columnWidth X
horizontalAlign X X X
horizontalGap X X X X
orientation X
paddingBottom X X X X X X X X
paddingLeft X X X X X X X X
paddingRight X X X X X X X X
paddingTop X X X X X X X X
requestedColumnCount X
requestedRowCount X
rowAlign X
rowHeight X
verticalAlign X X X
verticalGap X X X X

To save a little room I omitted from the table these layouts:

  • AbsoluteLayout (no supported attributes)
  • DynamicColumnLayout (supports only “numColumns“)
  • DynamicRowLayout (supports only “numRows“)

Here are examples of some of the panel layouts:

Displaying Mosaic nodes and subscribing to display events

Adobe LiveCycle Mosaic ES2 9.5 introduces a new way of managing the visibility of nodes (views, panels, and tiles) in your application.  This is very useful when your application has multiple views.  The get/set activePanel()/activeView() APIs from Mosaic 9.0 have been removed because they no longer apply now that Mosaic supports nested panels and more than one panel or tile could be visible at the same time.  Replacing them are the “display” APIs.

The ActionScript IDisplayable class is a superclass for IView, IPanel, and ITile:

  • IDisplayable.display() [Sets a node to be visible]
  • IDisplayable.displayed [Gets the visibility of a node]

For JavaScript the display APIs are only available on nodes that are of types “view”, “panel”, or “tile”:

  • Node.display()         [Sets a node to be visible]
  • Node.getDisplayed()    [Gets the visibility of a node]

To display a node with ActionScript:

// nodeToDisplay is of type IMosaicNode
if (nodeToDisplay is IDisplayable)
{
    var nodeDisplayable:IDisplayable = nodeToDisplay as IDisplayable;
    nodeDisplayable.display(); // Display the node
}

To display a node with JavaScript:

// nodeToDisplay is of type Node
var strNodeType = nodeToDisplay.getNodeType();

if ((strNodeType == "view") ||
    (strNodeType == "panel")||
    (strNodeType == "tile"))
{
    nodeToDisplay.display(); // Display the node
}


To get the display state of a node with ActionScript:


var strNodeDisplayStatus:String = "hidden";

// nodeToTestForDisplay is of type IMosaicNode
if (nodeToTestForDisplay is IDisplayable)
{
    var nodeDisplayable:IDisplayable = nodeToTestForDisplay as IDisplayable;

    if (nodeDisplayable != null)
    {
        if (nodeDisplayable.displayed)
        {
            strNodeDisplayStatus = "displayed";
        }
    }
}

To get the display state of a node with JavaScript:


// nodeToTestForDisplay is of type Node
var strNodeType = nodeToTestForDisplay.getNodeType();

var strNodeDisplayStatus = "hidden";

if ((strNodeType == "view") ||
    (strNodeType == "panel")||
    (strNodeType == "tile"))
{
    if (nodeToTestForDisplay.getDisplayed())
    {
        strNodeDisplayStatus = "displayed";
    }
}


You can also subscribe to a new event that is dispatched whenever a Mosaic node becomes displayed.

The subscribe and respond to the “DisplayMessage” event with ActionScript:
 

// Add a message listener for the node-display event
mosaicApp.addMessageListener(DisplayMessage.NAMESPACE, DisplayMessage.DISPLAY_EVENT_CHANGE, onDisplayMessage);

// Handle the node-display event
private function onDisplayMessage(message:Message):void
{
    for each (var node:IMosaicNode in message.payload.revealedNodes)
    {
        Alert.show("Displayed node " + node.nodeLabel, "Display event", mx.controls.Alert.OK, this);
    }
}


The subscribe and respond to the “DisplayEvent” event with JavaScript:

 

mosaicApp.addMessageListener("com.adobe.mosaic.core", "DisplayEvent.CHANGE", onDisplayMessage);

function onDisplayMessage(message)
{
    for (var nNodeCounter = 0; nNodeCounter < message.payload.revealedNodes.length; nNodeCounter++)
    {
        var strNodeLabel = message.payload.revealedNodes[nNodeCounter].getNodeLabel();
        alert("Displayed node " + strNodeLabel);
    }
}


Sample Flex (DisplayReceiver.mxml) and HTML (DisplayHtmlReceiver.html) tiles are attached.

Launching the Mosaic AIR client with command-line arguments

What better way is there to start a blog on Adobe LiveCycle Mosaic than to blog about a new way to start Mosaic?  Our latest release, ES2 9.5, includes command-line arguments that allow you to specify the user, password, server, and application to start when launching the Mosaic AIR client.  For example:

"C:\Program Files (x86)\Adobe LiveCycle Mosaic\Adobe LiveCycle Mosaic.exe" -user designer -pwd password -server http://localhost:8080 -app ClientDashboard

Here’s how to do the same thing with an Ant script:

<property name="username" value="designer"/>
<property name="password" value="password"/>
<property name="protocol" value="http"/>
<property name="server"   value="localhost"/>
<property name="port"     value="8080"/>

<property name="mosaic_application"  value="ClientDashboard"/>
<property name="mosaic_air_exe_file" value="Adobe LiveCycle Mosaic.exe"/>
<property name="mosaic_air_exe_dir"  location="C:/Program Files (x86)/Adobe LiveCycle Mosaic"/>
<property name="mosaic_air_exe_path" location="${mosaic_air_exe_dir}/${mosaic_air_exe_file}"/>

<!-- Start Mosaic AIR application with command-line arguments -->
<exec failonerror="true" executable="${mosaic_air_exe_path}">
    <arg value="-user"/>
    <arg value="${username}"/>
    <arg value="-pwd"/>
    <arg value="${password}"/>
    <arg value="-server"/>
    <arg value="${protocol}://${server}:${port}"/>
    <arg value="-app"/>  <!-- Specify application to start -->
    <arg value="${mosaic_application}"/>
</exec>

Note: If the Mosaic AIR client is already started, this command will bring it to the front, but won’t change the running application.