Wednesday, December 10, 2008

Flex DocumentReference and LiveCycle 8.2

If you plan to use a DocumentReference to send a file to LiveCycle, such as an xml file, you need to ensure that you're using the latest adobe-remoting-provider.swc found xxx\LiveCycle8.2\LiveCycle_ES_SDK\misc\DataServices\Client-Libraries.

Previous versions of the DocumentReference allow for xml, but with 8.2, you need to send your document within the text property.

Look at "LCDS-325" at http://help.adobe.com/en_US/livecycle/8.2/lcds_releasenotes.html if you want more details or plan to fix this change on the LiveCycle side, but at the end of the day, it's easier to simply update your swc and text property.

Get current user for a workspace enabled flex application

Here is a sample code snippet if you have to pull user information or user credentials from the signed-in workspace user when a flex application is loaded as a process/form in workspace.

import lc.core.ISessionManager;
import lc.domain.SessionMap;
import mx.utils.ObjectUtil;

var session : SessionMap = SessionMap( Application.application.session );
var sessionManager : ISessionManager = ISessionManager( session.getObject( "lc.core.ISessionManager" ) );

trace( ObjectUtil.toString( sessionManager.authenticatedUser ) );

You'll see that authenticated user is mapped to lc.domain.User. You'll need the latest fds.swk and fds_rb.swc for this. Below is an example of what you'll get back.

(lc.domain::User)#0
address = (null)
description = (null)
displayName = "Super Administrator"
domain = (null)
email = ""
emailAliases = (null)
firstName = (null)
groups = (null)
initials = (null)
isOutOfOffice = false
lastName = (null)
locale = (null)
oid = "8D1446F6-A3DD-F4C2-378B-1B46089140AA"
session = (null)
telephone = ""
timezone = (null)
userid = "administrator"