Developer

Using the MAF Extensibility Framework in Passive Mode

When an application uses the framework in passive mode, it can interact with the framework via the MAFCore object.

There are several metohods for passively using the MAFCore interface and its successor interfaces. For example, use one of the createTile() methods of MAFCore to have the framework create a metadata driven tile that the application can use in its own view hierarchy. Provide the controller to the tile in your application, or have the framework create it together with the tile.

Tiles in the configuration can refer to several predefiend parameters. You can set these parameters programmatically by passing a MAFTileContext object during the creation. When the tile is created, you can get its native UI representation by calling its getView() method.

To have the framework take over the control and switch to a new fully metadata-driven screen, use one of the MAFCore switchScreen() methods.

The scenarios described demonstrate transitions between active and passive mode. The MAF Extensibility Framework can invoke the creator methods of one your injected objects (registered during building the MAFCore object) to let the application interact with the framework to accomplish the requested task.

With MAFCore, you can also retrieve localized texts or display different meta-data driven dialogs. For the full feature set, see the API documentation of these interfaces:
  • MAFCore
  • MAFCoreScreenManager
  • MAFTileFactory
The MAFCore object built with MAFCoreBuilder implements all of these interfaces.
        List<MAFParameter> parameterList = new ArrayList<MAFParameter>();
        parameterList.add(new MAFDefaultParameter("MyParameter", "ValueOfMyParameter"));
        
        final MAFTileContext myTileContext = new MAFDefaultTileContext(parameterList);
        
        mafCore.switchScreen(this, "myTileIdFromLayoutConfig", myTileContext);

…

        MAFTileController myTileController = new MAFTileController() {
			
		@Override
		public MAFDataResult getData(List<MAFBinding> bindings, boolean reloadData,
				boolean updateContext, MAFDataProgressListener listener) {
			return new MAFDataResult() {

				@Override
				public MAFTileContext getTileContext() {
					return myTileContext;
				}

…
					
			};
		}
						
…
        	
	};

        mafCore.createTile(this, "myTileIdFromLayoutConfig2Create", myTileController);