| Steven's profile永远的第一天PhotosBlogLists | Help |
|
July 05 request,session属性一览
内建对象
July 04 登陆界面4##STEPXX: End to process request for /portal/layout[DEBUG PortalRequestProcessor] ------------ Success to process Parent Service ------------[DEBUG MainServlet] #STEP14: Process SERVLET_SERVICE_EVENTS_POST[DEBUG MainServlet] ##STEP01: Process requestURI[DEBUG ServicePostAction] ##STEP02: Get ThemeDisplay from request and clean up it[DEBUG ServicePostAction] Recycling instance 22705162[DEBUG ThemeDisplay] Recycling or initial instance 8510245[DEBUG PortletDisplay] ##STEP03: Clear all messages and error messages stored in session attribute[DEBUG ServicePostAction] #STEP15: Add liferay release info into request header[DEBUG MainServlet] #STEP16: Clear the principal associated with this thread[DEBUG MainServlet] Set Name null[DEBUG PrincipalThreadLocal] #STEPXX: MainServlet End to process request '/c/portal/layout'[DEBUG MainServlet] ......... FriendlyURLServlet End to process request ......... Stripping http://localhost/web/guest/home[DEBUG StripFilter] Stripping content of type text/html; charset=UTF-8[DEBUG StripFilter] Stripped the contecnt from 24367 bytes to 21492 bytes[DEBUG StripFilter] >>> End StripFilter <<< >>> End SecureFilter <<< >>> End CompressionFilter <<< 登陆界面3PortalUtil.getLayoutViewPage(Home)[portal\layout.jsp] liferay:include page='/html/portal/layout/view/portlet.jsp'[portal\layout.jsp] *******************************[Begin to process 'layout\view\portlet.jsp']*************************** Totla has 1 columns; 0 narrow1 portlets; 0 narrow2 portlets; 1 wide1 portlets[layout\view\portlet.jsp] Render portlet '57_INSTANCE_GuSK' at [w1,0]
Begin to render portlet 57_INSTANCE_GuSK[DEBUG PortalUtil] Set portlet,curColumnOrder,curColumnCount in request all will be used in render_portlet.jsp[DEBUG PortalUtil] Set request dispatcher /html/portal/render_portlet.jsp[DEBUG PortalUtil] pageContext is not null , wrapper response to StringServletResponse[DEBUG PortalUtil] Create CachePortlet for portlet 57_INSTANCE_GuSK[portal\render_portlet.jsp] Create CachePortlet {PortletId 57_INSTANCE_GuSK; PortletType com.liferay.portal.model.Portlet}[DEBUG PortletInstanceFactory] No portlet instances cache for '57' create one and put it into cache[DEBUG PortletInstanceFactory] No portlet instance cache for '57_INSTANCE_GuSK' create one and put it into cache[DEBUG PortletInstanceFactory] Create PortletContext and PortletConfigImpl for '57_INSTANCE_GuSK'[DEBUG PortletConfigFactory] Create new PortletContextImpl by ctx 'org.apache.catalina.core.ApplicationContextFacade@d9b7c1'[DEBUG PortletContextFactory] Initial portlet by portlet config[DEBUG PortletInstanceFactory] Real portlet initial PortletConfig[DEBUG CachePortlet] Initial struts portlet[DEBUG StrutsPortlet] Try to get PortletPreferences by 57_INSTANCE_GuSK[portal\render_portlet.jsp] Get PortletConfig and PortletContext[portal\render_portlet.jsp] Get PortletConfig for '57_INSTANCE_GuSK' from portletConfigs pool[DEBUG PortletConfigFactory] Create Render Request Implement [portal\render_portlet.jsp] Get one RenderRequestImpl from pool and inital it[DEBUG RenderRequestFactory] Creating new instance 15565667[DEBUG RenderRequestImpl] Init RenderRequestImpl 15565667[DEBUG RenderRequestImpl] Wrap the request as DynamicServletRequest[DEBUG RenderRequestImpl] Create new PortletSessionImpl[DEBUG RenderRequestImpl] Initialize PortletSession 12355216[DEBUG PortletSessionImpl] Create Render Response Implement [portal\render_portlet.jsp] Get one RenderResponseImpl from pool and inital it[DEBUG RenderResponseFactory] Creating new instance 33379524[DEBUG RenderRequestImpl] Init RenderResponseImpl 33379524[DEBUG RenderRequestImpl] Set portletConfig and renderResponseImpl into request attribute[portal\render_portlet.jsp] Unauthenticated users cannot modify the layout[portal\render_portlet.jsp] Portlets cannot be moved because they didn't belong to any layouts[portal\render_portlet.jsp] Reset portletDisplay and put all parameter into portletDisplay[portal\render_portlet.jsp] Recycling or initial instance 8510245[DEBUG PortletDisplay] CachePortlet begin to render[portal\render_portlet.jsp] Real portlet begin to render[DEBUG CachePortlet] Get PortletRequestProcessor to process request and response[DEBUG StrutsPortlet] Get PortletRequestProcessor from PortletContext '21259641'[DEBUG StrutsPortlet] Can not find struts action in request parameter , try to get it from attribute[DEBUG PortletRequestProcessor] Process path return /journal_content/view[DEBUG PortletRequestProcessor] Process roles[DEBUG PortletRequestProcessor] Get article HOME-INDEX, using language en_US, showPortletBorders false[DEBUG ViewAction] Get jounal article {articleId=HOME-INDEX, version=1.0}[DEBUG JournalArticleServiceImpl] Get journal template(XML and XSL) by HOME-INDEX[DEBUG JournalArticleServiceImpl] Transforming HOME-INDEX 1.0 en_US[DEBUG JournalArticleServiceImpl] Get PortletRequestDispatcherImpl from portlet context and use include method[DEBUG PortletRequestProcessor] getName null[DEBUG PrincipalThreadLocal] getName null[DEBUG PrincipalThreadLocal] getName null[DEBUG PrincipalThreadLocal] getName null[DEBUG PrincipalThreadLocal] Begin to process runtime portlet [journal_content\view.jsp] Creating new instance 25417229[DEBUG PortletDisplay]
Begin to render portlet 58[DEBUG PortalUtil] Set portlet,curColumnOrder,curColumnCount in request all will be used in render_portlet.jsp[DEBUG PortalUtil] Set request dispatcher /html/portal/render_portlet.jsp[DEBUG PortalUtil] pageContext is not null , wrapper response to StringServletResponse[DEBUG PortalUtil] Create CachePortlet for portlet 58[portal\render_portlet.jsp] Create CachePortlet {PortletId 58; PortletType com.liferay.portal.model.Portlet}[DEBUG PortletInstanceFactory] No portlet instances cache for '58' create one and put it into cache[DEBUG PortletInstanceFactory] No portlet instance cache for '58' create one and put it into cache[DEBUG PortletInstanceFactory] Create PortletContext and PortletConfigImpl for '58'[DEBUG PortletConfigFactory] Create new PortletContextImpl by ctx 'org.apache.catalina.core.ApplicationContextFacade@d9b7c1'[DEBUG PortletContextFactory] Initial portlet by portlet config[DEBUG PortletInstanceFactory] Real portlet initial PortletConfig[DEBUG CachePortlet] Initial struts portlet[DEBUG StrutsPortlet] Try to get PortletPreferences by 58[portal\render_portlet.jsp] Get PortletConfig and PortletContext[portal\render_portlet.jsp] Get PortletConfig for '58' from portletConfigs pool[DEBUG PortletConfigFactory] Create Render Request Implement [portal\render_portlet.jsp] Get one RenderRequestImpl from pool and inital it[DEBUG RenderRequestFactory] Creating new instance 14510823[DEBUG RenderRequestImpl] Init RenderRequestImpl 14510823[DEBUG RenderRequestImpl] Wrap the request as DynamicServletRequest[DEBUG RenderRequestImpl] Create new PortletSessionImpl[DEBUG RenderRequestImpl] Initialize PortletSession 9793387[DEBUG PortletSessionImpl] Create Render Response Implement [portal\render_portlet.jsp] Get one RenderResponseImpl from pool and inital it[DEBUG RenderResponseFactory] Creating new instance 12970890[DEBUG RenderRequestImpl] Init RenderResponseImpl 12970890[DEBUG RenderRequestImpl] Set portletConfig and renderResponseImpl into request attribute[portal\render_portlet.jsp] Unauthenticated users cannot modify the layout[portal\render_portlet.jsp] Portlets cannot be moved because they didn't belong to any layouts[portal\render_portlet.jsp] Reset portletDisplay and put all parameter into portletDisplay[portal\render_portlet.jsp] Recycling or initial instance 8510245[DEBUG PortletDisplay] CachePortlet begin to render[portal\render_portlet.jsp] Real portlet begin to render[DEBUG CachePortlet] Get PortletRequestProcessor to process request and response[DEBUG StrutsPortlet] Get PortletRequestProcessor from PortletContext '21259641'[DEBUG StrutsPortlet] Can not find struts action in request parameter , try to get it from attribute[DEBUG PortletRequestProcessor] Process path return /login/view[DEBUG PortletRequestProcessor] Process roles[DEBUG PortletRequestProcessor] Find Forward to "portlet.login.view"[DEBUG ViewAction] Get PortletRequestDispatcherImpl from portlet context and use include method[DEBUG PortletRequestProcessor] ThemeDisplay is not signed in.[login\view.jsp] ThemeDisplayPathFriendlyURL : /web; GroupFriendlyURL : /guest; LayoutFriendlyURL : /home[DEBUG PortalUtil] Real portlet end to render[DEBUG CachePortlet] CachePortlet end to render[portal\render_portlet.jsp] Not use default template [portal\render_portlet.jsp] Recycle renderRequestImpl and renderResponseImpl[portal\render_portlet.jsp] Recycling: 0 2[DEBUG RenderRequestFactory] Recycling instance 14510823[DEBUG RenderRequestImpl] Recycling: 0 2[DEBUG RenderResponseFactory] Recycling instance 12970890[DEBUG RenderRequestImpl] End to render portlet 58[DEBUG PortalUtil] Recycling or initial instance 25417229[DEBUG PortletDisplay] End to process runtime portlet [journal_content\view.jsp] Real portlet end to render[DEBUG CachePortlet] CachePortlet end to render[portal\render_portlet.jsp] Not use default template [portal\render_portlet.jsp] Recycle renderRequestImpl and renderResponseImpl[portal\render_portlet.jsp] Recycling: 1 1[DEBUG RenderRequestFactory] Recycling instance 15565667[DEBUG RenderRequestImpl] Recycling: 1 1[DEBUG RenderResponseFactory] Recycling instance 33379524[DEBUG RenderRequestImpl] End to render portlet 57_INSTANCE_GuSK[DEBUG PortalUtil] *******************************[ End to process 'layout\view\portlet.jsp' ]******************************* 登陆界面2>>> Begin CompressionFilter <<< Compression is enabled[DEBUG CompressionFilter] Compressing http://localhost/web/guest/home[DEBUG CompressionFilter] >>> Begin SecureFilter <<< Access allowed for 127.0.0.1[DEBUG SecureFilter] https is not required[DEBUG SecureFilter] Not securing http://localhost/web/guest/home[DEBUG SecureFilter] >>> Begin StripFilter <<< Strip is enabled[DEBUG StripFilter] ......... FriendlyURLServlet Begin to process request ......... >>> End StripFilter <<< Get groupFriendlyUrl is /guest[DEBUG FriendlyURLServlet] Get group by group friendly url[DEBUG FriendlyURLServlet] >>> End SecureFilter <<< >>> End CompressionFilter <<<
Get layoutFriendlyURL is /home[DEBUG FriendlyURLServlet] Get layout by groupId and layoutFriendlyURL[DEBUG FriendlyURLServlet] Get redirect path by layout and mainPath[DEBUG FriendlyURLServlet] Replace layout and mainPath at ${liferay:mainPath}/portal/layout?p_l_id=${liferay:layoutId} to generate actual url[DEBUGFriendlyURLServlet] Request path info : /guest/home; redirect : /c/portal/layout?p_l_id=1.1; lastPath : /guest/home[DEBUG FriendlyURLServlet] Save lastPath in request[DEBUG FriendlyURLServlet] #STEP00: MainServlet Begin to process request '/c/portal/layout'[DEBUG MainServlet] #STEP01: Check whether the instances is larger than the parameter defined in portal.propertites[DEBUG MainServlet ] #STEP02: Check whether the application is logicly shut down[DEBUG MainServlet] #STEP03: Get portalCtx from context and set it into request[DEBUG MainServlet] Get portalCtx [org.apache.catalina.core.ApplicationContextFacade@d9b7c1] from ctx[DEBUG MainServlet] #STEP04: Get companyId from context and set into into portalCtx,session and request[DEBUG MainServlet] #STEP05: Get path variable from context and set them into into portalCtx,session and request[DEBUG MainServlet] #STEP05: Get chatServer from context and set into into portalCtx,session[DEBUG MainServlet] #STEP06: Get PortletRequestProcessor from portalCtx[DEBUG MainServlet] #STEP07: Process other attributes in portal if is null get them from ctx[DEBUG MainServlet] Get FACES_CLASS_LOADER from ctx and set into portalCtx[DEBUG MainServlet] Get ASSOCIATE_KEY from ctx and set into portalCtx[DEBUG MainServlet] #STEP08: Set request character encoding using 'UTF-8'[DEBUG MainServlet] #STEP09: Process content type 'null'[DEBUG MainServlet] #STEP10: Process current url 'http://localhost/web/guest/home?p_l_id=1.1'[DEBUG MainServlet] Now completeURL is /web/guest/home?p_l_id=1.1 and set it into request[DEBUG MainServlet] #STEP11: Process LoginUserId 'null'; Remote User 'null'[DEBUG MainServlet] #STEP12: Process SERVLET_SERVICE_EVENTS_PRE[DEBUG MainServlet] ##STEP01: Get company liferay.com from request[DEBUG ServicePreAction] ##STEP02: Get context path []by companyid liferay.com[DEBUG ServicePreAction] User is null ,so get company default user liferay.com.default[DEBUG ServicePreAction] ##STEP03: Processing locale en_US[DEBUG ServicePreAction] Layout id is 1.1[DEBUG ServicePreAction] Get 1 layouts which groupId='1' and parentLayoutId='-1'[DEBUG GroupLocalServiceImpl] Get layout from session[DEBUG LayoutClonePool] ##STEP04: Processed Layout Home[DEBUG ServicePreAction] Get theme and colorScheme by group 1[DEBUG ServicePreAction] ##STEP05: Processed Theme and Color Scheme {Theme Brochure; Color Scheme Default} and set them into request attrib ute[DEBUG ServicePreAction] ##STEP06: Processed Resolution [DEBUG ServicePreAction] ##STEP07: Create new ThemeDisplay, put all parameters into ThemeDisplay and put it into request[DEBUG ServicePreAc tion] #STEP13: Call parent service[DEBUG MainServlet] ------------ Begin to process Parent Service ------------[DEBUG MainServlet] ##STEP00: Begin to process request for '/portal/layout'[DEBUG PortalRequestProcessor] ##STEP01: Process action mapping[DEBUG PortalRequestProcessor] ##STEP02: Find ActionMapping for /portal/layout, super begin to process[DEBUG PortalRequestProcessor] ###STEP00: Begin to process path /portal/layout[DEBUG PortalRequestProcessor] ###STEP01: Process userTracker [DEBUG PortalRequestProcessor] ###STEP02: Process save last path[DEBUG PortalRequestProcessor] Get last path from request[DEBUG PortalRequestProcessor] Save last path /guest/home in session[DEBUG PortalRequestProcessor] ###STEP03: Process auto login[DEBUG PortalRequestProcessor] Begin to process auto login[INFO PortalRequestProcessor] Using com.liferay.portal.auth.BasicAutoLogin as AutoLogin class[DEBUG PortalRequestProcessor] Cannot get autoUserId from cookie[DEBUG BasicAutoLogin] ###STEP04: Process return path by userId and user[DEBUG PortalRequestProcessor] ###STEPXX: Return path /portal/layout[DEBUG PortalRequestProcessor] ------------ Begin ------------[DEBUG LayoutAction] LayoutId : [1.1]; Action : [][DEBUG LayoutAction] ------------ END ------------[DEBUG LayoutAction] Using portal.jsp as portal root templete [common\themes\portal.jsp] theme:include page=portal_normal.jsp [common\themes\portal.jsp] Theme telplates path /html/themes/brochure/templates/portal_normal.jsp[DEBUG ThemeUtil] Loading file:D:/liferay/appserver/Tomcat-5.0.28/common/classes/content/Language.properties[INFO MultiMessageResources] Loading file:D:/liferay/appserver/Tomcat-5.0.28/common/classes/content/Language-ext.properties[INFO MultiMessageResources] Begin to process top.jsp[themes\brochure\portal_normal.jsp] End to process top.jsp[themes\brochure\portal_normal.jsp] Begin to process navigation.jsp[themes\brochure\portal_normal.jsp] Get 7 layouts which groupId='1' and parentLayoutId='1.1'[DEBUG GroupLocalServiceImpl] ThemeDisplayPathFriendlyURL : /web; GroupFriendlyURL : /guest; LayoutFriendlyURL : /company[DEBUG PortalUtil] ThemeDisplayPathFriendlyURL : /web; GroupFriendlyURL : /guest; LayoutFriendlyURL : /products[DEBUG PortalUtil] ThemeDisplayPathFriendlyURL : /web; GroupFriendlyURL : /guest; LayoutFriendlyURL : /services[DEBUG PortalUtil] ThemeDisplayPathFriendlyURL : /web; GroupFriendlyURL : /guest; LayoutFriendlyURL : /documentation[DEBUG PortalUtil] ThemeDisplayPathFriendlyURL : /web; GroupFriendlyURL : /guest; LayoutFriendlyURL : /news[DEBUG PortalUtil] ThemeDisplayPathFriendlyURL : /web; GroupFriendlyURL : /guest; LayoutFriendlyURL : /downloads[DEBUG PortalUtil] ThemeDisplayPathFriendlyURL : /web; GroupFriendlyURL : /guest; LayoutFriendlyURL : /contest[DEBUG PortalUtil] ThemeDisplayPathFriendlyURL : /web; GroupFriendlyURL : /guest; LayoutFriendlyURL : /home[DEBUG PortalUtil] End to process navigation.jsp[themes\brochure\portal_normal.jsp] 登陆页面1登陆页面 >>> Begin CompressionFilter <<< Compression is enabled[DEBUG CompressionFilter] Compressing http://localhost/[DEBUG CompressionFilter] >>> Begin StripFilter <<< Strip is enabled[DEBUG StripFilter] Create session B363B60BAF561ECC6041C9E73D60CF6A and Put it into PortalSessionContext[DEBUG PortalSessionListener] location replace '/c'[index.jsp] Stripping http://localhost/[DEBUG StripFilter] Stripping content of type text/html[DEBUG StripFilter] Stripped the contecnt from 160 bytes to 151 bytes[DEBUG StripFilter] >>> End StripFilter <<< >>> End CompressionFilter <<<
>>> Begin CompressionFilter <<< Compression is enabled[DEBUG CompressionFilter] Compressing http://localhost/c[DEBUG CompressionFilter] >>> Begin SecureFilter <<< Access allowed for 127.0.0.1[DEBUG SecureFilter] https is not required[DEBUG SecureFilter] Not securing http://localhost/c[DEBUG SecureFilter] >>> Begin StripFilter <<< Strip is enabled[DEBUG StripFilter]
#STEP00: MainServlet Begin to process request '/c'[DEBUG MainServlet] #STEP01: Check whether the instances is larger than the parameter defined in portal.propertites[DEBUG MainServlet ] #STEP02: Check whether the application is logicly shut down[DEBUG MainServlet] #STEP03: Get portalCtx from context and set it into request[DEBUG MainServlet] Loading file:D:/liferay/appserver/Tomcat-5.0.28/common/classes/portal.properties for liferay.com Loading file:D:/liferay/appserver/Tomcat-5.0.28/common/classes/portal-ext.properties for liferay.com Get portalCtx [org.apache.catalina.core.ApplicationContextFacade@d9b7c1] from ctx[DEBUG MainServlet] #STEP04: Get companyId from context and set into into portalCtx,session and request[DEBUG MainServlet] #STEP05: Get path variable from context and set them into into portalCtx,session and request[DEBUG MainServlet] #STEP05: Get chatServer from context and set into into portalCtx,session[DEBUG MainServlet] #STEP06: Get PortletRequestProcessor from portalCtx[DEBUG MainServlet] PortletRequestProcessor is not in portalCtx so initial PortletRequestProcessor '21259641' and set it into portalCtx[DEBU G MainServlet] #STEP07: Process other attributes in portal if is null get them from ctx[DEBUG MainServlet] Get FACES_CLASS_LOADER from ctx and set into portalCtx[DEBUG MainServlet] Get ASSOCIATE_KEY from ctx and set into portalCtx[DEBUG MainServlet] #STEP08: Set request character encoding using 'UTF-8'[DEBUG MainServlet] #STEP09: Process content type 'null'[DEBUG MainServlet] #STEP10: Process current url 'http://localhost/c'[DEBUG MainServlet] Now completeURL is /c and set it into request[DEBUG MainServlet] #STEP11: Process LoginUserId 'null'; Remote User 'null'[DEBUG MainServlet] #STEP12: Process SERVLET_SERVICE_EVENTS_PRE[DEBUG MainServlet] ##STEP01: Get company liferay.com from request[DEBUG ServicePreAction] ##STEP02: Get context path []by companyid liferay.com[DEBUG ServicePreAction] User is null ,so get company default user liferay.com.default[DEBUG ServicePreAction] ##STEP03: Processing locale null[DEBUG ServicePreAction] Cannot get local from current session, so set en_US in session[DEBUG ServicePreAction] Layout id is null[DEBUG ServicePreAction] Get layouts use general GENERAL_GUEST and DEFAULT_PARENT_LAYOUT_ID[DEBUG ServicePreAction] Get 1 layouts which groupId='1' and parentLayoutId='-1'[DEBUG GroupLocalServiceImpl] Set layout into session[DEBUG LayoutClonePool] ##STEP04: Processed Layout Home[DEBUG ServicePreAction] Get theme and colorScheme by group 1[DEBUG ServicePreAction] ##STEP05: Processed Theme and Color Scheme {Theme Brochure; Color Scheme Default} and set them into request attrib ute[DEBUG ServicePreAction] ##STEP06: Processed Resolution [DEBUG ServicePreAction] ##STEP07: Create new ThemeDisplay, put all parameters into ThemeDisplay and put it into request[DEBUG ServicePreAction] Creating new instance 8510245[DEBUG PortletDisplay] Creating new instance 22705162[DEBUG ThemeDisplay] #STEP13: Call parent service[DEBUG MainServlet] ------------ Begin to process Parent Service ------------[DEBUG MainServlet] ##STEP00: Begin to process request for '/c'[DEBUG PortalRequestProcessor] ##STEP01: Process action mapping[DEBUG PortalRequestProcessor] AUTH_FORWARD_BY_LAST_PATH is set false ,so return http://localhost/c/portal/layout[DEBUG PortalRequestProcessor] Can not find ActionMapping for path /c so change path to http://localhost/c/portal/layout[DEBUG PortalRequestProcessor] Send redirect to http://localhost/c/portal/layout[DEBUG PortalRequestProcessor] ------------ Success to process Parent Service ------------[DEBUG MainServlet] #STEP14: Process SERVLET_SERVICE_EVENTS_POST[DEBUG MainServlet] ##STEP01: Process requestURI[DEBUG ServicePostAction] ##STEP02: Get ThemeDisplay from request and clean up it[DEBUG ServicePostAction] Recycling instance 22705162[DEBUG ThemeDisplay] Recycling or initial instance 8510245[DEBUG PortletDisplay] ##STEP03: Clear all messages and error messages stored in session attribute[DEBUG ServicePostAction] #STEP15: Add liferay release info into request header[DEBUG MainServlet] #STEP16: Clear the principal associated with this thread[DEBUG MainServlet] Set Name null[DEBUG PrincipalThreadLocal] #STEPXX: MainServlet End to process request '/c'[DEBUG MainServlet] Response has no content to strip[DEBUG StripFilter] >>> End StripFilter <<< >>> End SecureFilter <<< >>> End CompressionFilter <<<
>>> Begin CompressionFilter <<< Compression is enabled[DEBUG CompressionFilter] Compressing http://localhost/c/portal/layout[DEBUG CompressionFilter] >>> Begin SecureFilter <<< Access allowed for 127.0.0.1[DEBUG SecureFilter] https is not required[DEBUG SecureFilter] Not securing http://localhost/c/portal/layout[DEBUG SecureFilter] >>> Begin StripFilter <<< Strip is enabled[DEBUG StripFilter] #STEP00: MainServlet Begin to process request '/c/portal/layout'[DEBUG MainServlet] #STEP01: Check whether the instances is larger than the parameter defined in portal.propertites[DEBUG MainServlet ] #STEP02: Check whether the application is logicly shut down[DEBUG MainServlet] #STEP03: Get portalCtx from context and set it into request[DEBUG MainServlet] Get portalCtx [org.apache.catalina.core.ApplicationContextFacade@d9b7c1] from ctx[DEBUG MainServlet] #STEP04: Get companyId from context and set into into portalCtx,session and request[DEBUG MainServlet] #STEP05: Get path variable from context and set them into into portalCtx,session and request[DEBUG MainServlet] #STEP05: Get chatServer from context and set into into portalCtx,session[DEBUG MainServlet] #STEP06: Get PortletRequestProcessor from portalCtx[DEBUG MainServlet] #STEP07: Process other attributes in portal if is null get them from ctx[DEBUG MainServlet] Get FACES_CLASS_LOADER from ctx and set into portalCtx[DEBUG MainServlet] Get ASSOCIATE_KEY from ctx and set into portalCtx[DEBUG MainServlet] #STEP08: Set request character encoding using 'UTF-8'[DEBUG MainServlet] #STEP09: Process content type 'null'[DEBUG MainServlet] #STEP10: Process current url 'http://localhost/c/portal/layout'[DEBUG MainServlet] Now completeURL is /c/portal/layout and set it into request[DEBUG MainServlet] #STEP11: Process LoginUserId 'null'; Remote User 'null'[DEBUG MainServlet] #STEP12: Process SERVLET_SERVICE_EVENTS_PRE[DEBUG MainServlet] ##STEP01: Get company liferay.com from request[DEBUG ServicePreAction] ##STEP02: Get context path []by companyid liferay.com[DEBUG ServicePreAction] User is null ,so get company default user liferay.com.default[DEBUG ServicePreAction] ##STEP03: Processing locale en_US[DEBUG ServicePreAction] Layout id is null[DEBUG ServicePreAction] Get layouts use general GENERAL_GUEST and DEFAULT_PARENT_LAYOUT_ID[DEBUG ServicePreAction] Get 1 layouts which groupId='1' and parentLayoutId='-1'[DEBUG GroupLocalServiceImpl] Get layout from session[DEBUG LayoutClonePool] ##STEP04: Processed Layout Home[DEBUG ServicePreAction] Get theme and colorScheme by group 1[DEBUG ServicePreAction] ##STEP05: Processed Theme and Color Scheme {Theme Brochure; Color Scheme Default} and set them into request attrib ute[DEBUG ServicePreAction] ##STEP06: Processed Resolution [DEBUG ServicePreAction] ##STEP07: Create new ThemeDisplay, put all parameters into ThemeDisplay and put it into request[DEBUG ServicePreAc tion] #STEP13: Call parent service[DEBUG MainServlet] ------------ Begin to process Parent Service ------------[DEBUG MainServlet] ##STEP00: Begin to process request for '/portal/layout'[DEBUG PortalRequestProcessor] ##STEP01: Process action mapping[DEBUG PortalRequestProcessor] ##STEP02: Find ActionMapping for /portal/layout, super begin to process[DEBUG PortalRequestProcessor] ###STEP00: Begin to process path /portal/layout[DEBUG PortalRequestProcessor] ###STEP01: Process userTracker [DEBUG PortalRequestProcessor] ###STEP02: Process save last path[DEBUG PortalRequestProcessor] Create new LastPath for '/portal/layout'[DEBUG PortalRequestProcessor] Save last path /portal/layout in session[DEBUG PortalRequestProcessor] ###STEP03: Process auto login[DEBUG PortalRequestProcessor] Begin to process auto login[INFO PortalRequestProcessor] Using com.liferay.portal.auth.BasicAutoLogin as AutoLogin class[DEBUG PortalRequestProcessor] Cannot get autoUserId from cookie[DEBUG BasicAutoLogin] ###STEP04: Process return path by userId and user[DEBUG PortalRequestProcessor] ###STEPXX: Return path /portal/layout[DEBUG PortalRequestProcessor] ------------ Begin ------------[DEBUG LayoutAction] LayoutId : []; Action : [][DEBUG LayoutAction] Can not fine p_l_id parameter in request so process forward layout by request[DEBUG LayoutAction] ThemeDisplayPathFriendlyURL : /web; GroupFriendlyURL : /guest; LayoutFriendlyURL : /home[DEBUG PortalUtil] Get layout friendly url by PortalUtil : /web/guest/home[DEBUG LayoutAction] Forward to /common/forward_js.jsp[DEBUG LayoutAction] ------------ END ------------[DEBUG LayoutAction] forwardParam : null; forwardRequest : /web/guest/home; forwardSession : null [forward_common.jsp] forwardURL : /web/guest/home [forward_common.jsp] self.location = /web/guest/home [common\forward_js.jsp] ##STEPXX: End to process request for /portal/layout[DEBUG PortalRequestProcessor] ------------ Success to process Parent Service ------------[DEBUG MainServlet] #STEP14: Process SERVLET_SERVICE_EVENTS_POST[DEBUG MainServlet] ##STEP01: Process requestURI[DEBUG ServicePostAction] ##STEP02: Get ThemeDisplay from request and clean up it[DEBUG ServicePostAction] Recycling instance 22705162[DEBUG ThemeDisplay] Recycling or initial instance 8510245[DEBUG PortletDisplay] ##STEP03: Clear all messages and error messages stored in session attribute[DEBUG ServicePostAction] #STEP15: Add liferay release info into request header[DEBUG MainServlet] #STEP16: Clear the principal associated with this thread[DEBUG MainServlet] Set Name null[DEBUG PrincipalThreadLocal] #STEPXX: MainServlet End to process request '/c/portal/layout'[DEBUG MainServlet] Stripping http://localhost/c/portal/layout[DEBUG StripFilter] Stripping content of type text/html; charset=UTF-8[DEBUG StripFilter] Stripped the contecnt from 97 bytes to 75 bytes[DEBUG StripFilter] 启动流程启动流程: PropsLoader is first load , run InitAction STEP01: InitAction Set default locale STEP02: InitAction Set log4j from META-INF/portal-log4j.xml STEP03: InitAction Process jaas portal configuration Loading file:D:/liferay/appserver/Tomcat-5.0.28/common/classes/portal.properties Loading file:D:/liferay/appserver/Tomcat-5.0.28/common/classes/portal-ext.properties STEP04: InitAction Process velocity
Get VM_global_library.vm[DEBUG ServletResourceLoader] Getting VM_global_library.vm from default the class loader[WARN ServletResourceLoader]
LazyClassPathApplicationContext Load Bean Definitions META-INF/counter-spring-professional.xml LazyClassPathApplicationContext Load Bean Definitions META-INF/documentlibrary-spring-professional.xml LazyClassPathApplicationContext Load Bean Definitions META-INF/lock-spring-professional.xml LazyClassPathApplicationContext Load Bean Definitions META-INF/mail-spring-professional.xml LazyClassPathApplicationContext Load Bean Definitions META-INF/portal-spring-professional.xml LazyClassPathApplicationContext Load Bean Definitions META-INF/ext-spring-professional.xml
Load Hibernate Configuration META-INF/counter-hbm.xml Load Hibernate Configuration META-INF/mail-hbm.xml Load Hibernate Configuration META-INF/portal-hbm.xml Load Hibernate Configuration META-INF/ext-hbm.xml
Class implementation org.hibernate.dialect.SQLServerDialect[DEBUG DynamicDialect]
LazyWebApplicationContext Load Bean Definitions /WEB-INF/applicationContext.xml
............ InitServlet begin to initialize ........... ............ InitServlet end to initialize ...........
............ MainServlet begin to initialize ............ STEP01: Initialize[DEBUG MainServlet]
================================================================= = Starting Liferay Portal Professional 3.6.1 = =================================================================
Disable autoupdate, current release : 2599[INFO StartupAction] STEP02: Put company_id into the Context[DEBUG MainServlet] STEP03: Put root_path into the Context[DEBUG MainServlet]
STEP04: Parse the PORTLET xml file[DEBUG MainServlet] Finish to load 69 attributes[DEBUG PortletServiceImpl] Finish to load 74 portlets[DEBUG PortletServiceImpl] Finish to load 0 attributes[DEBUG PortletServiceImpl] Finish to load 1 portlets[DEBUG PortletServiceImpl]
STEP05: Parse the LIFERAY_DISLPAY xml file[DEBUG MainServlet] Finish to load 15 categories[INFO PortletServiceImpl] STEP06: Parse the LIFERAY_LAYOUT_TEMPLATES xml file[DEBUG MainServlet] STEP07: Parse the LIFERAY_LOOK_AND_FEEL xml file[DEBUG MainServlet]
STEP08: Check system group and roles create them if not exists and add default company and defalut user of administrator role if no user exists[DEBUG MainServlet]
STEP09: Check calendar system events[DEBUG MainServlet] STEP10: Check journal content search[DEBUG MainServlet] STEP11: Set time out parameter configed in web.xml into class PropsUtil[DEBUG MainServlet] STEP12: Process sheduler[DEBUG MainServlet] STEP13: Process message resources using MultiMessageResources[DEBUG MainServlet]
STEP14: Create CURRENT_USERS pool in WebAppPool[DEBUG MainServlet] ............ MainServlet finish to initialize ............
............ LuceneServlet begin to initialize ............ Using lucene dir /home/liferay/lucene/liferay.com/[DEBUG LuceneServlet] ............ LuceneServlet finish to initialize ............
LazyWebApplicationContext Load Bean Definitions /WEB-INF/remoting-servlet.xml LazyWebApplicationContext Load Bean Definitions /WEB-INF/remoting-servlet-ext.xml Processing Context configuration file URL file:D:\liferay\appserver\Tomcat-5.0.28\conf\Catalina\localhost\tunnel.xml[INF O StandardHostDeployer] Setting useContextClassLoader = false[INFO JAASRealm] Installing web application at context path /laszlo from URL file:D:\liferay\appserver\Tomcat-5.0.28\webapps\laszlo[INFO StandardHostDeployer] Installing web application at context path /cms from URL file:D:\liferay\appserver\Tomcat-5.0.28\webapps\cms[INFO Stand ardHostDeployer] June 28 增加用户的public页面基本介绍:
01. Liferay中每个组(社区)都有一个public,一个private(如果没有配置一个page页,就不显示了),public是外在能看到的(如果有权限)private是外部看不到的
02. Friendly URL为了方便用户记忆的有含义的URL,比如\web\guest\home其中\web说明是public的friendly url,guest是你目前所在的组,home是你要访问的page页面
03. \web表示是public的friendly url,而\group表示是private的friendly url,这个是在portal.properties里面所配置的
04. 对于个人,Liferay只开放了private组,没有开放public组,所以导致不能使现如MSN Space这样的功能,外界不能直接访问你所在的私有页面比如Steven用户的\group\steven\blog,\group\steven\photo 05. 添加个人的PAGE这个动作不是在新增用户或用户注册时候完成的,而是在用户第一次登陆的时候自动添加的。处理这一过程是在servlet.service.events.pre中定义的。默认就是com.liferay.portal.events.ServicePreAction 06. ServicePreAction中的addDefaultLayouts负责添加用户的page,最主要的API就是 Layout layout = LayoutLocalServiceUtil.addLayout( userGroup.getGroupId(), user.getUserId(), false, Layout.DEFAULT_PARENT_LAYOUT_ID, name, Layout.TYPE_PORTLET, false, null); 第一个false说明这个page是private,不能给外界看见得,如果你改为true,那要就可以成为public的了,你可以按照自己的要求修改需要的layout。这样就可以做出比MSN Space更强大的咚咚了,用户有私人和公共两个空间,它可以自己控制公共显示的信息或portlet,比如BLOG,而BLOG的内容可以在私人空间中管理。(对于BLOG或PHOTO等这是同步的)
注:
01. servlet.service.events.pre有很多定义,比如随机的皮肤更换,LAYOUT随机,日志记录等等。可以看一下portal.properties,你一定会有不少的收获
02. 管理员是有权访问用户public页面(可以进行言论自由控制-_-!!),但是一定要通过friendly url,没有特别页面进行维护,但是无权访问其他用户的private页面
03. 注意对friendly url的控制,建议改成自动生成,而不是让用户输入 自定义登陆基本处理流程1. portal.jaas.enable=true,使用JAAS
01. com.liferay.portlet.login.action.ViewAction
02. com.liferay.portal.action.LoginAction liferay用户认证 转成SSO用户认证 com.liferay.portal.service.impl.UserLocalServiceImpl.authenticateForJAAS
03. MainServlet 转成liferay用户 2. portal.jaas.enable=false,不使用JAAS 01. com.liferay.portlet.login.action.ViewAction 02. com.liferay.portal.action.LoginAction liferay用户认证 03. MainServlet 使用包装成一个ProtectedServletRequest(remote user就是liferay的userid)
登陆处理solution:
一.使用SSO
01. 写自己的LoginModule(处理用户名密码认证,可以参考com.liferay.portal.shared.security.jaas.PortalLoginModul的写法,详细见JAAS相关资料)
02. 在容器的配置文件中配置自己写的LoginModule 比如在tomcat中,在ext\servers\tomcat\conf\jaas.config替换成自己的JAAS类
03. 写PrincipalFinder的实现类(处理SSO登录用户名和liferay的userid的映射,默认两者相同)
04. 在portal.properties的principal.finder中配置自己写的Finder June 27 liferay step by step(3.2)05. 加入ext\ext-ejb\classes\content所需要的国际化语言配置以UTF-8保存,运行native2ascii -encoding UTF-8 Language-ext_zh_CN.properties.native Language-ext.properties生成ascii文件
## ## Language settings ## lang.dir=ltr
lang.line.begin=left lang.line.end=right ##
## Portlet titles ## javax.portlet.title.1100=项目管理
##
## Category titles ## category.project=项目
##
## Action names ## action.ADD_PROJECT=添加项目 ##
##Project Managing ## asset=资产 undefined=未定义 basic-information=基本信息 must-fill-in-hint=打红色星号(*)的字段一定要填写。底色为黄色的内容将在外网显示 pm_chprojectId=挂牌编号 pm_chprojectname=项目名称 pm_projectfield=项目行业 pm_intprjarea=项目挂牌区域 pm_tdvaliddate=挂牌有效期至 pm_intvalidterm=挂牌时间 pm_chcustomercommend=会员建议 pm_chintroduction=项目简介 pm_decmoney=挂牌价格(万元) pm_project_area_city=项目地区(市) pm_project_area_province=项目地区(省份) pm_normal_area=普通区 pm_important_area=重点区 06. 在ext\ext-ejb下运行ant build-service
07. 编写struts-config-ext.xml <action path="/porject_managing/view" forward="/portlet/porject_managing/view.jsp" /> <action path="/porject_managing/edit_base_project" type="com.newtouch.portlet.project_managing.actions.ViewAction"> <forward name="portlet.porject_managing.edit_base_project" path="/portlet/porject_managing/base_project.jsp" /> </action> 08. 在ext\servers\tomcat\liferay\WEB-INF\classes\resource-actions下加入自己的控制文件projects.xml <?xml version="1.0"?> <resource-action-mapping> <portlet-resource> <portlet-name>1100</portlet-name> <supports> <action-key>ADD_PROJECT</action-key> <action-key>CONFIGURATION</action-key> <action-key>VIEW</action-key> </supports> <community-defaults> <action-key>VIEW</action-key> </community-defaults> <guest-defaults> <action-key>VIEW</action-key> </guest-defaults> <guest-unsupported> <action-key>ADD_PROJECT</action-key> </guest-unsupported> </portlet-resource> <model-resource> <model-name>com.newtouch.portlet.projectmanaging.model.Project</model-name> <portlet-ref> <portlet-name>1100</portlet-name> </portlet-ref> <supports> <action-key>DELETE</action-key> <action-key>PERMISSIONS</action-key> <action-key>UPDATE</action-key> <action-key>VIEW</action-key> </supports> <community-defaults> <action-key>VIEW</action-key> </community-defaults> <guest-defaults> <action-key>VIEW</action-key> </guest-defaults> <guest-unsupported> <action-key>UPDATE</action-key> </guest-unsupported> </model-resource> </resource-action-mapping> 注: 01. STEP01原有例子report的service.xml,建议备份到ext-ejb\src\com\ext\portlet\reports目录下 02. 例子里面包含一个自动生成序列的service,由于篇幅原因这里省略 03. STEP05因该配合JSP页面,portletid,权限,catalog共同完成 04. 以下页面全部直接在liferay目录下开发了,而放弃了ext-web,感觉比较别扭 05. action的名字也可以国际化,会自动加前缀,比如action.ADD_PROJECT 06. 权限分2个范围一个是portlet,一个是model,基本判断方法为:PortletPermission.contains(permissionChecker, plid,"1100", "ADD_PROJECT") 07. jsp页面暂且省去,充分利用里面的tag可以很大程度提高开发速度和界面的一致性 附: 01. service.xml的使用方法可见DTD,实际例子对service的使用并不充分 service.xml的基本作用 a. 生成hibernate、spring、hint(用于html标签)的xml配置文件 b. 生成hibernate的增、删、改、查(如果定义了finder) c. 生成service类,未定义任何方法,需要手工加入 02. 由于一个Action往往服务与多个页面的转发于处理,所以一般以Constants.CMD 来控制,比如:Constants.ADD liferay step by step(3.1)01. 重写ext\ext-ejb\service.xml
< service.xml > <?xml version="1.0"?> <!DOCTYPE service-builder PUBLIC "-//Liferay//DTD Service Builder 4.0.0//EN" "http://www.liferay.com/dtd/liferay-service-builder_4_0_0.dtd"> <service-builder root-dir=".." package-path="com.newtouch.portlet">
<portlet name="ProjectManaging" short-name="Project_Managing" /> <entity name="Project" local-service="true" remote-service="false" table="tProject"> <column name="projectID" db-name="chProjectID" type="String" primary="true" />
<column name="wProjectID" db-name="chWProjectID" type="String"/>
<column name="customerID" db-name="intCustomerID" type="String"/> <column name="projectType" db-name="intPrjType" type="String"/> <column name="projectName" db-name="chProjectName" type="String"/> <column name="district" db-name="intDistrict" type="String"/> <column name="industry" db-name="intIndustry" type="String"/> <column name="introduction" db-name="chIntroduction" type="String"/> <column name="money" db-name="decMoney" type="String"/> <column name="inputTime" db-name="dtInputTime" type="Date"/> <column name="auditTime" db-name="dtAuditTime" type="Date"/> <column name="projectArea" db-name="intPrjArea" type="String"/> <column name="beginDate" db-name="dtBeginDate" type="Date"/> <column name="endDate" db-name="dtEndDate" type="Date"/> <column name="numOfDays" db-name="intNumOfDays" type="String"/> <column name="status" db-name="intStatus" type="String"/> <column name="hitNumber" db-name="intHitNumber" type="String"/> <column name="customerCommend" db-name="chCustomerCommend" type="String"/> </entity>
<entity name="ProjectNum" local-service="true" remote-service="false" table="sPrjNum"> <column name="num" db-name="num" type="Integer" primary="true"/> </entity> </service-builder>
02. 在ext\ext-ejb下运行ant build-service 03. 编写自己service的代码实现 <ProjectLocalService.java> package com.newtouch.portlet.projectmanaging.service.spring; public interface ProjectLocalService {
public com.newtouch.portlet.projectmanaging.model.Project addProject( java.lang.String projectId, java.lang.String customerId, java.lang.String projectType, java.lang.String projectName, java.lang.String district, java.lang.String introduction, java.lang.String money, java.util.Date inputTime, java.lang.String customerCommend, java.util.Date beginDate, java.util.Date endDate, java.lang.String projectArea, java.lang.String validTerm) throws com.liferay.portal.PortalException, com.liferay.portal.SystemException; } <ProjectLocalServiceImpl.java>
package com.newtouch.portlet.projectmanaging.service.impl; import java.util.Date;
import com.liferay.portal.PortalException;
import com.liferay.portal.SystemException; import com.newtouch.portlet.projectmanaging.model.Project; import com.newtouch.portlet.projectmanaging.service.persistence.ProjectUtil; import com.newtouch.portlet.projectmanaging.service.spring.ProjectLocalService; public class ProjectLocalServiceImpl implements ProjectLocalService {
public Project addProject(String projectId,String customerId,String projectType,String projectName,
String district,String introduction,String money,Date inputTime,String customerCommend, Date beginDate,Date endDate,String projectArea,String validTerm) throws PortalException, SystemException{ Project project = ProjectUtil.create(projectId); project.setCustomerID(customerId); project.setProjectType(projectType); project.setProjectName(projectName); project.setDistrict(district); project.setIntroduction(introduction); project.setMoney(money); project.setInputTime(inputTime); project.setCustomerCommend(customerCommend); project.setStatus("0"); project.setBeginDate(beginDate); project.setEndDate(endDate); project.setProjectArea(projectArea); project.setNumOfDays(validTerm); ProjectUtil.update(project); return project; } } <ProjectLocalServiceUtil.java>
package com.newtouch.portlet.projectmanaging.service.spring; public class ProjectLocalServiceUtil {
public static com.newtouch.portlet.projectmanaging.model.Project addProject( java.lang.String projectId, java.lang.String customerId, java.lang.String projectType, java.lang.String projectName, java.lang.String district, java.lang.String introduction, java.lang.String money, java.util.Date inputTime, java.lang.String customerCommend, java.util.Date beginDate, java.util.Date endDate, java.lang.String projectArea, java.lang.String validTerm) throws com.liferay.portal.PortalException, com.liferay.portal.SystemException { try { ProjectLocalService projectLocalService = ProjectLocalServiceFactory.getService(); return projectLocalService.addProject(projectId, customerId,
projectType, projectName, district, introduction, money, inputTime, customerCommend, beginDate, endDate, projectArea, validTerm); } catch (com.liferay.portal.PortalException pe) { throw pe; } catch (com.liferay.portal.SystemException se) { throw se; } catch (Exception e) { throw new com.liferay.portal.SystemException(e); } } } 04. 加入struts的controllor EditBaseProjectAction package com.newtouch.portlet.projectmanaging.action; import java.util.Date;
import javax.portlet.ActionRequest;
import javax.portlet.ActionResponse; import javax.portlet.PortletConfig; import javax.portlet.RenderRequest; import javax.portlet.RenderResponse; import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; import com.liferay.portal.struts.PortletAction;
import com.liferay.portal.util.Constants; import com.liferay.util.ParamUtil; import com.liferay.util.Validator; import com.newtouch.portlet.projectmanaging.service.spring.ProjectLocalServiceUtil; public class EditBaseProjectAction extends PortletAction {
public void processAction(ActionMapping mapping, ActionForm form, PortletConfig config, ActionRequest req, ActionResponse res) throws Exception { String cmd = ParamUtil.getString(req, Constants.CMD);
try {
if (cmd.equals(Constants.ADD) || cmd.equals(Constants.UPDATE)) { updateBaseProject(req); } /* if (Validator.isNotNull(cmd)) { sendRedirect(req, res); } */ } catch (Exception e) { throw e; } } public ActionForward render(ActionMapping mapping, ActionForm form,
PortletConfig config, RenderRequest req, RenderResponse res) throws Exception { try {
String cmd = ParamUtil.getString(req, Constants.CMD); if (!cmd.equals(Constants.ADD)) {
//ProjectUtil.getBaseProject(req); } } catch (Exception e) { throw e; } return mapping.findForward("portlet.porject_managing.view"); } protected void updateBaseProject(ActionRequest req) throws Exception {
String cmd = ParamUtil.getString(req, Constants.CMD); String projectId = ParamUtil.getString(req, "chProjectId"); String customerId = ParamUtil.getString(req, "customerId"); String projectType = ParamUtil.getString(req, "prjType"); String projectName = ParamUtil.getString(req, "chProjectName"); String district = null; String introduction = ParamUtil.getString(req, "chIntroduction"); String money = ParamUtil.getString(req, "decMoney"); Date inputTime = null; String customerCommend = ParamUtil.getString(req, "chCustomerCommend"); Date beginDate = null; Date endDate = null; String projectArea = ParamUtil.getString(req, "intPrjArea"); String validTerm = ParamUtil.getString(req, "intValidTerm"); if (cmd.equals(Constants.ADD)) ProjectLocalServiceUtil.addProject(projectId, customerId, projectType, projectName, district, introduction, money, inputTime, customerCommend, beginDate, endDate, projectArea, validTerm); } } June 19 liferay step by step(2)三.开发简单struts portlet(实际项目案例)
01. 修改工作目录ext-web\build.xml 把deploy的ext-ejb.jar改到放在liferay\WEB-INF\lib下,Language-ext.properties放到 liferay\WEB-INF\content下
L81: <copy file="ext-ejb.jar" todir="${app.server.deploy.dir}/WEB-INF/lib" /> L89: <property name="properties.dir" value="${app.server.deploy.dir}/lib/classes/content" /> 02. 在liferay-portlet-ext.xml中加入 <portlet> <portlet-name>1100</portlet-name> <struts-path>porject_managing</struts-path> </portlet> 03. 在portlet-ext.xml中加入 <portlet> <portlet-name>1100</portlet-name> <display-name>Project Managin Portlet</display-name> <portlet-class>com.liferay.portlet.StrutsPortlet</portlet-class> <init-param> <name>view-action</name> <value>/porject_managing/view</value> </init-param> <expiration-cache>0</expiration-cache> <supports> <mime-type>text/html</mime-type> </supports> <resource-bundle>com.liferay.portlet.StrutsResourceBundle</resource-bundle> <security-role-ref> <role-name>power-user</role-name> </security-role-ref> <security-role-ref> <role-name>user</role-name> </security-role-ref> </portlet> 04. 在liferay-display中加入 <category name="category.project"> <portlet id="1100" /> </category> 05. 在struts-config.xml中加入 <action path="/porject_managing/view" forward="/portlet/porject_managing/view.jsp" /> <action path="/porject_managing/edit_base_project" type="com.newtouch.portlet.project_managing.actions.ViewAction"> <forward name="portlet.porject_managing.edit_base_project" path="/portlet/porject_managing/base_project.jsp" />
</action> 06. 在ext\ext-web\docroot\html\porject_managing目录下添加 view.jsp和base_project.jsp <<view.jsp>> <%@ include file="/html/portlet/init.jsp" %> <portlet:defineObjects /> <% PortletURL portletURL = renderResponse.createRenderURL(); portletURL.setParameter("struts_action", "/porject_managing/edit_base_project"); portletURL.setWindowState(WindowState.MAXIMIZED); %> <table cellpadding="8" cellspacing="0" width="100%"> <tr> <%portletURL.setParameter("itype", "1");%> <td><a href="<%=portletURL.toString()%>"><%= LanguageUtil.get(pageContext, "asset") %></a></td> <%portletURL.setParameter("itype", "2");%> <td><a href="<%=portletURL.toString()%>"><%= LanguageUtil.get(pageContext, "undefined") %></a></td> <%portletURL.setParameter("itype", "3");%> <td><a href="<%=portletURL.toString()%>"><%= LanguageUtil.get(pageContext, "undefined") %></a></td> </tr> <tr> <%portletURL.setParameter("itype", "4");%> <td><a href="<%=portletURL.toString()%>"><%= LanguageUtil.get(pageContext, "undefined") %></a></td> <%portletURL.setParameter("itype", "5");%> <td><a href="<%=portletURL.toString()%>"><%= LanguageUtil.get(pageContext, "undefined") %></a></td> <%portletURL.setParameter("itype", "6");%> <td><a href="<%=portletURL.toString()%>"><%= LanguageUtil.get(pageContext, "undefined") %></a></td> </tr> </table> <<base_project.jsp>>
<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %> <portlet:defineObjects />
This is the <b>Sample JSP Portlet</b>. Use this as a quick way to include JSPs.
07. 启动eclipse,新建工程,并选择ext为project 08. 创建com.newtouch.portlet.project_managing.actions.ViewAction.java package com.newtouch.portlet.project_managing.actions; import javax.portlet.PortletConfig;
import javax.portlet.RenderRequest; import javax.portlet.RenderResponse; import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; import com.liferay.portal.struts.PortletAction;
public class ViewAction extends PortletAction{
public ActionForward render(ActionMapping mapping, ActionForm form, PortletConfig config, RenderRequest req, RenderResponse res) throws Exception { req.setAttribute("itype",req.getParameter("itype"));
return mapping.findForward("portlet.porject_managing.edit_base_project"); }
} 09. 在\ext\ext-ejb\classes\content目录下建立文件Language-ext_zh_CN.properties.native ## ## Language settings ## lang.dir=ltr
lang.line.begin=left lang.line.end=right ##
## Portlet titles ## javax.portlet.title.1100=项目管理
##
## Category titles ## category.project=项目
##
##Project Managing ## asset=资产 undefined=未定义 10. 在改目录下运行native2ascii -encoding UTF-8 Language-ext_zh_CN.properties.native Language-ext.properties
11. 在工作目录ext\ext-ejb下运行ant deploy部署jar文件 12. 在工作目录ext\ext-web下运行ant deploy部署相关web文件 注: 01. 这个问题可能是由于版本跟新造成的,3.6时jar都放在common目录下,而4.0后jar放在了webapp\lib下,但是build没有跟新,如果仍 然放在common目录下由于调用次序原因就会造成类找不到以及语言属性文件找不到
02. struts-config.xml在部署时会重命名为struts-config-ext.xml,其他文件就是直接copy(为啥要这样做?) 03. 配置文件相关配置一览表 struts-config:(web.xml) <servlet-name>MainServlet</servlet-name> <display-name>MainServlet</display-name> <servlet-class>com.liferay.portal.servlet.MainServlet</servlet-class> <init-param> <param-name>config</param-name> <param-value>/WEB-INF/struts-config.xml,/WEB-INF/struts-config-ext.xml</param-value> </init-param> ...... tiles-defs:(struts-config.xml) <plug-in className="org.apache.struts.tiles.TilesPlugin" > <set-property property="definitions-config" value="/WEB-INF/tiles-defs.xml,/WEB-INF/tiles-defs- ext.xml" />
<set-property property="moduleAware" value="true" /> <set-property property="definitions-parser-validate" value="true" /> </plug-in> portlet.xml,liferay-portlet,liferay-display.xml:(com.liferay.portal.servlet.MainServlet) String[] xmls = new String[] { Http.URLtoString(ctx.getResource("/WEB-INF/portlet.xml")), Http.URLtoString(ctx.getResource("/WEB-INF/portlet-ext.xml")), Http.URLtoString(ctx.getResource("/WEB-INF/liferay-portlet.xml")), Http.URLtoString(ctx.getResource("/WEB-INF/liferay-portlet-ext.xml")) }; Language.properties:(struts-config.xml) <message-resources parameter="content.Language,content.Language-ext" factory="com.liferay.portal.struts.MultiMessageResourcesFactory" /> 04. base_project.jsp目前只是简单实现,以后在下接中会加入表单 05. STEP07,liferay已经自动为您创建了工程,所以只要导入就可以了,如果机器速度较慢建议关掉自动编译 June 16 liferay Step by Step (1)工作环境:
JDK 1.4 DATABASE SQLServer 2000 OS Windows XP 预备工作: 01. 下载liferay-portal-src-4.0.0 02. 下载liferay-portal-tomcat-4.0.0.zip 一.创建liferay工作运行环境
01. 修改\build.properties中的javac.compiler=modern;javac.fork=true(使用标准的1.4/1.5编译器,使用单独JVM,避免报内存异常) 02. 根目录下ant start(我的电脑竟然编译了19分钟......-_-!!) 03. 修改\release.properties中的Directories(lp.eclipse.dir,lp.ext.dir,lp.source.dir),到你要新建项目的目录(以下称为工作目 录)
04. 修改\tools\ext_tmpl\build.properties中的javac.compiler=modern;javac.fork=true(此template作为以后porject复制所用) 05. 根目录下ant build-ext 06. copy下载的liferay-portal-tomcat-4.0.0.zip至工作目录\downloads下(STEP03中定义的目录) 07. 修改工作目录app.server.properties,放开app.server.type=tomcat配置 08. 在工作目录\servers下ant install-tomcat 09. 修改工作目录\sql中的sql-server.arg.line=-n -U sa -P -i create/create-sql-server.sql加入自己的用户名密码 10. 在工作目录\sql下ant rebuild-sql-server 12. 下载最新的sql server jdbc驱动jtds,放至工作目录的\servers\tomcat\common\lib\ext下面 13. 修改\servers\tomcat\conf\Catalina\localhost\ROOT.xml的数据源配置为 <Resource name="jdbc/LiferayPool" auth="Container" type="javax.sql.DataSource" driverClassName="net.sourceforge.jtds.jdbc.Driver" url="jdbc:jtds:Sqlserver://localhost/lportal" username="sa" password="sa"
maxActive="100" maxIdle="30" maxWait="10000" />
09. 在工作目录下\servers\tomcat\bin 运行startup.bat启动liferay 注:
01. STEP04可省略,在STEP08前在修改工作目录\build.properties中的javac.compiler=modern;javac.fork=true 02. STEP05可省略,ant会先检查downloads目录下是否有需要的版本,如果没有则自动下载,但是速度比较慢。如果确信你的tomcat-bin 版本和src版本一致则可以把那个zip重命名成他所要求的名字,系统就不会自动下载了
03. STEP12SQLServer驱动建议使用JTDS,官方的那个JDBC很不稳定,时常会抱错。 二.官方例子部署
01. 在目录\portlets下ant war 02. copy新生成的sample-jsf-myfaces-portlet.war;sample-jsf-sun-portlet.war;sample-json-portlet.war;sample-jsp- portlet.war;sample-struts-portlet.war文件至工作目录的\portlets下面
03. 在工作目录\portlets下运行ant deploy 04. 在工作目录下\servers\tomcat\bin 运行startup.bat启动liferay,在test一栏下会发现新增加的portlet 注: 01. 在目录在目录\portlets下也有个ant deploy,但好像有些问题,因为时间关系,没有深究 02. 用户可以直接将war或解压后的文件夹放在webapp下(部署实际就是解压而以) 03. 以此(webapp)形式存放portlet启动时会对各个文件进行合并复制,影响启动速度。如果有大于10个的portlet,那启动速度会异常的 慢 May 10 最近的第一次与第N次
每一个第一次都是那么让人激动,每一个N次也是让人那么的激动,因为它们见证了一个程序员正在满满的长大,那就是我。
April 27 XML解析解析XML总是让人郁闷的事情,找了半天也不知道啥XML解析最方便
本以为找到了XStream这根救命稻草,可惜发现他对attribute支持不好,xml 转成 object如果带有collection会有问题,就连自己转换出来的xml都不能转换回去。。。:(还有就是对于不同element下如果有相同element名字或别名的也就傻掉了(还是我没有找到如何配置? )。。。-_-!!看来XStreem还是只能是最简单的XML处理,而且不能带attribute,不能有重名的,对于已存在的要解析还是比较麻烦的。
现在在看XMLBean,不过看上去用起来也不那么爽 ,难道真的要用DOM4J这类咚咚自己去解析成OBJECT?。。
顺便提一句,原来Javolution也是来解析XML的,原来还以为是专用于对象重用呢。看其表现,果然不错,看来把一些咚咚用javolution是可以把性能提高很多的。
Result summary
March 07 除了差距还是差距不经意间来到了javablog,知道了有江南白衣 这号人物,逛了他所写的文章。终于发现了个实实在在的牛人了。从BLOG看上去他确实很,知道的东西N多。感到的除了差距还是差距。
第一次我开始怀疑自己是不是能达到他那样的地步?如何要达到需要多少时间?努力一个人闷学可能达到这个层次吗?一个接着一个做项目可以达到这样的水准吗?
突然间似乎感觉自己是那么的无助、甚至有些凄惨....... February 11 volatile实现控制运行一次以下是volatile实现控制运行一次的例子
if (!cInitialized) {
synchronized (ServiceManager.class) { if (!cInitialized) { cInitialized = true; } else { return; } } } else { return; } ...........
}
其中cInitialized为
private static volatile boolean cInitialized = false;
这种方法能够确保只运行一次,如果对于运行时间较长,但又未必需要立刻使用,可使用此方法。但注意使用与运行的时间(其他线程虽然判定其不需要初始化运行,但是实际初始化运行工作未必已经完成) February 07 State Pattern东东是在看portal中发现的,主要改模式主要用于表示状态,有很好的扩展性,又方便使用
package com.newtouch.portal.core.portlet;
import javax.portlet.PortletMode; public class NewtouchPortletMode extends PortletMode{ public final static PortletMode ABOUT = new PortletMode("about"); public final static PortletMode CONFIG = new PortletMode("config"); public final static PortletMode EDIT_DEFAULTS = new PortletMode("edit_defaults"); public final static PortletMode PREVIEW = new PortletMode("preview"); public final static PortletMode PRINT = new PortletMode("print"); public NewtouchPortletMode(String name) { super(name); } } 其中PortletMode为
package com.newtouch.portal.core.portlet; 在windowstate也是使用这样的模式public class PortletMode { private String name = null; public final static PortletMode VIEW = new PortletMode("view"); public PortletMode(String name){ this.name = name; } public boolean equals(PortletMode pm){ return pm.name.equals(this.name); } public String toString(){ return name; } } January 26 Oracle中的分组 1.报表合计专用的Rollup函数
销售报表 广州 1月 2000元 广州 2月 2500元 广州 4500元 深圳 1月 1000元 深圳 2月 2000元 深圳 3000元 所有地区 7500元 以往的查询SQL: Select area,month,sum(money) from SaleOrder group by area,month 然后广州,深圳的合计和所有地区合计都需要在程序里自行累计 1.其实可以使用如下SQL: Select area,month,sum(total_sale) from SaleOrder group by rollup(area,month)就能产生和报表一模一样的纪录 2.如果year不想累加,可以写成
Select year,month,area,sum(total_sale) from SaleOrder group by year, rollup(month,area)另外Oracle 9i还支持如下语法: Select year,month,area,sum(total_sale) from SaleOrder group by rollup((year,month),area) 3.如果使用Cube(area,month)而不是RollUp(area,month),除了获得每个地区的合计之外,还将获得每个月份的合计,在报表最后显示。
4.Grouping让合计列更好读
RollUp在显示广州合计时,月份列为NULL,但更好的做法应该是显示为"所有月份" Grouping就是用来判断当前Column是否是一个合计列,1为yes,然后用Decode把它转为"所有月份" Select Decode(Grouping(area),1,'所有地区',area) area, 2.对多级层次查询的start with.....connect by
比如人员组织,产品类别,Oracle提供了很经典的方法 SELECT LEVEL, name, emp_id,manager_emp_id 上面的语句demo了全部的应用,start with指明从哪里开始遍历树,如果从根开始,那么它的manager应该是Null,如果从某个职员开始,可以写成emp_id='11'
CONNECT BY 就是指明父子关系,注意PRIOR位置 另外还有一个LEVEL列,显示节点的层次 3.更多报表/分析决策功能
3.1 分析功能的基本结构 分析功能() over( partion子句,order by子句,窗口子句) 概念上很难讲清楚,还是用例子说话比较好. 3.2 Row_Number 和 Rank, DENSE_Rank
用于选出Top 3 sales这样的报表 当两个业务员可能有相同业绩时,就要使用Rank和Dense_Rank 比如 金额 RowNum Rank Dense_Rank 张三 4000元 1 1 1 李四 3000元 2 2 2 钱五 2000元 3 3 3 孙六 2000元 4 3 3 丁七 1000元 5 5 4 这时,应该把并列第三的钱五和孙六都选进去,所以用Ranking功能比RowNumber保险.至于Desnse还是Ranking就看具体情况了。
SELECT salesperson_id, SUM(tot_sales) sp_sales, 3.3 NTILE 把纪录平分成甲乙丙丁四等
比如我想取得前25%的纪录,或者把25%的纪录当作同一个level平等对待,把另25%当作另一个Level平等对待 SELECT cust_nbr, SUM(tot_sales) cust_sales,NTITLE(4)把纪录以 SUM(tot_sales)排序分成4份. 3.4 辅助分析列和Windows Function
报表除了基本事实数据外,总希望旁边多些全年总销量,到目前为止的累计销量,前后三个月的平均销量这样的列来参考. 这种前后三个月的平均和到目前为止的累计销量就叫windows function,是SQL2003的针对OLAP的新函数, 见下例 SELECT month, SUM(tot_sales) monthly_sales,
Windows Function的关键就是Windows子句的几个取值
1 PRECEDING 之前的一条记录 1 FOLLOWING 之后的一条记录 UNBOUNDED PRECEDING 之前的所有记录 CURRENT ROW 当前纪录 4.SubQuery总结
SubQuery天天用了,理论上总结一下.SubQuery 分三种 1.Noncorrelated 子查询 最普通的样式. 2.Correlated Subqueries 把父查询的列拉到子查询里面去,头一回cyt教我的时候理解了半天. 3.Inline View 也被当成最普通的样式用了. 然后Noncorrelated 子查询又有三种情况 1.返回一行一列 where price < (select max(price) from goods ) 2.返回多行一列 where price>= ALL (select price from goods where type=2) or where NOT price< ANY(select price from goods where type=2) 最常用的IN其实就是=ANY() 3.返回多行多列 一次返回多列当然就节省了查询时间 UPDATE monthly_orders |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|