dimanche 14 avril 2013

Playing with the M-Files: a leading Document Management System

M-Files is a rich ECM (Enterprise Content Management) system that can be used to facilitate access to any type of documents including scanned paper (through Optical Character Recognition), emails, etc. It can also be integrated with other enterprise systems like ERP, CRM. You can find more on the corresponding wikipedia page.

In this post we will see: how to administer the system (install it on a local machine, add a license), import data from a CRM database, Model a document management workflow.

M-Files Administration

After installation you will see the "M" driver that allows you to access all documents stored on the M-Files server, there storage is organized into vaults in the M-Files terminology that represents a physical central storage area. In the trail version, you can access directly to a vault content by a double click, however in the pro version a log-in dialog is prompted to check if you have credentials for accessing theis area.

To add a license, launch the M-Files program then right click on the M-file icon (i.e. M) in the Windows Tool bar (see the picture)
Then choose Settings -> M-Files Server Administor. 
On the administrator window choose Local Computer (On the left side) -> License Management (on the right side) -> Install License ... -> enter your Serial number and License code.

You can find more information on the M-Files manual can be fond here: 
Start -> All Programs -> M-Files -> Documentation -> M-Files Help

Import data to M-Files

Imported files to M-Files are enriched with meta-data that should be indicated at the importation time. On the manual you can find how to import data under the section Daily use of M-Files -> Transferring existing files to M-Files. There you will see that you have two options:
  • Create a link between a source and the corresponding M-files document so that modifications in any of these data is propagated to the other copy through this connection.
  • Import an external document to M-Files so that you can modify any copy without altering the other one.
To read more about these options jump to Connections to External Sources / File Sources. You can also check Connection to External Database.

To create a connection to an external source, on the administrator window go to Connections to External Sources then select the source type (e.g. file, email). A new window will show up to allow you edit the source information (location, description, meta-data).

We're going to import a CRM database to retrieve the customers information (i.e. name, address and website).
On the administrator window (previous figure), go to Object Types under Meta Structure of your current vault. Then on the right side select Customer then Connection to External Database as in the following figure:
Check the checkbox then, click on define source to enter the database OLE provider as well as connection information (data source path or DB name, user credentials).

For instance, to import data from an Excel file choose for OLE DB Provider "Microsoft OLE DB Provider for ODBC Drivers". Then, in the next tab edit the DSN (Data Source Name) (e.g. Excel) or enter a connection string. For instance, here is an example of such string for accessing MS Access:
provider=MICROSOFT.JET.OLEDB.4.0;DataSource=C:\mfiles.accdb;User ID=nonDusager;Password=motDePasse;
You can find more information about the connection strings check this page (french).

If you had problems of DSN incompatibility between your pilote and the application then check this thread on Microsoft support.

To be continued.

dimanche 7 avril 2013

Some podcast radios

The following are some cool Podcasts about development on different technologes: Java, Android, etc.

Software Engineering Radio usually performs interviews with authors or professionals from different backgrounds in software engineering (development, databases, Java technology). This radio is sponsored by the IEEE Software magazine.

Android Weekly performs a weekly review of Android news from new Apps to insights from Google

Android Devcast a serie of french podcast by PAUG (Paris Android User Group) on everything concerning Android development.

Java Posse performs good news cast about Java technologies (and even Scala), frameworks and the JVM. Some Googlers are part of the host.

Lostcast is a podcast by two indie game developers that talk about their experience with HTML5 based games development, advanced technics, interviews with industry pioneers.

Talking Big Data is hosted by IBMer David Pittman, it addresses everything related to Big Data, analytics and related technologies.

Hacker Public Radio is hosted by a long list of members and has the particularity of having the content produced by the community of listeners, the radio abords different areas especially on the open source community (conferences or projects news, etc.).

You can find more by visiting this StackOverflow thread. or on Vogel's blog.

All these podcasts can be found on podbay.fm, there you can also find more podcast radios.



dimanche 17 mars 2013

Embedded Android

Some resources from the Embedded Android Workshop:
1. Android Internals

2. Working with the AOSP

3. Native Android user-space

4. Using and Customizing the Android Framework

This is a link to the presentation.

More presentations by

Check also the Embedded Linux Wiki and Porting Android to Devices.


lundi 4 février 2013

Adding headers button to a ListView

Here is an example showing how to add headers button to a ListView

Button btn1 = new Button(MyActivity.this);
btn1.setText("button1");
btn1.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
btn1.setGravity(Gravity.CENTER);
btn1.setOnClickListener(new OnClickListener() {   
 @Override
 public void onClick(View v) {
  // do something
 }
});
Button btn2 = new Button(MyActivity.this);
btn2.setText("button2");
btn2.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
btn2.setGravity(Gravity.CENTER);
btn2.setOnClickListener(new OnClickListener() {   
 @Override
 public void onClick(View v) {
  // do something
 }
});
        
LinearLayout layout = new LinearLayout(this);  
layout.setOrientation(LinearLayout.HORIZONTAL);  
layout.setLayoutParams(new ListView.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));  
layout.setGravity(Gravity.CENTER);  
layout.addView(btn1);  
layout.addView(btn2);
myList.addHeaderView(layout);//or getListView().addHeaderView(layout);

