Private: Classes in this package are intended to be used by the SAS Query Services Model only.

This package supports creating an Information Map directly from a specific path. The Information Map corresponds to a single relational table within the path with a data item to represent each column in the table.

Currently OLAP is not supported in this package.

com.sas.iquery.dataservices.FileBaseInformationMapFactory is the class provided to access the elements of this package. The factory class must reside in the data services jar because it must execute against a server. It is necessary to have a factory class because creating this map is a multi step process. And it may be necessary in the future to add support for additional ways to connect or create these maps. The steps to use the factory are simple:

> - provide connection information
> - provide LIBNAME information
> - retrieve table list
> - provide specific table name

Here is a code example for the calling application. In order to make it easiest on the calling application I think this should be a class with state information. Because we require connection info, file path and LIBNAME info before the application can then prompt for the table to use.

            // Create the factory.
            FileBaseInformationMapFactory factory = new FileBaseInformationMapFactory();

            // Set the information we need to automatically create an information map
            factory.setConnectionInformation( host, port, username, password );
            factory.setLibnameInformation( filePath, libnameEngine, libnameOptions );

            // An Excel file can contain multiple sheets. Each sheet translates to
            // a table.
            List tables = factory.getTables();

            // Pick a table name from the list
            ...

            // Create an information map on the fly for our table.
            InformationMap map = factory.newInformationMap( tableName );

            // Use the map.
            ...

            // We are finished with the map, cleanup the factory.
            factory.dispose();
            factory = null;

### Creating Multiple Maps

Once the required information is supplied this factory can produce multiple Information Maps. It is possible to create a map for each table defined in the local file. It is also possible to create multiple maps from a single table. Maps are not cached and the maps will be different physical objects each time the factory is asked to be create one.

### Server and Path

Normally this is a local SAS server and a local path but these can reside on other machines. The client process, the file and the SAS server can each reside on different machines. The server specified must be a SAS IOM server. This is the only supported protocol. Only relational data is supported. The file must meet SAS's requirements for creating a LIBNAME. The user information used to connect to the SAS server must have access to the requested file. Examples of a path are: "file:///c:/test.xls" or "\\someMachine\sharedDirectory\test.xls".

### Data Items

A set of data items will be created. Each data item will match a column in the table. Here are the details about what is created for the data item.

- All items will be in the root folder of the map.
- Each data item will be given an ID the same name as the column. If there are non supported characters then the ID can be derived by calling the convertToDataItemID( String columnName ) on the factory.
- The label will be similar to the name but with white space replacing any non alpha-numeric characters, and each word having initial letter capitalized.
- The description will be generated and look something like "Physical column Sales_Amount".
- The data item's expression will be the corresponding physical column.
- For numeric columns, the data item will be a measure, all others will be created as category.
- The default aggregation will be specified as SUM for numeric items and COUNT for all other types.
- The supported aggregations will be set to all valid aggregations.
- If the column has a format defined then it will be set on the data item, otherwise the item will have no format.
- Sorting will be allowed but no sorting will be defined.
- All valid actions will be supported for manipulating the item.
- The read-only flag will be set to false.
- The hidden flag will be set to false.

### Other Items

No filters will be created. No prompts will be created.

### Persistence

The information map is not persisted by this class. When used within a data selection, these maps are persisted as part of the selection. The calling application is responsible for persisting this these maps either though the standard XML persistence of a map or the standard XML persistence of a data selection.

### Objects

In order to create a file based information map we must model the information that is normally defined in an OMA repository. Here is a diagram of the objects that must be created.