2 Replies Latest reply on May 18, 2011 2:14 AM by Kristian Wright

    How do I completely enable a new custom asset in Correspondence Management?

    Kristian Wright Level 1

      Hello!

       

      I'm trying to add a new custom asset to the Correspondence Management Solution Accelerator, and have it behave like all other assets in the system (ie searchable, updateable etc).  I'm almost there, but there's obviously something I'm missing, and I was hoping someone here might have done this before, or have a link to some documentation regarding the matter that I may have missed.  The asset I'm trying finish creating is for a LiveCycle user in a specific domain.  This is what I've done so far...


      I've created the asset definition MyUser.fml and placed it in the FSIApp\Portal\webapp\WEB-INF\assetDefinitions folder.  I've then registered this fml file in the spring-config.xml file in both the 'lc.cm.assetDefinitionsDeployer' and 'lc.cm.assetTypeRegistryBootstrapper' beans.  In the 'lc.cm.assetTypeRegistryBootstrapper' bean, I set the key to 'MyUser', and the value to the class path of my Java class that represents this asset.

       

      On the Java side I've created the MyUser.java class, as well as MyUserService.java and MyUserServiceImpl.java to allow the searching, updating etc of the MyUser assets.

       

      After running the Bootstrap process, I can log into the Manage Templates application, select Data Dictionaries from the 'View' dropdown, and view/edit the MyUser data dictionary properties with no problems.  So I'm happy that the asset has successfully been registered with the application.

       

      Where I'm stuck is choosing the MyUser asset from the drop down, and searching the system for assets of that type.  I can choose the MyUser asset type from the 'view' drop down, but the search result returns an empty array.

       

      From digging into the existing Manage Templates code, I've created the following classes:

       

      • public interface IMyUserService extends IEventDispatcher -  containing the following function definitions:

                function getMyUser(id:String):IAsyncToken;

                function getAllMyUsers(param1:Query=null):IAsyncToken;

       

      • public class MyUserSeviceProvider extends ServiceProvider - containing a getter/setter for MyUserServiceDelegate

       

      • public class MyUserServiceDelegate extends ServiceDelegate implements IMyUserService - containing the functions defined in IMyUserService, as well as creating the RemoteObject to perform the actions.

       

      The MyUserServiceDelegate constructor is:

       

           public function MyUserServiceDelegate ()
           {
                  super();
                  _service = new RemoteObject("myapplication.services.myUserService");
                  _service.showBusyCursor = true;
           }

       

      This is the code for the function in getAllMyUsers in MyUserServiceDelegate:

       

           public function getAllMyUsers(param1:Query = null):IAsyncToken
           {
                  var operationToken:AsyncToken = this._service.getAllMyUsers(param1);
                  var token:IccToken = new IccToken(this.className + ".getAllMyUsers");
                  operationToken.addResponder(getDefaultResponder(token));

                  return token;

           }

       

       

      I've also made changes to the following config files to register the RemoteObject destination specified in the MyUserServiceDelegate constructor:

       

      spring-http-config.xml:

       

           <bean name="/service/UserService" class="org.springframework.remoting.httpinvoker.HttpInvokerServiceExporter">
              <property name="service" ref="myapplication.services.myUserService" />
              <property name="serviceInterface" value="com.mydomain.lc.services.MyUserService" />
          </bean>

       

       

      remoting-config.xml:

       

           <destination id="myapplication.services.myUserService"/>

       

       

      flexmessagebroker-servlet.xml

       

           <flex:remoting-destination ref="myapplication.services.myUserService" />

       

       

      Above my Java class definition of MyUserServiceImpl.java I have the following line:

       

      @Service("myapplication.services.myUserService")

       

       

       

       

      So......

       

      My problem is that when I choose the MyUser asset from the drop down, no search results are returned (an empty array is returned).  I have logging code in the getAllMyUsers function in the MyUserServiceDelegateclass.as, as well as logging in the MyUserServiceImpl.java class (not shown in the above code snippets) and neither of them fire when selecting the MyUser asset from the drop down.  So neither of the classes are being called on the search.  If I force a search via the following line:

       

      MyUserSeviceProvider.getMyUserService().getAllMyUsers();

       

      the logging in both the Flex and Java classes works (and the java class returns the results as expected).  So I'm happy that these functions, as well as the linking between the Flex and the Java side is working correctly.

       

      The step that I can't seem to work out is having the selection of the asset in the drop down call the desired function automagically.  I've been digging into the SearchManager, the ServiceLocator and heaps of other classes, but I'm falling deeper and deeper into the rabbit hole...

       

       

      Can anyone shed some light on what they think might be needed to make the final link here?  I've been digging and digging into the code for days now and my brain hurts!!

       

      Any advice appreciated!!

       

      Thanks,

      Kristian