bao cao cong nghe web-nhom 5-de tai 9

Upload: le-van-doan

Post on 11-Jul-2015

196 views

Category:

Documents


1 download

TRANSCRIPT

Vin cng ngh thng tin v truyn thng Trng i hc Bch Khoa H Ni

------------------------------------------------

N: CNG NGH WEB V DCH V TRC TUYN

Nhm 5 ti 9 : To giao din vi Velocity template.Gio vin hng dn: TS T. Tun Anh Thnh vin nhm: Ng c Ch Nguyn c ng Nguyn Thnh Cng L Vn on shsv:20070311 HTTT K52 shsv:20070813 HTTT K52 shsv:20070364 HTTT K52 shsv:20070777 HTTT K52

1

MC LCVelocity trong portlet.........................................................................................23

2

A.

Velocity template

1. Tng quan-

Velocity l 1 template engine c m ngun m c pht trin bi cc lp trnh

vin trn khp th gii. y l d n ca Apache Software Foundation. Velocity s dng cc template da trn Java (Java-based) hp nht cc mu. 1 template engine l 1 phn mm c thit k x l cc web templates v cc

thnh phn thng tin to ra cc ti liu web ( web documents) . Mi velocity project bao gm 2 th : velocity template v chng trnh Java.-

Chng ta c th tham chiu cc i tng c nh ngha = m Java vi

Velocity template language. Do , 1 Velocity template c th c s dng to giao din trong cc ng dng web. Velocity s gip hon tt vic tch bit gia trnh by cc layout v thc thi cc business logic.-

1 veloctiy template l 1 file text c phn m rng l .vm , bao gm cc k t vn

bn thng gp v 1 s k t c bit dng trong velocity. V d : $name.

2. Velocity template languageCU LNH V THAM CHIU Di y l 1 cu lnh VTL: #set ($me = "Velocity") Mt cu lnh VTL bt u vi mt du #. T set l ch th. Trong VTL, 1 tham chiu bt u vi mt k t $. V vy, $me l mt tham chiu, hay l 1 bin tham chiu trong trng hp ny. Bin $me c gn gi tr l Velocity. Velocity l mt chui. Trong VTL mt chui c th km theo trong du nhy n hoc kp. Mt chui trong du nhy n c c th hin trc tip trong khi mt chui trong du3

nhy kp c th cha cc bin m s c thay th bng gi tr ca chng khi template c hp thnh.

C 1 cch khc s dng cc tham chiu: $witness.getMessage() y chng ta s dng mt tham chiu gi phng thc ca mt i tng c nh ngha = m Java v c thm vo Velocity context. Cng c template s in ra mt tin nhn tr v bi phng thc getMessage () ca witness. CU IU KIN Mi ngn ng kch bn( dng bo cho chng trnh cch thc hin cc th tc) u c cc cu lnh iu kin v nguyn l c xy dng trong CPU. #if( $ihave > 199 ) Buy iPhone #elseif( $ihave == 199 ) Buy Nexus One #else Play volleyball #end T ch th if kt thc vi t ch th end. Bn c th thy n, khng cn quan tm chng ta ang c g y. LOOPS4

Trong VTL cng c lp.

  • #foreach( $energy in $cleanEnergies )
  • $energy

#end N s in ra nh sau: Solar energy Wind power Hyropower Geothermal energy Directives T ch th include cho php cng c dng vit template import(np) vo 1 local file(tp tin cc b). Cc ni dung ca local file s c thm vo template v tr m t ch th include c nh ngha. Cc ni dung ca tp tin s c template engine hiu. #include( "snippet.html" ) Chng ta cng c t ch th parse . N s truyn cho tp tin template(template file) 1 i s. Template engine s phn tch template file v tr ra ni dung ca n. y l cu lnh: #parse ("navigation.vm") Cu lnh ny s tr ra the navigation.vm template. T ch th stop dng vic running ca template engine. N c th c dng cho mc ch debug :

5

#stop VELOCIMACROS Cc Velocity templates trong Liferay cng s dng Velocity macros gi Velocimacros. Mt Velocimacro l 1 hm nh trong VTL. N c th s dng x l cc xu. N ly cc tham s lm u vo v in ra text. N khng tr ra gi tr. A template developer c th s dng t ch th macro vit 1 Velocimacro, n c th c s dng nhiu ln trong 1 Velocity template. #macro (printSwimmingPools $val) #if ($val ) #foreach ($e in $val) $e #end #end #end Cn y l cch lm th no s dng Velocimacro trn trong 1 template: #set( $nemoSwimmingPools = ["The Pacific Ocean","The Atlantic Ocean","The Indian Ocean"] ) #printSwimmingPools( $nemoSwimmingPools )

