Sample definition of ad_form


ad_form \
-name task \
-cancel_url $return_url \
-action $action_url \
-actions $actions \
-has_edit 1 \
-mode $form_mode \
-export {next_url user_id return_url} \
-form {
task_id:key
{task_name:text(text) {label "[_ intranet-timesheet2-tasks.Name]"} {html {size 50}} {help_text $full_name_help}}
{task_nr:text(text) {label "[_ intranet-timesheet2-tasks.Short_Name]"} {html {size 30}} {help_text $short_name_help}}
{project_id:text(select) {label "[_ intranet-core.Project]"} {options $parent_project_options} {help_text $project_help}}
{material_id:text(select) {label "[_ intranet-timesheet2-tasks.Material]"} {options $material_options} {help_text $material_help}}
{cost_center_id:text(select),optional {label "[_ intranet-timesheet2-tasks.Cost_Center]"} {options $cost_center_options} {help_text $cost_center_help}}
{task_type_id:text(hidden) {label "[_ intranet-timesheet2-tasks.Type]"} {options $type_options} }
{task_status_id:text(im_category_tree) {label "[_ intranet-timesheet2-tasks.Status]"} {custom {category_type "Intranet Project Status"}}}
{uom_id:text(select) {label "[_ intranet-timesheet2-tasks.UoM]
([_ intranet-timesheet2-tasks.Unit_of_Measure])"} {options $uom_options}}
}

Sample definition of template::form

template::form::create $form_id
template::form::section $form_id ""
template::element::create $form_id project_id -widget "hidden"
template::element::create $form_id supervisor_id -widget "hidden" -optional
template::element::create $form_id workflow_case_id -widget "hidden" -optional
template::element::create $form_id requires_report_p -widget "hidden" -optional -datatype text
template::element::create $form_id workflow_key -widget "hidden" -optional -datatype text
template::element::create $form_id return_url \
-widget "hidden" \
-optional \
-datatype text
template::element::create $form_id project_name \
-datatype text\
-label "[_ intranet-core.Project_Name]" \
-html {size 40} \
-after_html "[im_gif help "Please enter any suitable name for the project. The name must be unique."]"

tcl: Continue line using backslash

1) Make sure there’s no backspace after the backslash !
2) No breaks allowed within function call

This won’t work:

                [im_do_row [array get bgcolor] $ctr $curr_owner_id \
                                $owner_name \
                                $days \
                                [array get user_days] \
                                [array get user_absences] \
                                $holydays \
                                $today_date \
                                [array get user_ab_descr] \
                                $workflow_key \
                           ]

OpenACS: Watch packages

  • AOLServer restart sets back watches
  • CVS settings (watch) could lead to additional dirs Base/Baseserv containing a second version of lib files

pgsql

# select project_id from im_projects where parent_id = NULL;
 project_id
------------
(0 rows)

# select project_id from im_projects where parent_id IS NULL;
 project_id
------------
      35116
      35417
(2 rows)
Jun 092011

Messages

Ext.example.msg('Date Selected', 'You choose {0}.', Ext.Date.format(date, 'M j, Y'));

Sample REST Post

Get an object together with its attributes

        var clickHandlerAcceptQuote = function(project_id) {
                var xmlAsString = '380';
                Ext.Ajax.request({
                        url: '/intranet-rest/im_project/' + project_id + '?format=xml',
                        method: 'POST',
                        xmlData: xmlAsString,
                        success: function(o) {
                                if (o.responseText == 0) {
                                        field.markInvalid('Email already in use, please login');
                                }
                        }
                });
        };

Get a category

var ticketAreaStore = Ext.create('PO.data.CategoryStore', {
        storeId:        'ticketAreaStore',
        model: 'TicketBrowser.Category',
        remoteFilter:   true,
        autoLoad:       false,
        pageSize:       1000,
        proxy: {
                type: 'rest',
                url: '/intranet-rest/im_category',
                appendId: true,
                extraParams: {
                        format: 'json',
                        category_type: '\'Intranet Sencha Ticket Tracker Area\''
                },
                reader: { type: 'json', root: 'data' }
        }
});

Get a File Storage Object

// Local store definition.
// We have to redefine the store every time we show
// files for a different ticket
var fileStorageStore = Ext.create('Ext.data.Store', {
        model:  'TicketBrowser.FileStorage',
        storeId:        'fileStorageStore',
        autoLoad:       false,
        remoteSort:     true,
        pageSize:       5,                      // Enable pagination
        sorters:        [{
        property:       'name',
        direction:      'DESC'
        }],
        proxy:  {
        type:   'rest',
        url:    '/intranet-rest/file_storage_object',
        appendId:       true,
        extraParams:    { format: 'json', parent_id: 0 },
        reader: { type: 'json', root: 'data' }
        }
});

Conventions:

var naming:
Place holders (renderTo): Add ‘_ph’
Example: “grid_uploaded_files_ph”

Mar 022011
 
;; default to better frame titles
(setq frame-title-format
      (concat  "%b - emacs@" (system-name)))
 
;; default to unified diffs
(setq diff-switches "-u")
 
(setq scroll-step 1)
(mouse-wheel-mode t)
 
(setq mouse-wheel-progressive-speed nil)
 
(setq scroll-margin 1
scroll-conservatively 0
scroll-up-aggressively 0.01
scroll-down-aggressively 0.01)
 
(global-set-key '[(f12)]          'call-last-kbd-macro)
(global-set-key '[(shift f12)]    'toggle-kbd-macro-recording-on)
 
    (defun toggle-kbd-macro-recording-on ()
      "One-key keyboard macros: turn recording on."
      (interactive)
      (define-key
        global-map
        (events-to-keys (this-command-keys) t)
        'toggle-kbd-macro-recording-off)
      (start-kbd-macro nil))
 
    (defun toggle-kbd-macro-recording-off ()
      "One-key keyboard macros: turn recording off."
      (interactive)
      (define-key
        global-map
        (events-to-keys (this-command-keys) t)
        'toggle-kbd-macro-recording-on)
      (end-kbd-macro))
 
;; turn on font-lock mode
 (when (fboundp 'global-font-lock-mode)
  (global-font-lock-mode t))
 
;; set TAB width
(setq default-tab-width 4)
 
; change TAB behaviour 
(defvar just-tab-keymap (make-sparse-keymap) "Keymap for just-tab-mode")
(define-minor-mode just-tab-mode
  "Just want the TAB key to be a TAB"
  :global t :lighter " TAB" :init-value 0 :keymap just-tab-keymap
  (define-key just-tab-keymap (kbd "TAB") 'indent-for-tab-command))

Links:
http://www.masteringemacs.org/articles/2011/02/08/mastering-key-bindings-emacs/