source: MDService2/branches/MDService_simple3/WebContent/scripts/mdservice_ui_load.js @ 1584

Last change on this file since 1584 was 1584, checked in by gaba, 13 years ago

squery remove changes

File size: 21.3 KB
Line 
1
2/**
3 * @fileOverview  The file contains app load functionality. The load functions actualy used provides client side model building together with
4 * ui building. The load module is independant from app pane-layout and all ui-layout functionality.
5 *
6 * @author
7 * @version
8 */
9
10function loadData(){
11        //loadWelcomeMessage();
12        loadTooltiptable();
13        loadWorkspaceProfiles();
14        //loadCollections(); // loaded after WorkspaceProfile is loaded
15        //loadTerms();           // loaded after WorkspaceProfile is loaded
16        //loadTermsAutocomplete(); //handleQueryInput();
17        //createTooltip()
18       
19        //loadComponentsRegistry();     
20        //loadDCR();
21
22}
23
24function loadTooltiptable() {
25         
26         var uri = window.location.pathname + "static/info.xml";
27         
28         $.get(uri,function(data, textStatus){
29                $(data).find('#commands').find('dt').each(function(){
30                        tooltiptable[$(this).attr("id")] = $(this).text();
31                        //$(this).next('dd').text();
32                });
33         },'html');
34
35};
36/*
37function loadAdminFile(){
38        json_admin = {'Admin':{'maxqid':'0','QueryIndices':'null'}};
39       
40        jQuery.getJSON("/MDService2/workspaceprofile/admin",function(data){
41                        json_admin = preprocessJSON(data);
42        });
43}
44*/
45function loadWorkspaceProfiles(){
46        //empty json
47        workspace.user_json  = {'WorkspaceProfile':{'CustomTermsets':'null','Termsets':'null','Repositories':'null','Querysets':'null','created':'null','lastchanged':'null','profilename':'null'}};
48        $('#qts_input').val("");
49       
50        $.ajaxSetup({"error":function(XMLHttpRequest,textStatus, errorThrown) {   
51              alert(textStatus); 
52              alert(errorThrown); 
53              alert(XMLHttpRequest.responseText); 
54          }}); 
55 
56
57        // server profile first - options needed
58        jQuery.getJSON("/MDService2/workspaceprofile/json/server",function(sdata){
59                                //notifyUser(sdata['WorkspaceProfile'],'debug');
60                                var json = preprocessJSON(sdata);
61                                workspace.server_json = json;
62                                $("#serverqs").attr("data",JSON.stringify(json));
63                                loadQuerysets("server");
64                                loadRepositories(workspace.server_json["WorkspaceProfile"]["Repositories"]);
65                                loadCollections(true);                         
66                                loadTerms();
67                                loadTermsAutocomplete();
68                                loadQueryFromUriParams();
69                                createTooltip(null);
70                               
71                                // USER WORKSPACEPROFILE
72                                jQuery.getJSON("/MDService2/workspaceprofile/json/user",function(data){
73                                                        notifyUser(data['WorkspaceProfile'],'debug');
74                                                        workspace.user_json  = preprocessJSON(data);
75                                                        loadQuerysets("user");
76                                                        loadBookmarksets();
77                                                        createTooltip(this);
78                                });
79                               
80                });
81       
82       
83       
84
85}
86
87function loadCollections(ini){
88        var coll_uri = link('collections','htmllist?repository=' + getSelectedRepository());
89               
90        $("#collections").jstree({ 
91                "html_data" : {
92                        "ajax" : {
93                                "url" : coll_uri,
94                                "data" : function (n) { 
95                                        return {  //id : n.attr ? n.attr("id") : 0 ,
96                                                          collection : n.attr ? n.attr("handle") : "",
97                                                          maxdepth : n.attr ? 2 : 1 };
98                                }
99                        }
100                },
101                types : {
102                        // the default type
103                        "default" : {
104                                "max_children"  : -1,
105                                "max_depth"             : -1,
106                                "valid_children": "all"
107
108                }
109                },
110
111                "plugins" : [ "themes", "html_data", "ui" , "checkbox", "types", "search" ]
112        });
113       
114        $('#collections').bind('loaded.jstree reopen.jstree', function(event, data)
115                        {
116                                if ((event.type == "loaded") &&(ini)) {
117                                        loadQueryFromUriParams();
118                                }
119                               
120                                var dataelems = data.inst.get_container();
121                                createTooltip($(dataelems));
122                                        //data.inst.get_container().unblock();         
123                });
124
125        $('#collections').bind("change_state.jstree", function (event, data) {
126                var dataelems = data.inst.get_container();
127                var coll;
128                if (!local_collections){
129                        var collections  = [];
130                        //collections.splice(0, collections.length);
131                       
132                        $(this).find('.jstree-checked').each(function(index){
133                                if (!($(this).parent().parent().hasClass("jstree-checked")) ) {
134                                        //notifyUser("selection...:" + index + ":" + String.trim($(this).children('a').text())  + $(this).attr("handle"),'debug');     
135                                        coll = new Collection($(this).attr("handle"), String.trim($(this).children('a').text()));
136                                        collections[collections.length] = coll;                                         
137                                }
138                        });
139                       
140                        collections_widget.load(collections);
141                }
142    });
143       
144        $('#collections').bind("search.jstree", function (e, data) { 
145               
146                if (data.rslt.nodes.length > 0){
147                        $('#collections').jstree("checkbox.check_node",data.rslt.nodes[0]);
148                }
149                //alert("Found " + data.rslt.nodes.length + " nodes matching '" + data.rslt.str + "'."); 
150    }); 
151
152};
153
154function updateCollectionTree(){
155        /*
156        local_collections = true;
157        var cc = $('#collections').jstree("get_checked");
158        $('#collections').jstree("uncheck_all");
159        $.each(collections, function(){
160                $('#collections').jstree("search",this.name);
161        });
162        local_collections = false;
163        */
164};
165
166function loadTerms(){
167        $('#model_profiles').load(link('terms','htmlselect',actions.terms.current) + '?repository=' + getSelectedRepository());
168       
169        $('#terms-select').live('change', function(event) {
170                //notifyUser(this.value,'debug');
171                update(link('terms', 'htmllist', this.value)+ '?maxdepth=' + actions.terms.maxdepth + '&repository=' + getSelectedRepository(), 
172                                '#terms-select', '#model_terms',
173                                        function() {
174                                                $("#model_terms .treeview").treeview({
175                                                        animated: "fast",
176                                                        collapsed: false
177                                                });
178                                                //notifyUser($("#model_terms .treeview"),'debug');
179                                                notifyUser("loaded: #model_terms .treeview",'debug');
180                                                createTooltip(this);
181                                                }       
182                        );     
183                }
184        );
185       
186        $('#terms .cmd_filter').live('click',  function(event) {                       
187                var term = $(this).parent().children('span.data').text();               
188                if ($('.searchtype_text','#search').size()> 0 ) {
189                        var t = $('#query_area').text();
190                        $('#query_area').val(t + " " + term);
191                } else {
192                        searchclauseset.updatedata(term);
193                       
194                }
195        });
196       
197        $('#terms .cmd_columns').live('click',  function(event) {       
198                var term = $(this).parent().children('span.data').text();
199                columns_widget.add(new ListItem(term)); 
200               
201        });     
202
203}
204
205function loadRepositories(json) {
206       
207        var $select;
208        $select = $('#repositories_select');
209       
210       
211        $select.find("option").remove();
212       
213        if (String(json) != "null") {
214               
215                $.each(json, function(i,item) {
216                    $select.append(new Option(this.name, this.id));
217                });
218               
219        }
220        // select first
221        if (url_params["repository"] != undefined){
222                var r = parseInt(url_params["repository"])-1;
223                $($select.find("option")[r]).attr("selected","true");
224        } else {
225                $select.find("option").first().attr("selected","true");
226        }
227
228       
229        $select.change(function(data){
230                if (workspace.getRepositoryType(getSelectedRepository())=='md'){
231                        loadCollections(false);                         
232                        loadTerms();
233                        loadTermsAutocomplete();
234                        $('#model_profiles').load(link('terms','htmlselect',actions.terms.current) + '?repository=' + getSelectedRepository());
235
236                }
237        });
238       
239}
240
241function loadTermsAutocomplete(){
242       
243        var elem;
244        $('#terms_autocomplete').children().remove();
245        $('#terms_autocomplete').css('display','none');
246        $('#terms_autocomplete').load(link('terms_autocomplete','autocomplete/?q=all&repository='+ getSelectedRepository()),function(){
247                $(this).find('term').each(function(index){
248                        elem = $(this).attr("name");
249                        element_autocomplete[index] = elem;
250                        elements_hashtable[elem] = $(this).html();
251                });
252                // add autocomplete 's
253                searchclauseset.initAutocomplete();
254                columns_widget.initAutocomplete(element_autocomplete);
255        });
256};
257
258// QUERYSETS UI
259function appendQueryUI(json,i, qs){
260        var del = '';
261        var name = '';
262        //var ul;
263        var id = $(qs).parent().attr('id');
264       
265        if (id == 'userqs') {
266                del = '<span class="cmd cmd_del" ><xsl:text> </xsl:text></span>';
267                name = '<div class="cmds-elem-prop"><span class="label">name:</span><input type="text" class="input-name" value="' + json.name + '"></div>';
268        } else {
269                name = '<div class="cmds-elem-prop"><span class="label">name:</span><span class="value">' + json.name +
270                '</span></div>';
271        }
272               
273        var timestr = "";
274        if (json.time != undefined){
275                timestr = json.time;
276        }
277        var qq = json.querystring;
278        if (qq == "[NULL]"){
279                qq = "";
280        }
281        var x = '<div class="cmds-elem-plus" ><span class="cmd cmd_load"></span><span class="detail-caller-inline" ><a href="'+id + '_'+ i+'" >' + 
282        json.name + '</a></span>' + 
283        del +
284        '<span class="cmd cmd_publish"></span><div class="detail" >' +
285        name +
286        '<div class="cmds-elem-prop"><span class="label">query:</span><span class="value">' + Query.simplequerystring(qq) + '</span></div>' + 
287        '<div class="cmds-elem-prop"><span class="label">collections:</span><span class="value">' + Query.collectiontext(json) + '</span></div>' +
288        '<div class="cmds-elem-prop"><span class="label">columns:</span><span class="value">' + Query.columnstext(json) + '</span></div>' +
289        '<div class="cmds-elem-prop"><span class="label">time:</span><span class="value">' + timestr + '</span></div>' +
290        //'<div class="cmds-elem-prop"><span class="label">startItem:</span><span class="value">' + Query.startItem + '</span></div>' +
291        //'<div class="cmds-elem-prop"><span class="label">maxItems:</span><span class="value">' + Query.maximumItems + '</span></div>' +
292        //'<div class="cmds-elem-prop"><span class="label">repository:</span><span class="value">' + Query.repository + '</span></div>' +
293        '<div class="cmds-elem-prop"><span class="label">bookmark:</span><span class="value">' + json.bookmark + '</span></div>' +
294        '<div class="cmds-elem-prop"><span class="label">options:</span><span class="value">' + Query.optionstext(json) +  '</span></div>' +
295        '</div>';
296       
297        //dt = Date.parse('2010-10-18, 10:06 AM'); dt.toString('dd/mm/yyyy HH:mm:ss GMT')
298        $(qs).append(x);
299       
300        var query = new Query([],"","");
301        query.load(json);
302        $(qs).find("[href='"+ id + "_" + i + "']").closest('.cmds-elem-plus').data('query',query);
303        $(qs).find("[href='"+ id + "_" + i + "']").closest('.cmds-elem-plus').data('queryjson',json);
304        $(qs).find("[href='"+ id + "_" + i + "']").closest('.cmds-elem-plus').find('.input-name').data('queryjson',json);
305        $(qs).find('.detail').css({'z-index' : '1000'});
306       
307        $(qs).find('.input-name').keydown(function(ev){
308                var evStop = function(){ 
309                        ev.stopPropagation(); 
310                        ev.preventDefault(); 
311                };
312                if (ev.which === 13) {
313                        $(this).data("queryjson").name = $(this).val();
314                        workspace.savequeryset($(this).data("queryjson"),0);
315                        //todo update
316                        $(this).parent().parent().parent().find('a').text($(this).val());
317                        //Workspace.save("user");
318                        //var query = new Query();
319                        //query.load($(this).data("queryjson"));
320                        //query.save();
321                        /*
322                        var id = parseInt( $("#qts_select option:selected").val());
323                        $(this).parent().parent().parent().find('a').text($(this).val());
324                        var str = $(this).parent().parent().parent().find('a').attr("href");
325                        var iq = parseInt(str.substring(7));
326                       
327                        jsonw["WorkspaceProfile"]["Querysets"][id]["Queries"][iq].name = $(this).val();
328                        //saveWorkspace("USER");
329                        Workspace.save("USER");
330                        */
331                        evStop();
332                }
333        });
334        createTooltip(qs);
335}
336
337function createQueriesUI(json, qs){
338        $(qs).children().remove();
339        if (json.Queries != "null") {
340                $.each(json.Queries, function(i,item) {
341                        if (this != "null"){
342                                appendQueryUI(this,i, qs);
343                        }
344                });
345        }
346       
347}
348function loadQuerysets(type) {
349       
350        var json = workspace.getTypedElement(type, 'queryset');
351        var $select;
352        if (type == "user") {
353                $select = $('#qts_select');
354        } else {
355                $select = $('#serverqts_select');
356        }
357       
358        $select.find("option").remove();
359       
360        if (String(json) != "null") {
361               
362                $.each(json, function(i,item) {
363                        //notifyUser(i + ',' + this.name + ',' + this.created,'debug');
364                    $select.append(new Option(this.name, i));
365                });
366               
367               
368                // find id of selected
369                if ($select.find("option").size() > 0) {
370                        $select.find("option").first().attr("selected","true");
371                        var id = parseInt($select.find("option:selected").val());
372                        var jsonq = json[id];
373                        //var jsonq = $select.find("option:selected").val();
374                       
375                        if (type == "user") {
376                                $('#qts_input').val(jsonq["name"]);
377                                qs = $("#userqueries");
378                        } else {
379                                qs = $("#serverqueries");
380                        }
381                        createQueriesUI(jsonq, qs);
382                }
383               
384                $select.change(function(data){
385                        if ($select.find("option").size() > 0) {
386                                // find id of selected
387                                var id = parseInt($select.find("option:selected").val());
388                                var jsonq = json[id];
389                                //var jsonq = $select.find("option:selected").val();
390                                       
391                                if (type == "user") {
392                                        $('#qts_input').val(jsonq["name"]);
393                                        qs = $("#userqueries");
394                                } else {
395                                        qs = $("#serverqueries");
396                                }
397                                createQueriesUI(jsonq, qs);
398                               
399                        }
400             });
401               
402        }
403
404}
405
406// BOOKMARKS UI
407function appendBookmarkUI(json,i, bs){
408        var del = '';
409        var name = '';
410        var id = $(bs).parent().attr('id');
411       
412        del = '<span class="cmd cmd_del" ><xsl:text> </xsl:text></span>';
413        name = '<div class="cmds-elem-prop"><span class="label">name:</span><input type="text" class="input-name" value="' + json.name + '"></div>';
414               
415        var timestr = "";
416        if (json.time != undefined){
417                timestr = json.time;
418        }
419        var squery = json.squerystring;
420        if (squery = "[NULL]"){
421                squery = "";
422        }
423        var qq = json.querystring;
424        if (qq = "[NULL]"){
425                qq = "";
426        }
427        var x = '<div class="cmds-elem-plus" ><span class="cmd cmd_load"></span><span class="detail-caller-inline" ><a href="'+ id + '_'+ i+'" >' + 
428        json.name + '</a></span>' + 
429        del +
430        '<div class="detail" >' +
431        name +
432        '<div class="cmds-elem-prop"><span class="label">squery:</span><span class="value">' + squery + '</span></div>' +
433        '<div class="cmds-elem-prop"><span class="label">query:</span><span class="value">' + Query.simplequerystring(qq) + '</span></div>' + 
434        '<div class="cmds-elem-prop"><span class="label">collections:</span><span class="value">' + Query.collectiontext(json) + '</span></div>' +
435        '<div class="cmds-elem-prop"><span class="label">columns:</span><span class="value">' + Query.columnstext(json) + '</span></div>' +
436        '<div class="cmds-elem-prop"><span class="label">time:</span><span class="value">' + timestr + '</span></div>' +
437        '<div class="cmds-elem-prop"><span class="label">bookmark:</span><span class="value">' + json.bookmark + '</span></div>' +
438        '<div class="cmds-elem-prop"><span class="label">options:</span><span class="value">' + Query.optionstext(json) +  '</span></div>' +
439        '</div>';
440         
441        $(bs).append(x);
442       
443        var query = new Query([],"","");
444        query.load(json);
445        $(bs).find("[href='"+ id + "_" + i + "']").closest('.cmds-elem-plus').data('query',query);
446        $(bs).find("[href='"+ id + "_" + i + "']").closest('.cmds-elem-plus').data('queryjson',json);
447        $(bs).find('.input-name').data('queryjson',json);
448        $(bs).find('.detail').css({'z-index' : '1000'});
449       
450        $(bs).find('.input-name').keydown(function(ev){
451                var evStop = function(){ 
452                        ev.stopPropagation(); 
453                        ev.preventDefault(); 
454                };
455                if (ev.which === 13) {
456                        $(this).data("queryjson").name = $(this).val();
457                        $(this).data("query").name = $(this).val();
458                        workspace.save("user");
459                       
460                        evStop();
461                }
462        });
463        createTooltip(qs);
464}
465
466function createBookmarksUI(json, bs){
467        $(bs).children().remove();
468        if (json.Bookmarks != "null") {
469                $.each(json.Bookmarks, function(i,item) {
470                        if (this != "null"){
471                                appendBookmarkUI(this,i, bs);
472                        }
473                });
474        }
475       
476}
477function loadBookmarksets() {
478       
479        var json = workspace.getTypedElement('user','bookmarkset');
480        var $select = $('#bts_select');
481       
482        $select.find("option").remove();
483       
484        if (String(json) != "null") {
485               
486                $.each(json, function(i,item) {
487                    $select.append(new Option(this.name, i));
488                });
489               
490               
491                // find id of selected
492                if ($select.find("option").size() > 0) {
493                        $select.find("option").first().attr("selected","true");
494                        var id = parseInt($select.find("option:selected").val());
495                        var jsonb = json[id];
496                       
497                        $('#bts_input').val(jsonb["name"]);
498                        //qs = $("#bookmarks");
499                       
500                        createBookmarksUI(jsonb,  $("#bookmarks"));
501                }
502               
503                $select.change(function(data){
504                        if ($select.find("option").size() > 0) {
505                                // find id of selected
506                                var id = parseInt($select.find("option:selected").val());
507                                var jsonq = json[id];
508                                       
509                                $('#bts_input').val(jsonq["name"]);
510                                bs = $("#bookmarks");
511                               
512                                createBookmarksUI(jsonq, bs);
513                               
514                        }
515             });
516               
517        }
518
519}
520
521function  preprocessJSON(json){
522        if (json["Admin"] != undefined) {
523                if (json["Admin"]["QueryIndices"] != undefined){
524                        if (String(json["Admin"]["QueryIndices"]) != "null") {
525                                if (json["Admin"].QueryIndices[0] == undefined){
526                                        var jj = json["Admin"]["QueryIndices"]["item"];
527                                        delete json["Admin"]["QueryIndices"]["item"];
528                                        json["Admin"]["QueryIndices"] = [{}];
529                                        json["Admin"]["QueryIndices"][0] = jj;
530                                }
531                        }
532                }
533        }
534       
535       
536        if (json["WorkspaceProfile"]["CustomTermsets"] != undefined){
537       
538        if (String(json["WorkspaceProfile"]["CustomTermsets"]) != "null") {
539                if (json["WorkspaceProfile"].CustomTermsets[0] == undefined){
540                        var jj = json["WorkspaceProfile"]["CustomTermsets"]["item"];
541                        delete json["WorkspaceProfile"]["CustomTermsets"]["item"];
542                        json["WorkspaceProfile"]["CustomTermsets"] = [{}];
543                        json["WorkspaceProfile"]["CustomTermsets"][0] = jj;
544                }
545       
546               
547                $.each(json["WorkspaceProfile"]["CustomTermsets"], function(i,item) {
548                    if (this.Terms[0] == undefined){
549                        var jj = this["Terms"]["item"];
550                                delete this["Terms"]["item"];
551                                this.Terms = [{}];
552                        this.Terms[0] = jj;
553                    }
554                });
555        }
556        }
557        if (json["WorkspaceProfile"].Querysets[0] == undefined){
558                var jj = json["WorkspaceProfile"]["Querysets"]["item"];
559                delete json["WorkspaceProfile"]["Querysets"]["item"];
560                json["WorkspaceProfile"]["Querysets"] = [{}];
561                json["WorkspaceProfile"]["Querysets"][0] = jj;
562                }
563        if (json["WorkspaceProfile"].Bookmarksets[0] == undefined){
564                var jj = json["WorkspaceProfile"]["Bookmarksets"]["item"];
565                delete json["WorkspaceProfile"]["Bookmarksets"]["item"];
566                json["WorkspaceProfile"]["Bookmarksets"] = [{}];
567                json["WorkspaceProfile"]["Bookmarksets"][0] = jj;
568                }
569
570        if (String(json["WorkspaceProfile"]["Querysets"]) != "null") {
571               
572                $.each(json["WorkspaceProfile"]["Querysets"], function(i,item) {
573                    if (this.Queries[0] == undefined){
574                        var jj = this["Queries"]["item"];
575                                delete this["Queries"]["item"];
576                                this.Queries = [{}];
577                        this.Queries[0] = jj;
578                    }
579                });
580               
581                $.each(json["WorkspaceProfile"]["Querysets"], function(i,item){
582                        if (String(this.Queries) != "null") {
583                                $.each(this.Queries, function(i,item){
584                                        if (this.collections != "null") {
585                                                if (this.collections[0] == undefined){
586                                                var jj = this["collections"]["item"];
587                                                        delete this["collections"]["item"];
588                                                        this.collections = [{}];
589                                                this.collections[0] = jj;
590                                            }
591                                        }
592                                        if (this.columns != "null") {
593                                                if (this.columns[0] == undefined){
594                                                var jj = this["columns"]["item"];
595                                                        delete this["columns"]["item"];
596                                                        this.columns = [{}];
597                                                this.columns[0] = jj;
598                                            }
599                                        }
600                                });
601                        }
602                });
603        }
604       
605       
606        if (String(json["WorkspaceProfile"]["Bookmarksets"]) != "null") {
607               
608                $.each(json["WorkspaceProfile"]["Bookmarksets"], function(i,item) {
609                    if (this.Bookmarks[0] == undefined){
610                        var jj = this["Bookmarks"]["item"];
611                                delete this["Bookmarks"]["item"];
612                                this.Bookmarks = [{}];
613                        this.Bookmarks[0] = jj;
614                    }
615                });
616               
617                $.each(json["WorkspaceProfile"]["Bookmarksets"], function(i,item){
618                        if (String(this.Bookmarks) != "null") {
619                                $.each(this.Bookmarks, function(i,item){
620                                        if (this.collections != "null") {
621                                                if (this.collections[0] == undefined){
622                                                var jj = this["collections"]["item"];
623                                                        delete this["collections"]["item"];
624                                                        this.collections = [{}];
625                                                this.collections[0] = jj;
626                                            }
627                                        }
628                                        if (this.columns != "null") {
629                                                if (this.columns[0] == undefined){
630                                                var jj = this["columns"]["item"];
631                                                        delete this["columns"]["item"];
632                                                        this.columns = [{}];
633                                                this.columns[0] = jj;
634                                            }
635                                        }
636                                });
637                        }
638                });
639        }
640        return json;
641       
642}
643
644
645
646
647function saveTermset(id, name, listwidget) {
648       
649
650        var terms = [{}];       
651       
652        $.each(listwidget.widgets,function(i,elem){
653                terms[i] = elem.name;
654        });
655       
656        var dt = new Date();
657        var str_time = dateFormat(dt);//dt.toString("dd/mm/yyyy HH:mm:ss");
658        var jsont = {"name":name, "time" : str_time, "Terms" :terms};
659
660        workspace.addelement("customtermset",jsont);
661        workspace.save("user");
662/*
663        if (jsonw["WorkspaceProfile"]["CustomTermsets"] == "null") {
664                jsonw["WorkspaceProfile"]["CustomTermsets"] = [{}];
665                if (id == -1) {id = 0;};
666        }
667        if (id == -1) {id = jsonw["WorkspaceProfile"]["CustomTermsets"].length;};
668        jsonw["WorkspaceProfile"]["CustomTermsets"][id] = jsont;
669       
670        //saveWorkspace("USER");
671        Workspace.save("USER");
672*/
673};
674function removeTermset(id){
675        workspace.removeelement("customtermset",id);
676        workspace.save("user");
677        /*
678        var size = jsonw["WorkspaceProfile"]["CustomTermsets"].length;
679
680        for (var i=id;i<size-1;i++){
681                jsonw["WorkspaceProfile"].CustomTermsets[i] = jsonw["WorkspaceProfile"].CustomTermsets[i+1];
682        }
683
684        delete jsonw["WorkspaceProfile"].CustomTermsets[size-1];
685        jsonw["WorkspaceProfile"]["CustomTermsets"].length = size-1;
686        // set null string , if 0
687        if (size == 1) {
688                jsonw["WorkspaceProfile"]["CustomTermsets"] = "null";
689        }
690        //saveWorkspace("USER");
691        Workspace.save("USER");
692        */
693}
694
695/*
696function loadWelcomeMessage(){ 
697        $('#welcomedetail').load("/MDService2/docs/xml/welcome #welcome", function() { //profile.collections.base_uri,
698                $('#welcome').addClass("ui-helper-reset ui-corner-all ui-widget-content");
699        });
700}
701*/
Note: See TracBrowser for help on using the repository browser.