Thng th cc Velocimacros c nh ngha trong 1 file gi l VM_global_library.vm (y l trng hp dng trong6

Liferay). ng thi, Liferay s dng $

{PORTAL_SRC_HOME}/portal-impl/src/VM_liferay.vm

ca

chnh

n

to

Velocimacros ca n. Trong Liferay, cc thuc tnh ca Velocity c thit lp trong file ${PORTAL_SRC_HOME}/portal-impl/src/portal.properties (Sau khi bin dch, file portal.properties ny s nm trong file ${AS_ROOT_HOME}/WEB-INF/lib/portalimpl.jar ): velocity.engine.velocimacro.library=VM_global_library.vm,VM_liferay.vm

CH THCH y l 1 iu khc m bn s bit v VTL lm th no thm cc dng ch thch. ## single line comment. #* multi-line comment. *# Trong 1 Velocity template, cc dng ny s c Velocity engine b qua v khng hin ra trn portal page. Ngi dng s khng thy chng. c thm thng tin v VTL, bn c th tham kho Velocity User Guide at http://velocity.apache.org/.

7

B. Velocity template trong Liferay I. Velocity v Liferay1.

Ti sao Velocity l template mc nh ca Liferay- Velocity template l template c mc nh trong Liferay.( Liferay cn c 1

template na l Free Maker). Vy ti sao Liferay khng la chn Free Maker lm template mc nh cho mnh? L do l: Free Maker ch mi c h tr trong Liferay v cha c kim tra k lng. Cc Liferay developers qu quen thuc vi Velocity, h cho rng It is core to Liferay. Th nn vic thay i l khng h d dng. Tuy nhin th, Free Maker cng c 1 s u th: Mt s ngi quyn lc trong Liferay v nhiu developers rt nhit tnh vi Free Maker. Hu ht nhng g Velocity lm c th Free Maker cng lm c.

8

Free Maker c 1 s u im so vi Velocity. V d, trong Velocity, c kh khn khi truy cp vo cc thuc tnh tnh (static fields), cn trong Free Maker th khng, th nn nhiu developers la chn Free Maker to source code cho mnh. Rt c th trong tng lai, Free Maker s thay th cho Velocity trong Liferay.

- Velocity template c s dng trong ba v tr trong m hnh Liferay : Theme Portlet Web content

2.

Cc Velocity template mc nh trong LiferayMc nh trong Liferay c 5 file Velocity template c to ra khi trin khai 1 theme

gm : init_custom.vm : file ny cho php bn ghi v nh ngha cc bin velocity mi.9

navigation.vm : file ny c gi t portal_normal.vm v cung cp HTML to cc navigation menus. portal_normal.vm : file ny iu khin khung HTML c bn ca trang m Liferay s phc v. portal_pop_up.vm : file ny iu khin layout ca cc portal templates dnh cho thng bo dng pop-up. porlet.vm : file ny gi cc phn ca mi porlet. init_custom.vm Trong file ny, bn c th khai bo mi bin s dng trong portal_normal.vm . + Khai bo 1 bin velocity mi ( trn l $any_custom_name) s dng cho theme. + C th ghi gi tr ca cc bin velocity c ( nh trn l $company_name ) nu bn c bin cng tn y. V d: #set ($theme_name = "palm-tree-publications-theme") #set ($the_title = "Palm Tree Publications Theme") #set ($company_name = "Palm Tree Publications Inc.") #set ($community_name = "Palm Tree Publication Reviewers") #set ($any_custom_name = "This is just a sample custom name") portal_normal.vm y l file chnh phc v , ging nh l main frame ca template. Mi bin mi hoc tn ti c nh ngha trong file init_custom.vm c th c gi trong file ny. Bn c th thm mi hoc thay i cc m HTML hoc gi cc nh ngha CSS trong file ny hon tt thit k ca bn. V d, bn c th mun thay i hin th ni dung v/hoc look and feel ca cc vng header hoc footer. ty bin footer , ta thay i m gia 2 th , l cc phn t HTML5. Nu cn thm 1 velocity template mi, nh l10

docroot/_diffs/templates/any_custom_velocity_file.vm => dng di y s c thm vo file portal_normal.vm : #parse ("$full_templates_path/any_custom_velocity_file.vm") navigation.vm Navigation template c gi trong file portal_normal.vm , hin th navigation menu: #if ($has_navigation) #parse ("$full_templates_path/navigation.vm") #end Thay i file navigation.vm thay i hin th ca navigation menu.