lundi 14 janvier 2013

Building its own Linux distribution


Preparing for Linux build

Host System Requirements

Before going further you need to check some requirements on the host system. Here at pastebin you can find the version checking file.
After download, run $bash version-check.sh. You can also create it locally directly from the terminal as follow:
$cat > version-check.sh << "EOF"
>Paste here the content from pastebin
>EOF
Here is a possible output, you should have packages with at least similar version or higher than this output.
In my case, I had to install gawkpatch, and makeinfo. You may have trubble to install the last one, it is available in texinfo package. Here are the issued installation commands:
$sudo aptitude install gawk
$sudo aptitude install patch
$sudo aptitude install texinfo

Preparing a new partition

I'm using xubuntu running on a VirtualBox, to create a partition I added a new device to my virtual machine: Configuration->Storage -> select the disk controller -> add new disk. I used GParted to create new partitions.
To create a filesystem on the created partition: $sudo mke2fs -jv /dev/
In my case I used the existing swap partition in the host system.
After setting the filesystem, the partition need to be mounted:
$export LFS=/mnt/lfs
$sudo mkdir -pv $LFS
$sudo mount -v -t ext3 /dev/ $LFS

After that, I created a directory under /mnt/lfs to store downloaded packagaes before installation.

$sudo mkdir -v $LFS/sources
$sudo chmod -v a+wt $LFS/sources


I used wget to download needed packages, here is a complete list of packages to download. I first created a file to store this list as follow:

$cat > wget-list << "EOF"
>Paste here the content of packages list
>EOF


To start downloading, it took a while depending on the available bandwidth: 
$sudo wget -i wget-list -P $LFS/sources 
In the list you man-pages-3.35.tar.gz and zlib-1.2.6.tar.bz2 were missings, I had to download them manually by google the package name.

Changing the owner of from root to lfs.



When I was trying to configure GCC, i get following error error: C compiler cannot create executables. After some search, it seams that the $LFS_TGT variable was not set correctly as a result of creating a directory with user  root instead lfs , and thus I had to restart from scratch.

repeat from section 2.2 building binutils-2.2
5.4. Binutils-2.22

to be continued.

lundi 10 décembre 2012

Push notifications with Parse.com

Parse.com provides a set of handy tools to rapidly build mobile applications that needs back-end. One of the main provided features is the push notifications that enables asynchronous and real-time communiation. This post illustrates how to set up the push mechnism in an Android application.
  • First, we need to create an Account at Parse.com and register an application to have an application key and client key
  • Second, in the application settings wen have to enable push notifications
  • Then, download the latestes Parse SDK, i.e. the parse.jar
  • Finally, code time
In the manifest, we need to add the following lines to ask permessions
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /> 
<uses-permission android:name="android.permission.VIBRATE" />
Then, before the </application> register a broadcast receiver
<receiver android:name=".PushReceiver">
   <intent-filter>  
 <action android:name="com.telethonix.NOTIFICATION"> </action>
   </intent-filter>
</receiver>
Then create the PushReceiver class as follow:
public class PushReceiver extends BroadcastReceiver {
   public final static String TAG = PushReceiver.class.getSimpleName(); 
   @Override
   public void onReceive(Context context, Intent intent) {     
      try {
 Bundle extras = intent.getExtras();        
 String message = extras != null ? extras.getString("com.parse.Data") : "";    
 Log.i(TAG, "Received message: "+message);
       // do something with the received data
      } catch (JSONException e) {
 e.printStackTrace();
      }  
   }
}
Finnaly in the main activity, we should initiate parse with the application keys, and send a notification
String app_id     = "your application key";
String client_key = "your client key";
Parse.initialize(this, app_id, client_key);
// subscribe to be notified
PushService.subscribe(MainActivity.this, "channel", MainActivity.class);
// push a message
ParsePush push = new ParsePush(); push.setChannel("channel");
push.setData(data);
push.sendInBackground(new SendCallback(){   
   @Override
   public void done(ParseException arg0){
      Log.i(TAG, "push sent done!");
   }
});
More details at Push Developer Guide.

mercredi 5 décembre 2012

J2EE Solution Logs

Changing the context root of a dynamic web app URL (StackOverflow)
  1. Right click on the project in the project explorer tab, the choose properties.
  2. Set the new context root in the Web Project Settings.
Exception when launching jetty (StackOverflow)
java.lang.NoClassDefFoundError: org/objectweb/asm/ClassVisitor
It seems that jetty cannot find the asm.jar file in its classpath, check this as follow:
  1. On eclipse, go to the Servers view (or open it via window -> view -> Servers)
  2. Right click on jetty, then choose Open or just type F3
  3. On the Overview tab, click on Open Lauchn Configuration
  4. Go to Classpath tab and check for asm.jar
If you cannot find it, then you should manually download it from the project website.

Register a listener to do things before the VM exits (even if you "Ctrl-C" the running example before it's completed)
private void registerShutdownHook() {
   Runtime.getRuntime().addShutdownHook( new Thread() {
      @Override
      public void run() {
         // do some thing
      }
   });
}

Increase Maven memory, in mvn.bat add:
set MAVEN_OPTS=-Xmx2048m -XX:MaxPermSize=512m

To be continued