This example shows a basic map viewer with a CS-W widget. Click on the button with the green + and choose "Find layers" from the menu.
The js is not minified so it is readable. See catalogue.js.