porlet.vm Template ny xc nh lm th no 1 porlet chun c a ra trn 1 trang portal. N c gi trong portal_normal.vm: $theme.wrapPortlet("portlet.vm", $content_include) C th thm cc tnh nng khc , nh cc print v help icon, hoc xa 1 s icons c sn nh minimize, maximize hoc close trong file porlet.vm . Ghi nh rng thay i trn s s p dng cho tt c cc trang s dng theme ny. C th xem cc Velocity tags c th s dng cho theme trong file: ${liferay.portal.src.dir}\util-taglib\src\com\liferay\taglib\util\VelocityTaglib.java Mi phng thc trong file ny c th s dng trong theme nh 1 Velocity tag , phng thc c dng : $theme.{method.name}. v d nh:

$theme.iconOptions() $theme.iconMinimize()11

$theme.iconMaximize() $theme.iconClose() $theme.iconPortlet() $theme.search() portal_pop_up.vm File ny c ng dn : /docroot/_diffs/templates/portal_pop_up.vm . File ny c s dng ty bin look and feel ca cc ca s thng bo dng pop-up. i vi cc Velocity template trong Liferay, chng ta c th: Thm 1 template mi n c gi bi file portal_normal.vm. Mi template ph trch 1 s thnh phn no ca theme. Nu mun thm 1 s thnh phn mi hay thng tin ph, ch vic to 1 template mi v thm n vo file portal_normal.vm hoc file portal_popup.vm. Thay i cc file template c. O Thay i cc gi tr tham s ca Velocity trong file init_custom.vm O Thay i ni dung trong cc template h tr v d nh file navigator.vm v portlet.vm O Thm mt portlet trong mt template s hin th trong theme

12

II. To giao din vi Velocity template

1.

Velocity template trong themes1.1 Ti sao, khi no dng Velocity template trong theme Cu hi t ra l: ty chnh themes, bn c th ko th cc portlet v t vo v tr no mnh mun trong theme, nh vy d dng, nhanh v trc quan hn rt nhiu. Vy ti sao li s dng Velocity template, phi sa code , ri thc thi li theme Tr li: Vic ko th cc portlet ch p dng cho trang web hin ti ang dng theme , ch khng phi p dng cho theme, khng th chnh sa thc s c theme . Nu nh 1 portlet cn phi nhng nhiu ln, mi ln to 1 trang web bn li phi ko th portlet vo trong theme ca trang web . S rt mt cng lm i lm li. Bng vic s Velocity template, bn c th sa theme thc s, theme sau khi c chnh sa c th p dng cho mi trang web sau ny s dng themes . Vic nhng portlet ch lm 1 ln m vn c p dng nhiu ln, bt k khi no s dng themes chnh sa.

Vy, chng ta s dng Velocity template ty bin theme khi:

Phi s dng 1 theme no nhiu ln, v trong theme c 1 s portlet phi dng li nhiu ln => s dng Velocity template nhng c nh cc portlet cn dng vo theme . 1.2 p dng Velocity template trong theme Chng ta c th ty bin theme thng qua Velocity template. S dng cc Velocity template c hoc to template mi :13

-

Thm vo 1 thnh phn giao din thng qua 1 template. Nhng 1 porlet vo trong theme. S dng cc Liferay service qua Velocity template.

-

1.2.1 Thm 1 thnh phn giao din vo theme Chng ta c th thm nhiu thnh phn giao din vo trong theme thng qua 1 template. V nh 1 tm kim, hay 1 danh sch ng link ti cc trang khc vi ty chnh hin th bng CSS, Chng ta i vo v d c th: y chng ta thm vo theme : 1 tm kim v 1 danh sch cc ng link cui trang.a.

u tin chng ta to v trin khai 1 theme no . y to v trin khai

theme Noir:

Chy lnh create.bat noir Noir sau khi t mn hnh cmd vo ng

dn PLUGINS_SDK_HOME}/themes/ . Cu lnh ny s to mt theme c tn l Noir. Trong th mc theme, th mc con noir-theme s c to.

Sao chp cc th mc css, images, js v templates vo folder _diffs theo

ng dn ${PLUGINS_SDK_HOME}/themes/noir-theme/docroot/_diffs/

Chy lnh ant deploy trong ng dn $

{PLUGINS_SDK_HOME}/themes/noir-theme/ b.

