/**
    Create an Ext.tree.TreePanel in the passed Element using
    an XML document from the passed URL, calling the passed
    callback on completion.
    @param el {String/Element/HtmlElement} The tree's container.
    @param url {String} The URL from which to read the XML
    @param callback {function:tree.render} The function to call on completion,
        defaults to rendering the tree.
*/
function createXmlTree(el, url, callback) {
    
var tree = new Ext.tree.TreePanel(el);
    
var p = new Ext.data.HttpProxy({url:url});
    p.on(
"loadexception"function(o, response, e) {
        
if (e) throw e;
    });
    p.load(
null, {
        read: 
function(response) {
            
var doc = response.responseXML;
            tree.setRootNode(treeNodeFromXml(doc.documentElement 
|| doc));
        }
    }, callback 
|| tree.render, tree);
    
return tree;
}
 
/**
    Create a TreeNode from an XML node
*/
function treeNodeFromXml(XmlEl) {
//    Text is nodeValue to text node, otherwise it's the tag name
    var t = ((XmlEl.nodeType == 3? XmlEl.nodeValue : XmlEl.tagName);

//    No text, no node.
    if (t.replace(/\s/g,'').length == 0) {
        
return null;
    }
    
var result = new Ext.tree.TreeNode({
        text : t
    });

//    For Elements, process attributes and children
    if (XmlEl.nodeType == 1) {
        Ext.each(XmlEl.attributes, 
function(a) {
            
var c = new Ext.tree.TreeNode({
                text: a.nodeName
            });
            c.appendChild(
new Ext.tree.TreeNode({
                text: a.nodeValue
            }));
            result.appendChild(c);
        });
        Ext.each(XmlEl.childNodes, 
function(el) {
//        Only process Elements and TextNodes
            if ((el.nodeType == 1|| (el.nodeType == 3)) {
                
var c = treeNodeFromXml(el);
                
if (c) {
                    result.appendChild(c);
                }
            }
        });
    }
    
return result;
}

回头有空添加详细注解~~原文中6楼有更详细的解答  http://extjs.com/forum/showthread.php?t=3987




posted @ 2008-12-30 11:23 Robert Su 阅读(933) | 评论 (0)编辑 收藏

Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'RssService' defined in ServletContext resource
 [/WEB-INF/vbm_dao.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException:
 Invalid property 'rssDao' of bean class [gov.ict.mcg.vbm.services.impl.RssServiceImpl]: Bean property 'rssDao'
 is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
Caused by: org.springframework.beans.NotWritablePropertyException: Invalid property 'rssDao' of bean class
[gov.ict.mcg.vbm.services.impl.RssServiceImpl]: Bean property 'rssDao' is not writable or has an invalid setter method.
 Does the parameter type of the setter match the return type of the getter?
    at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:793)


原因:
RssServiceImpl类中忘记添加dao的get set方法~~~

posted @ 2008-12-29 17:14 Robert Su 阅读(285) | 评论 (0)编辑 收藏

Eclipse3.2装WTP时提示我需要需要3.4的功能组件
直接download~~~eclipse-jee-ganymede-win32.zip
就可以了

posted @ 2008-12-26 11:09 Robert Su 阅读(558) | 评论 (0)编辑 收藏

把日期改成int型的,比如20081029
然后对这个字段建索引

posted @ 2008-12-19 10:23 Robert Su 阅读(188) | 评论 (0)编辑 收藏

cosmos框架主要用来做中小项目开发,丢弃了传统的SSH架构,利用纯的Servlet+JDBC实现数据库操作。开发Web项目,可以实现无需写Java代码, 而实现业务逻辑,并且由于不需要写Java代码,因此,可以不需要重启和重新部署项目,就可以直接测试,达到了开发->刷新测试的水平。根据目前多 个项目的应用实践看来,基本上可以提高一倍到2/3的开发时间,而且性能比起SSH架构还要高,框架还要更加轻量级。因此,这个框架还是比较能够体现敏捷 开发的思想的。

由于框架摒弃了Hibernate的O/R Mapping工具,因此有一个比较大的问题就是关于数据库移植性的问题,但是,根据公司对于中小项目的经验,一旦客户要移植数据库,几乎就需要重新实现业务逻辑了,因此,对于中小项目来说,这是一个不错的选择。

——————
官方介绍:

cosmos框架 是一个对于底层数据库、Web服务、JNDI等进行统一界面封装的框架,提供统一的调用接口,并采用命令设计模式,将所有需要调用的命令放置到数据库(或 者其他域)中去,从而可以改变传统的j2ee应用调试的流程:开发-部署-测试或者开发-部署-重新启动-测试,达到像PHP、PERL那样的开发 ->测试的模式。有效地提高了开发速度。

由于其抛弃了所有的中间层次,包括像Struts、Spring、Hibernate这样的框架,调用数据库应用直接用JDBC的方式进行,因此有效地提高了运行性能。 由于开发的代码可以完全放置到数据库中,因此,可以比较容易地实现共享开发,从而有效地调动起开发人员的积极性。 在cosmos框架中开发一个数据库应用的流程是:开发SQL语句或者存储过程或者函数;然后开发JSP页面进行展示;最后测试结果。完全地省略了开发Java代码的过程,因此,有效地提高了开发速度。 cosmos框架是一个能有效地应用于中小项目的框架,可以供开发人员快速建立原型,从而实现敏捷开发的目的。 在框架中还包括权限和认证的部分框架,因此,用户可以简单地实现用户认证和系统权限的功能。


http://code.google.com/p/cosmos4j/

posted @ 2008-12-18 16:56 Robert Su 阅读(610) | 评论 (0)编辑 收藏

谷歌对亚洲市场的关注,使这家公司在《亚洲华尔街日报》举办的“亚洲最受尊敬跨国公司”读者调查中,排名大幅度提升。在“最能满足消费者需求的创新公司”分类排行榜上,谷歌位居榜首。这是该公司连续第二年蝉联创新公司的冠军。这一排行榜评选的是读者心目中最善于向市场提供新产品和新服务的公司,以及客户服务最为周到的公司。

<汉译英>

The Asian focus has helped propel Google up the charts in The Wall Street Journal Asia's reader survey of Asia's most-admired multinationals. Google grabbed the No. 1 spot in the featured category, 'Innovative in Responding to Customer Needs.' It is the second survey in a row Google has held the top spot as an innovator, a category that asks readers to tell us which companies they consider best at bringing new products and services to the market as well as at employing sophisticated customer service.

posted @ 2008-12-15 00:57 Robert Su 阅读(116) | 评论 (0)编辑 收藏

现在这个Grid的右键弹出菜单存在一个问题就是右键单击的时候无法直接选择Grid中的一行
    //right menu
            grid.on('rowcontextmenu', rightClickFn,grid);
            
var rightClick = new Ext.menu.Menu({
                id:'rightClickCont',
                items: [
                    {
                        id: 'rMenu1',
                        scope:
this,
                        text: '审核:1',
                        handler:
function(){auditWebVideoSecond(grid,1,true);}
                    },
                    {
                        id: 'rMenu2',
                        scope:
this,
                        text: '审核:2',
                        handler:
function(){auditWebVideoSecond(grid,2,true);}
                    },
                    {
                        id: 'rMenu3',
                        scope:
this,
                        text: '审核:3',
                        handler:
function(){auditWebVideoSecond(grid,3,true);}
                    },
                    {
                        id: 'rMenu4',
                        text:'审核:4',
                        scope:
this,
                        handler:
function(){auditWebVideoSecond(grid,4,true);}
                    }
                ]
            });
            
            
function rightClickFn(grid,rowIndex,e){
                e.preventDefault();
                rightClick.showAt(e.getXY());                    
            }
function auditWebVideoSecond(videoGrid,flag,change){
    
    
var datas = grid.getSelectionModel().getSelections();
    
if(datas.length <= 0)
        
return;

    
if(!inputwindow){
         
var form = new Ext.form.FormPanel({
                        
//baseCls: 'x-plain',
                        labelWidth: 55,
                        frame:
true,
                        id:'inputwindow_form',
                        items: [
                         {
                            xtype:'fieldset',
                            title: '处理建议',
                            collapsible: 
false,
                            autoHeight:
true,
                            width: 
350,
                            defaults: {width: 
330},
                            defaultType: 'textarea',
                            items: [{
                                hideLabel:
true,
                                xtype:'textarea',
                                name: 'remark',
                                height:
80,
                                id: 'remark'
                            }]},
                             {
                            xtype:'fieldset',
                            title: '节目来源',
                            collapsible: 
false,
                            autoHeight:
true,
                            width: 
350,
                            defaults: {width: 
330},
                            defaultType: 'textfield',
                            items: [{
                                hideLabel:
true,
                                xtype:'textarea',
                                height:
40,
                                name: 'program_source',
                                id: 'program_source'
                            }]},
                        {
                            xtype:'fieldset',
                            layout:'column',
                            id:'priority_group',
                            title: '节目重要程度',
                            collapsible: 
false,
                            autoHeight:
true,
                            width: 
350,
                            items: [
                            {
                                width:
60,
                                layout: 'form',
                               
// labelWidth: 10,
                                items: new Ext.form.Radio({id:'priority0',name:'priority',value:"",hideLabel:true,boxLabel:'无',checked:true})
                            },
                             {
                                width:
80,
                                layout: 'form',
                                
//labelWidth: 40,
                                items: [new Ext.form.Radio({id:'priority1',name:'priority',value:"0",hideLabel:true,boxLabel:'一般'})]
                            },
                             {
                                width:
80,
                                layout: 'form',
                                
//labelWidth: 40,
                                items: [new Ext.form.Radio({id:'priority2',name:'priority',value:"1",hideLabel:true,boxLabel:'重要'})]
                            }]                            
                            
                        }
                        ]
                    });
                    
                   inputwindow 
= new Ext.Window({
                                    title: '处理建议',
                                    width: 
400,
                                    height:
300,
                                    layout: 'fit',
                                    bodyStyle:'padding:10px;',
                                    buttonAlign:'center',
                                    resizable:
false,
                                    closeAction:'hide',
                                    modal:
true,
                                    items: form,
                                    buttons: [{
                                        text: '保存',
                                        id:'save_function',
                                   },{
                                                    text: '取消',
                                                    handler:
function(){
                                                        inputwindow.hide();
                                                    }
                                                }]
                                            });            
                                        
                                }
                 
   
if(flag =='1')
   inputwindow.setTitle('处理建议[1]');
   
else if(flag =='2')
   inputwindow.setTitle('处理建议[2]');
   
else if(flag =='3')
   inputwindow.setTitle('处理建议[2]');
   
else if(flag =='4')
   inputwindow.setTitle('处理建议[4]');
   inputwindow.show();
   

}


posted @ 2008-12-12 17:36 Robert Su 阅读(696) | 评论 (0)编辑 收藏

一个树形菜单静态化到客户端成一个数组的测试js:
var tree_arr=[[1,'新浪播客','0'],[2,'tom','0'],[3,'网易播吧','0'],[4,'新浪播客子博客1','1'],[5,'新浪播客子博客2','1']];

var root=new Ext.tree.TreeNode({
      id:
"root",
      text:
"控制面板",
      expanded:
true
});
var mytree=new Ext.tree.TreePanel({
      el:
"tree",
     
      animate:
true,
      title:
"Extjs静态树",
      collapsible:
true,
      enableDD:
false,
      enableDrag:
false,
      rootVisible:
true,
      autoScroll:
true,
      trackMouseOver:
false,//false则mouseover无效果
      useArrows:false,
      width:
150,
      lines:
true 
  });
function get_root()
{
    
var result=new Array();
    
/*
    for(var i=0; i<tree_arr.length; i++)
        if(0 == tree_arr[i][2])
           root.appendChild(new Ext.tree.TreeNode({
                  id:tree_arr[i][0],
                 text:tree_arr[i][1]
         }));
    
*/
    
var j=0;                
     
for(var i=0; i<tree_arr.length; i++){
     
if(0 == tree_arr[i][2]){
     result[j
++]=tree_arr[i];
         }
     }
    
return result;
}
function get_sub(parentId)
{
    
var result=new Array();
    
/*
    for(var i=0; i<tree_arr.length; i++){
        if(0 != tree_arr[i][0]){
            //var temp=Ext.tree.getNodeById(tree_arr[i][0]);
            alert(mytree.getNodeById('1'));
            mytree.getNodeById('1').appendChild(new Ext.tree.TreeNode({
                  id:tree_arr[i][0],
                 text:tree_arr[i][1]
                             }));
        }    
    }
    
*/
    
var j=0;
    
for(var i=0; i<tree_arr.length; i++){
    
if(parentId==tree_arr[i][2]){
    result[j]
=tree_arr[i];
    j
++;
    }
    }
    
return result;
}


//生成标签页
var tab = new Ext.TabPanel({
            region:'center',
            deferredRender:
false,
            activeTab:
0,
            resizeTabs:
true// turn on tab resizing
            minTabWidth: 115,
            tabWidth:
135,
            enableTabScroll:
true
        });

Ext.onReady(
function(){
   
//layout
   var viewport = new Ext.Viewport({
        layout:'border',
        items:[
            
new Ext.BoxComponent({
                region:'north',
                el: 'north',
                height:
80
            }),
new Ext.BoxComponent({
                region:'south',
                el: 'south',
                height:
25
            }),{
            region:'west',
            id:'west
-panel',
            split:
true,
            width: 
200,
            minSize: 
175,
            maxSize: 
400,
            margins:'
0 0 0 0',
            layout:'accordion',
            title:'系统菜单',
            collapsible :
true,
            layoutConfig:{
                animate:
true
                },
            items: [
                {
                    title:'EXT控件使用',
                    border:
false,
                    html:'
<div id="tree-div" style="overflow:auto;width:100%;height:100%"></div>'
                    
//iconCls:'nav'
                }]
            },
        tab
//初始标签页
         ]
    });

    
//设置树形面板
    var Tree = Ext.tree;
    
// set the root node
    var root = new Tree.AsyncTreeNode({
        text: 'Ext JS',
        draggable:
false,
        id:'root'
    });

var resultRoot=get_root();
for(var i=0;i<resultRoot.length;i++){
    
var rootNode=new Ext.tree.TreeNode({
                  id:resultRoot[i][
0],
                 text:resultRoot[i][
1]
         });
 
var resultSub=get_sub(resultRoot[i][0]);
 
for(var j=0;j<resultSub.length;j++){
    
var subNode=new Ext.tree.TreeNode({
                  id:resultSub[i][
0],
                 text:resultSub[i][
1]
         });
     rootNode.appendChild(subNode);
 }    
  root.appendChild(rootNode);
}                    

var contextmenu=new Ext.menu.Menu({
    id:'Context',
    items:[{
        text:'R_menu1',
        handler:
function(){
            alert('click');
        }
    }
    ]
    
});    

mytree.on('contextmenu',
function(node,e){
    e.preventDefault();
    node.select();
    contextmenu.showAt(e.getXY());
});    
    
mytree.setRootNode(root);
//设置根节点
mytree.render();


});
Ext.fly(A) is null 开始的时候一直提示这个错误~
后来发现firebug一直提示这个错误,每次调试的时候清空下cache比较好~~~

posted @ 2008-12-12 10:39 Robert Su 阅读(11888) | 评论 (1)编辑 收藏

今天数据库直接超过4G,查了下原来是索引问题,一个索引占了2G大小~~

posted @ 2008-12-09 11:53 Robert Su 阅读(213) | 评论 (0)编辑 收藏

 

<?xml version="1.0" encoding="UTF-8"?>
<web-app>
 <display-name>系统</display-name>
 <context-param>
  <param-name>log4jConfigLocation</param-name>
  <param-value>/WEB-INF/log4j.properties</param-value>
 </context-param>
 <!-- ContextConfigLocation -->
 <context-param>
  <param-name>contextConfigLocation</param-name>
  <param-value>/WEB-INF/vbm_action.xml,/WEB-INF/vbm_hibernate.xml,/WEB-INF/vbm_dao.xml</param-value>
 </context-param>

 <!-- 著名 Character Encoding filter -->

 <filter>
  <filter-name>encodingFilter</filter-name>
  <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
  <init-param>
   <param-name>encoding</param-name>
   <param-value>UTF-8</param-value>
  </init-param>
 </filter>
 <filter>
  <filter-name>struts2</filter-name>
  <filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
  <init-param>
   <param-name>config</param-name>
   <param-value>struts-default.xml,struts-plugin.xml,struts.xml,struts_books.xml</param-value>
  </init-param>
 </filter>

 <filter-mapping>
  <filter-name>encodingFilter</filter-name>
  <url-pattern>/*</url-pattern>
 </filter-mapping>
 <filter-mapping>
  <filter-name>struts2</filter-name>
  <url-pattern>/*</url-pattern>
 </filter-mapping>
 <!-- 加入jpaFilter,是为了不让hibernate的session过早关闭,因为有的action会通过ajax动态调用 -->
 <filter>
  <filter-name>jpaFilter</filter-name>
  <filter-class>org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter</filter-class>
  <init-param>
   <param-name>entityManagerFactory</param-name>
   <param-value>entityManagerFactory</param-value>
  </init-param>
 </filter>
 <filter-mapping>
  <filter-name>jpaFilter</filter-name>
  <url-pattern>*.htm</url-pattern>
 </filter-mapping>
 <!-- Listener contextConfigLocation -->
 <listener>
  <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
 </listener>
 <!-- Listener log4jConfigLocation -->
 <listener>
  <listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
 </listener>
 <!-- Spring 刷新Introspector防止内存泄露 -->
 <listener>
  <listener-class>org.springframework.web.util.IntrospectorCleanupListener</listener-class>
 </listener>
 <!-- session超时定义,单位为分钟 -->
 <session-config>
  <session-timeout>10</session-timeout>
 </session-config>
 <!-- The Welcome File List -->
 <welcome-file-list>
  <welcome-file>index.html</welcome-file>
 </welcome-file-list>
</web-app>

posted @ 2008-12-08 11:18 Robert Su 阅读(226) | 评论 (0)编辑 收藏

仅列出标题
共11页: First 上一页 3 4 5 6 7 8 9 10 11 下一页 

posts - 103, comments - 104, trackbacks - 0, articles - 5

Copyright © Robert Su