What to expect in upcoming SmartNSF Beta 3 release?

EDIT: Beta 3 has been released: https://openntf.org/main.nsf/project.xsp?r=project/SmartNSF/releases/CCB...

Changes

We've decided to rename strategies to make the names shorter, yet still descriptive enough. We've basically removed all SELECT_ and ALL_ parts of the names. For example SELECT_ALL_DOCUMENTS_FROM_VIEW is from now on DOCUMENTS_FROM_VIEW. Extending the life of your keyboard is just a positive side effect of this change.

Bug fixes

Date format of returned DATETIME items was broken, so we fixed it. Bigly!

ARRAY_OF_DOUBLE data type was returning array of nulls instead of array of actual double values. Not exactly convenient, especially when you hadn't stored nulls there in the first place.

New features

For DOCUMENTS_FROM_VIEW_BY_KEY and DOCUMENTS_FROM_VIEW_BY_KEY_PAGED strategies you can now specify mode('exact') in routes.groovy. Use it when you want to get just those documents exactly matching that specified key, same as calling view.getAllDocumentsByKey(key, true). If omitted, partial mode is used - so like view.getAllDocumentsByKey(key, false).

VIEWENTRIES and VIEWENTRIES_PAGED strategies has been added and they are quite fast. These allow you to define which view columns from the view you want to return, by programmatic name. Example routes.groovy can look like this:

router.GET('entries') {
  strategy(VIEWENTRIES_PAGED) {
    viewName('ByTopic')
  }
  mapJson 'Subject', json: 'title', type: 'STRING'
  mapJson '\$101', json: 'created_date', type: 'DATETIME'
  mapJson '\$110', json: 'price', type: 'DOUBLE'
}

Note the need to escape $ when programmatic name of the column contains it.

You can only use these strategies to read (GET) data from view, no formulas can be used and supported datatypes are STRING, DATETIME and DOUBLE. For multi-value columns use ARRAY_OF_STRING, ARRAY_OF_DATETIME and ARRAY_OF_DOUBLE.

As usual (well not so usual, to be frank, but we are working on it), you can find all these changes and more documentation in project wiki https://wiki.openntf.org/display/XRAPI/SmartNSF

Comments

Love it!

Nice to have the bugfixes and view-entries support!

exciting

thank you, when we can download beta 3 :) ?

sample application?

I have not given the project a try yet, but is it accompanied with a sample application/nsf?

Add new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
7 + 1 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.