Mt theme Noir c to v trin khai (deploy). Chng ta c th thm 1 tm kim vo theme ny 1 cch rt n gin nh

sau: Thm on m sau vo template portal_normal.vm : $theme.journalContentSearch() 14

Trong on code trn:

$theme l bin tham chiu n i tng theme, l i tng ca lp com.liferay.portal.model.Theme

journalContentSearch() l 1 phng thc ca i tng theme on m trn c vit vi mt th . N s to ra mt hp tm kim ni

dung web. Bn c th nhp vo mt t kha trong hp v n phm Enter tm kim ni dung web theo t kha.c.

Hin th 1 s link n cc trang khc cui trang: Thm vo on m sau vo template portal_normal.vm:

#parse ("$full_templates_path/bottom_navigator.vm")

on m trn s phn tch mt file bottom_navigator.vm, m u ra l mt danh sch khng sp xp cc ng link. Danh sch ny sau s c chuyn i thnh

  • cc dng vn bn thng qua CSS. #foreach ($nav_item in $nav_items) Chng ta s thm mt file bottom_navigator.vm trong th mc templates theo #if ($nav_item.isSelected()) ng dn ${PLUGINS_SDK_HOME}/themes/noir-theme/docroot/_diffs/templates. #set ($nav_item_class = "selected") Ni dung ca n nh sau : #else #set ($nav_item_class = "") #end
  • 15 $nav_item.getName()

    Chng ta thm mt vi on m CSS vo trong file custom.css theo ng link sau $

    {PLUGINS_SDK_HOME}/themes/noir-theme/docroot/_diff/css/custom.css :

    #footer { background: url(../images/calendar/day_heading.png) no-repeat; color: #739ABE; height: 106px; position: relative;

    16

    V y l kt qu:

    1.2.2 Nhng 1 portlet sn c vo trong theme i khi vic chng ta nhng mt portlet sn c vo mt theme l cn thit. Chng ta c th nhng mt portlet trong mt theme thng qua mt template Velocity no nh portal_normal.vm.17

    Portlet c nhng thng cha mt lng thng tin kh nh.V d nh c th l mn hnh ng nhp. N cng c th c dng hin th mt s ty chnh ni dung ng. Chng ta thc hin cc bc di y thm mt portlet vo mt theme :1. To mt portlet Embed v thc thi n.

    Trong cmd, ch ng dn ti ${PLUGINS_SDK_HOME}/portlets/ Chy cu lnh create embed Embed , 1 folder embed-portlet s c to ra.

    Ch ng dn ti th mc va to: ${PLUGINS_SDK_HOME}/portlets/embed-

    portlet/ . Chy cu lnh ant deploy . Portlet Embed va to c thc thi. 2. Trong file portal_normal.vm ca theme Noir theme, thm on m sau : $theme.runtime("embed_WAR_embedportlet_INSTANC E_6CMo") Tng qut ca khai bo nhng 1 portlet vo trong 1 theme l: $theme.runtime(portlet.id) Vic chng ta phi quan tm l lm th no ly c portlet.id ca 1 portlet? Ta lm nh sau: - Nhng 1 portlet(portlet ang cn tm id) vo trong trang no (ko,th).-

    Trong khung ca portlet cn tm chn Configuration -> Sharing. Tm portletid d hnh dung, ta c v d sau:-

    Portlet Hi c to sn. Ko th vo 1 trang no . Chn phn Configuration

    -

    18

    o

    Chn th sharing, v tm id ca portlet. Nh trong hnh v, portletid ca portlet Hi l : hi_War_hiportlet_INSTANCE_18qD

    19

    Sau khi nhng portlet xong, ta xem kt qu: Thc thi li theme Noir v ti li trang tin. Portlet c nhng s hin th vi cc ng bao ngoi. V i khi ng bao ngoi s lm cho vic hin th trang web khng c p, vy nn ta c th ty chnh, b i ng bao ngoi ca portlet va nhng vo theme.3. Click vo biu tng thit lp cu hnh trn portlet Embed . Click vo Look and

    Feel.4. B du tch Show Borders v click vo nt Save. 5. ng ca s Look and Feel v ti li trang- cc ng bo ngoi ca portlet

    c b i, chnh sa cho portlet c nhng hon chnh. Bn c th nhn thy dng This is the Embed portlet trn u trang, l dng c hin th bi portlet Embed. Bn c th cu hnh file portlet.xml ${PLUGINS_SDK_HOME}/portlets/embedportlet/docroot/WEB-INF/portlet.xml nh sau b i ng vin : portlet-setup-show-borders false

    20

    Kt qu l:

    Sau khi b ng bao ngoi:

    21

    Hin nhin l bn c th nhng nhiu portlet vo cng mt theme.

    1.2.3 S dng Liferay services C nhiu tnh nng mnh m chng ta c th s dng trong Velocity templates, in hnh l nhng dch v Liferay. Nhng dch v cu Liferay c th c s dng truy cp nhiu ti nguyn t cng kt ni. V d, ta s th s dng LayoutLocalService. Di y l code : #set($layoutService=serviceLocator.findService("com.liferay.por tal.service.LayoutLocalService")) #set($layouts=layoutService.getLayouts($layout.getGroup().get GroupId(), false)) #foreach ($page in $layouts) $page.getName($locale) | #end Copy on trch code v paste ch ph hp trong file portal_normal.vm. Khi chy, n s in ra tn ca tt c nhng public web (cc trang vi cho php mi ngi u c th truy nhp) trong tp cc web. Tn ca cc trang web s c phn nh bng 1 thanh ng. Velocity khng c chc nng x l cc trng hp ngoi l trong khi nhiu dch v Liferay khc cng b qua cc ngoi l ny. b li, Liferay a ra mt phng thc l findExceptionSafeService dnh cho i tng $serviceLocator .Vy nn, ta c th lm nh sau :

    #set($layoutService=$serviceLocator.findExceptionSafeService("com.li feray.portal.service.LayoutLocalService")) Khi ta s dng phng thc ny, nu 1 ngoi l b b qua trong $layoutService, n s ko th ph hng Velocity engine. Phng thc findExceptionSafeService gi gn ht22

    nhng dch v c bn vi 1 proxy, n s bt cc ngoi l v tr li gi tr null.

    Velocity trong portletTo 1 portlet vi Velocity v s dng n C rt nhiu cch s dng Velocity templates. V d, ta c th s dng 1 Velocity template to body ca 1 email. Ta t phn body ca email trong 1 templates thay cho vic to hard-coding (ct cng) trong Java. Ta cng t tn ngi gi v a ch email ca h trong file portlet.properties. - Chy creat.bat vmail Vmail trong th mc ${ PLUGINS_SDK_HOME}/portets/ - To 1 template ${PLUGINS_SDK_HOME}/potlets/vmail-portlet/docroot/WEBINF/src/com/sample/jsp/portlet/etemplate.vm c ni dung nh sau: Thank you for your exellent work on $company.get ProjectName () for $company.getCompanyName () -To 1 file {PLUGINS_SDK_HOME}/portlets/vmail-portlet/docroot/

    WEB-INF/src/com/sample/jsp/portlet/JSPPortlet.java vi ni dung nh sau:

    String template = StringUtil.read(getClass().getClassLoader(), "com/sample/jsp/portlet/etemplate.vm", false); Ecompany eCom = new Ecompany(); variables.put("company", eCom); String fromAddress = PortletProps.get("fromEmailAddr"); String body = Velocity.evaluate(velocityContext, strWriter, JSPPortlet.class.getName(),template); String toEmailAddr = ParamUtil.getString(actionRequest, "emailAddr"); InternetAddress from = new InternetAddress(fromAddress,23

    - Thm on m di y vo file ${PLUGINS_SDK_HOME}/portlets/vmailportlet/docroot/view.jsp:

    - Trin khai porlet Vmail. Code c trong email template com/sample/jsp/portlet/etemplate.vm l 1 chui. Mt i tng com.sample.jsp.portlet.Ecompany c khi to v c t trong i tng java.util.Map . i tng java.util.Map v chui k t mu c truyn vo Velocity engine hon tt mi vic. Chui vn bn mu c gi ti ngi dng chnh l phn body text ca email. Tn v a ch hm th ca ngi dng c ly t giao in ngi dng.

    Sau khi thm Vmail portlet vo 1 trang, bn s thy

    24

    Sau khi bn g username v a ch email, click nt Submit, 1 email s c gi n ngi dung ( nu dch v mail c ci t ng). Phn chnh ca email s c phn chia da theo ${PLUGINS_SDK_HOME}/portlets/vmailca portlet/docroot/WEB-INF/src/com/sample/jsp/portlet/etemplate.vm Velocity template.

    2. Velocity template trong web contentVelocity templates cng c s dng trong qun l ni dung web trong Liferay. Web content khi c hin th trong portlet Web Content Display bao gm 3 phn: . Structure (ty chn) . Template (ty chn) . Content Structure nh ngha cc bin(placeholders) cho content. Content l gi tr ca cc bin. Template nh ngha ni t cc content. Web content template cng ging nh portal_normal.vm template . im khc bit l portal_normal.vm template p dng cho ton b trang portal, cn Web content template ch p dng cho cc khu vc trong Web Content Display portlet.

    25

    3.1 To v s dng Velocity template cho web content y, chng ta cu trc cho web content vi 1 Velocity template nh sau: 1. ng nhp vo Liferay. 2. Thm Structure vo Web Content. Trong phn Add Struture lm nh sau: - Nhp ID l WEEV-STRUCTURE. - phn Add Row, chn kiu d liu cho CSS l Text Area, image-url, title, description, link-url, link-name cng l Text. - Lu li. 3. Thm Template. Trong phn Add Template lm nh sau: - Nhp ID l WEEV-TEMPLATE. - i vi Structure, chn WEEV-STRUCTURE. - Chn Launch Editor. Xa mi content ang c. Nhp template content code vo trong hp thoi. - Lu li. 4. Thm Web Content - Chn WEEV-TEMPLATE - Vi css v description , chn HTML - Publish. => vic to web content hon thnh 5. S dng web content - To thm 1 trang Content-Page Homepage ca Liferay - Add thm portlet Web Content Display vo trang va to. - Trong phn config ca portlet va thm, chn WEEV-ARTICLE ri lu li.

    26

    V cui cng l kt qu :

    Noi dung cua WEEV-TEMPLATE nhu sau: $css.getData()

  • $title.getData()
  • $description.getData()
  • $link- name.getData() 27Template c nh ngha vi cc bng HTML. Cc tham chiu Velocity c s dng thit lp ng cc gi tr. Cc bin css, image-url, title, description, link-url, v link-name c khai bo trong WEEV-STRUCTURE. Cc gi tr ca chng c p dng trong WEEV-ARTICLE. Velocity engine s hon thin template ny.2.1 Lu tr Velocity template dng cho web content Velocity templates c lu trong folder {THEME_NAME}/templates/ tng ng ca theme trong khi Velocity template cho web content c lu trong c s d liu. Vy lm th no Liferay tm thy v np chng ? Nguyn l ca n c thc thi trong Velocity listeners. N c cu hnh trong file impl/src/portal.properties nh sau : velocity.engine.resource.listeners=com.liferay.portal.velocity.ServletVelocityResourc eListener,com.liferay.portal.velocity.JournalTemplateVelocityResourceListener,com.lifer ay.portal.velocity.ThemeLoaderVelocityResourceListener,com.liferay.portal.velocity.Cla ssLoaderVelocityResourceListener Cc listeneres k th t lp com.liferay.util.velocity.VelocityResourceListener . Mi listener tr v 1 i tng java.io.InputStream tng ng vi Velocity template c np vo. ${PORTAL_SRC_HOME}/portal-2829C. Tham chiu ca Velocity ti cc thnh phn trong LiferayRt nhiu ch dn v Velocity c t trong Velocity context trong phng thc insertHelperUtilities() ca lp com.liferay.portal.velocity.VelocityVariables. Nhng ch dn khc c thm vo ti phng thc doTransform(...) ca lp com.liferay.portlet.journal.util.VelocityTemplateParser. C th dng k hiu $ tham chiu trc tip ti cc i tng di y trong themes template v/hoc web content templates.1.Tham chiu Velocity ti c themes v web contentNhng tham chiu ny c t trong context ca Velocity vi phng thc ...insertHelperUtilities(...) ca lp com.liferay.portal.velocity.VelocityVariables303132332.Tham chiu Velocity ti ring themesCc tham chiu ti cc object c t trong insertVariables(...) , l phng thc ca lp com.liferay.portal.velocity.VelocityVariables. Cc i tng di y ch c th s dng cho theme template. Tuy nhin, bn cng c th t to tao cc tham chiu ti theme templates.34353.Tham chiu Velocity ti ring web contentCc tham chiu c t trong Velocity context trong phng thc doTransform(...) ca lp com.liferay.portlet.journal.util.VelocityTemplateParser. xmlRequest: A string request: A java.util.HashMap object company: A com.liferay.portal.model.Company object companyId: A string groupId: A string journalTemplatesPath: A string viewMode: A string locale: A java.util.Locale object permissionChecker: A com.liferay.portal.security.permission. PermissionChecker object randomNamespace: A string36