Langkah Awal - Membuat Modul Itemcategory - Menambahkan Kode Pada Modul Item 2. Percobaan - Membuat Class Entity Itemcategory

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 22

Modul Praktikum Cimande-2.0 (2) 1. Langkah Awal Membuat Modul ItemCategory Menambahkan kode pada Modul Item 2.

2. Percobaan Membuat Class Entity ItemCategory ItemCategory. a!a


package org.blueoxygen.meruvian.training.entity; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Table; import org.blueoxygen.cimande.commons.DefaultPersistence; @Entity @Table(name public class &tring &tring &tring !app"category!# $temCategory extends DefaultPersistence % code; name; description;

@Column public &tring getCode(# % return code; ' public void setCode(&tring code# % this.code code; ' @Column public &tring get(ame(# % return name; ' public void set(ame(&tring name# % this.name name; ' @Column public &tring getDescription(# % return description; ' public void setDescription(&tring description# % this.description description; ' '

"et # $ama Package - org.blueoxygen.meruvian.training.entity

Menambahkan Mapping Class pada hibernate.cfg.xml

)mapping class "org.blueoxygen.meruvian.training.entity.ItemCategory" *+

Membuat Interface Service

ItemCategory%er!ice. a!a
package org.blueoxygen.meruvian.training.itemcategory.service; import java.util.,ist; import org.blueoxygen.meruvian.training.entity.$temCategory; public interface $temCategory&ervice % void save($temCategory itemcategory#; void delete($temCategory itemcategory#; $temCategory get$temCategory-y$d(&tring id#; ,ist)$temCategory+ get.ll$temCategoryes(#; ,ist)$temCategory+ find$temCategoryes(&tring code/ &tring name/ &tring description/ &tring orderby/ int max0esults/ int first0esult#; ,ist)$temCategory+ find$temCategoryes-y1ield(&tring field/ &tring value#; ' int get0o2Count-yCriteria(&tring code/ &tring name/ &tring description#;

"et # $ama Package - org.blueoxygen.meruvian.training.itemcategory.service uat Class ItemCategoryServiceImpl.!ava

ItemCategory%er!iceIm&l. a!a package org.blueoxygen.meruvian.training.itemcategory.service" import !ava.util.#ist" import org.blueoxygen.cimande.persistence.hibernate.dao.$ibernate%ersistence&aoManager" import org.blueoxygen.meruvian.training.entity.ItemCategory" import org.hibernate.Criteria" import org.hibernate.criterion.MatchMode" import org.hibernate.criterion.%ro!ections" import org.hibernate.criterion.'estrictions" import org.springframe(ork.stereotype.'epository" import org.springframe(ork.transaction.annotation.)ransactional" *'epository

*)ransactional+read,nly - true. public class ItemCategoryServiceImpl extends $ibernate%ersistence&aoManager/ItemCategory0 implements ItemCategoryService 1 *)ransactional public void save+ItemCategory itemcategory. 1 if +itemcategory 2- null. 1 if +itemcategory.getId+. -- null 33 44.e5ualsIgnoreCase+itemcategory.getId+... 1 itemcategory.get#ogInformation+..setCreate y+getCurrent6ser+..getId+.." itemcategory.get#ogInformation+..set#ast6pdate y+ getCurrent6ser+..getId+.." itemcategory.get#ogInformation+..setCreate&ate+getCurret)ime+.." itemcategory.get#ogInformation+..set#ast6pdate&ate+getCurret)ime+.." itemcategory.get#ogInformation+..set7ctive8lag+1." persist+itemcategory." 9 else 1 itemcategory.get#ogInformation+..set#ast6pdate y+ getCurrent6ser+..getId+.." itemcategory.get#ogInformation+..set#ast6pdate&ate+getCurret)ime+.." merge+itemcategory." 9 9 9 *)ransactional public void delete+ItemCategory itemcategory. 1 if +itemcategory 2- null :: itemcategory.getId+. 2- null. 1 itemcategory - get yId+ItemCategory.class; itemcategory.getId+.." remove+itemcategory." 9 9 *)ransactional+read,nly - true. public ItemCategory getItemCategory yId+String id. 1 return get yId+ItemCategory.class; id." 9 *)ransactional+read,nly - true. public #ist/ItemCategory0 get7llItemCategoryes+. 1 return find7ll+ItemCategory.class." 9 *Suppress<arnings+4unchecked4. *)ransactional+read,nly - true. public #ist/ItemCategory0 findItemCategoryes+String code; String name; String description; String orderby; int max'esults; int first'esult. 1

Criteria criteria - session8actory.getCurrentSession+..createCriteria+ ItemCategory.class." criteria.add+'estrictions.like+4code4; code = 44; MatchMode.7>?<$E'E.." criteria.add+'estrictions.like+4name4; name = 44; MatchMode.7>?<$E'E.." criteria.setMax'esults+max'esults." criteria.set8irst'esult+first'esult." return criteria.list+." 9 *Suppress<arnings+4unchecked4. *)ransactional+read,nly - true. public #ist/ItemCategory0 findItemCategoryes y8ield+String field; String value. 1 Criteria criteria - session8actory.getCurrentSession+..createCriteria+ ItemCategory.class." criteria.add+'estrictions.like+field; value.." return criteria.list+." 9 *)ransactional+read,nly - true. public int get'o(Count yCriteria+String code; String name; String description. 1 Criteria criteria - session8actory.getCurrentSession+..createCriteria+ ItemCategory.class." criteria.add+'estrictions.like+4code4; code = 44; MatchMode.7>?<$E'E.." criteria.add+'estrictions.like+4name4; name = 44; MatchMode.7>?<$E'E.." criteria.set%ro!ection+%ro!ections.ro(Count+.." return Integer.parseInt+criteria.uni5ue'esult+..toString+.." 9 9 uat Class ItemCategory8orm

ItemCategory'orm. a!a package org.blueoxygen.meruvian.training.itemcategory.actions" import !ava.util.7rray#ist" import !ava.util.#ist" import org.blueoxygen.cimande.commons.Cimande7ction" import org.blueoxygen.meruvian.training.entity.ItemCategory" import org.blueoxygen.meruvian.training.itemcategory.service.ItemCategoryService" import org.springframe(ork.beans.factory.annotation.7uto(ired" public class ItemCategory8orm extends Cimande7ction 1 protected ItemCategory itemcayegory" protected #ist itemcategorys - ne( 7rray#ist+." private String id" private String code" private String name"

private String description" protected *7uto(ired ItemCategoryService service" public String execute+. 1 return S6CCESS" 9 public ItemCategory getItemcayegory+. 1 return itemcayegory" 9 public void setItemcayegory+ItemCategory itemcayegory. 1 this.itemcayegory - itemcayegory" 9 public #ist getItemcategorys+. 1 return itemcategorys" 9 public void setItemcategorys+#ist itemcategorys. 1 this.itemcategorys - itemcategorys" 9 public String getId+. 1 return id" 9 public void setId+String id. 1 this.id - id" 9 public String getCode+. 1 return code" 9 public void setCode+String code. 1 this.code - code" 9 public String get>ame+. 1 return name" 9 public void set>ame+String name. 1 this.name - name" 9

public String get&escription+. 1 return description" 9 public void set&escription+String description. 1 this.description - description" 9 9 uat class SaveItemCategory

%a!eItemCategory. a!a package org.blueoxygen.meruvian.training.itemcategory.actions" import org.blueoxygen.meruvian.training.entity.ItemCategory" public class SaveItemCategory extends ItemCategory8orm 1 private ItemCategory itemcategory- ne( ItemCategory+." public String execute+. 1 itemcategory.setId+null." itemcategory.setCode+getCode+.." itemcategory.set>ame+get>ame+.." itemcategory.set&escription+get&escription+.." if +itemcategory.get>ame+. -- null 33 44.e5ualsIgnoreCase+itemcategory.get>ame+... 1 add7ctionError+4>ama tidak boleh kosong 2 4." 9 if +itemcategory.getCode+. -- null 33 44.e5ualsIgnoreCase+itemcategory.getCode+... 1 add7ctionError+4 @ode )idak boleh kosong 2 4." 9 if +hasErrors+.. 1 return INPUT" 9 service.save+itemcategory." return SUCCESS" 9 9

uat class SearchItemCategory

%earchItemCategory. a!a package org.blueoxygen.meruvian.training.itemcategory.actions" import !ava.util.7rray#ist" import !ava.util.#ist" public class SearchItemCategory extends ItemCategory8orm 1 private int max%age; curr%age; next%age; prev%age - A; page - A" private int max'o(%er%age - 1A" private String order y - 4name4" private int result'o(s" public String execute+. 1 result'o(s - service.get'o(Count yCriteria+getCode+.; get>ame+.; get&escription+.." max%age - result'o(s B max'o(%er%age" if +result'o(s C max'o(%er%age -- A. max%age - max%age D 1" itemcategorys - service.findItemCategoryes+getCode+.; get>ame+.; get&escription+.; get,rder y+.; getMax'o(%er%age+.; curr%ageE max'o(%er%age." prev%age - curr%age D 1" next%age - curr%age = 1" page - curr%age = 1" modelMap.put+4itemcategoryslist4; itemcategorys." return SUCCESS" 9 public int getMax%age+. 1 return max%age" 9 public void setMax%age+int max%age. 1 this.max%age - max%age" 9 public int getCurr%age+. 1 return curr%age" 9 public void setCurr%age+int curr%age. 1 this.curr%age - curr%age" 9 public int get>ext%age+. 1

return next%age" 9 public void set>ext%age+int next%age. 1 this.next%age - next%age" 9 public int get%rev%age+. 1 return prev%age" 9 public void set%rev%age+int prev%age. 1 this.prev%age - prev%age" 9 public int get%age+. 1 return page" 9 public void set%age+int page. 1 this.page - page" 9 public int getMax'o(%er%age+. 1 return max'o(%er%age" 9 public void setMax'o(%er%age+int max'o(%er%age. 1 this.max'o(%er%age - max'o(%er%age" 9 public String get,rder y+. 1 return order y" 9 public void set,rder y+String order y. 1 this.order y - order y" 9 public int get'esult'o(s+. 1 return result'o(s" 9 public void set'esult'o(s+int result'o(s. 1 this.result'o(s - result'o(s" 9 9

uat class EditCategory#oad

(ditCategoryLoad. a!a package org.blueoxygen.meruvian.training.itemcategory.actions" import org.blueoxygen.meruvian.training.entity.ItemCategory" import com.sun.net.httpserver.7uthenticator.Success" public class EditCategory#oad extends ItemCategory8orm 1 public String execute+. 1 ItemCategory itemcategory - service.getItemCategory yId+getId+.." model - itemcategory" if +itemcategory -- null. 1 add7ctionError+4Cannot find such itemcategory4." return ERROR" 9 else 1 setCode+itemcategory.getCode+.." set>ame+itemcategory.get>ame+.." set&escription+itemcategory.get&escription+.." 9 return SUCCESS" 9 9

uat class EditItemCategory

(ditItemCategory. a!a package org.blueoxygen.meruvian.training.itemcategory.actions" import org.blueoxygen.meruvian.training.entity.ItemCategory" public class EditItemCategory extends ItemCategory8orm 1 public String execute+. 1 ItemCategory itemcategory - ne( ItemCategory+." itemcategory.setId+getId+.." itemcategory.setCode+getCode+.." itemcategory.set>ame+get>ame+.." itemcategory.set&escription+get&escription+.." service.save+itemcategory." return SUCCESS" 9 9

uat class &eleteItemCategory

)eleteItemCategory. a!a package org.blueoxygen.meruvian.training.itemcategory.actions" import org.blueoxygen.meruvian.training.entity.Item" import org.blueoxygen.meruvian.training.entity.ItemCategory" public class &eleteItemCategory extends ItemCategory8orm 1 public String execute+. 1 String result - super.execute+." if +result.e5ualsIgnoreCase+SUCCESS.. 1 ItemCategory itemcategory - service.getItemCategory yId+getId+.." model - itemcategory" set>ame+itemcategory.get>ame+.." service.delete+itemcategory." return SUCCESS" 9 else 1 add7ctionError+4Cannot find such &escriptor4." return ERROR" 9 9 9

"et # $ama Package - org.blueo*ygen.meru!ian.training.itemcategory.action+ ,orm.!m


)lin3 rel !styles4eet! type !text*css! 4ref !..*..*style.css!+ 5if (67actionErrors.isEmpty(## )div class !error8essage!+Errors)*div+ )ul class !error8essage!+ 5foreac4( 7error in 7actionErrors # )li+7error)*li+ 5end )*ul+ 5end )form met4od !post! action !save!+ )table bgcolor !5999999! border !9! cellpadding !:! cellspacing !;! 2idt4 !<=>!+ )tr bgcolor !5d9dcff!+ )td colspan !?!+ )strong+$tem)*strong+ )*td+ )*tr+ )tr bgcolor !5ffffff!+ )td+ @odeA )*td+

uat form.vm pada srcBtemplate didalam package itemcategory

)td+ )input name !code! siBe !?9! value !76code!*+ )*td+ )*tr+ )tr bgcolor !5ffffff!+ )td+ (amaA )*td+ )td+ )input name !name! siBe !?9! value !76name!*+ )*td+ )*tr+ )tr bgcolor !5ffffff!+ )td+ @eteranganA )*td+ )td+ )input name !description! siBe !?9! value !76description!*+ )*td+ )*tr+ )tr bgcolor !5eCeCeC!+ )td colspan !?!+ )input type !submit! value !&ave!*+ )input type !4idden! name !id! value !76id!*+ )*td+ )*tr+ )*table+ )*form+

,ilter.!m

uat filter.vm

)lin3 rel !styles4eet! type !text*css! 4ref !..*..*style.css!+ )form met4od !post! action !searc4!+ )table bgcolor !5999999! border !9! cellpadding !:! cellspacing !;! 2idt4 !<=>!+ )tr bgcolor !5d9dcff!+ )td colspan !?!+ )strong+$tem)*strong+ )*td+ )*tr+ )tr bgcolor !5ffffff!+ )td+ @odeA )*td+ )td+ )input name !code! siBe !?9! value !76code!*+ )*td+ )*tr+ )tr bgcolor !5ffffff!+ )td+

(amaA )*td+ )td+ )input name )*td+ )*tr+ )tr bgcolor )td colspan )input type )*td+ )*tr+ )*td+ )*tr+ )*table+ )*form+

!name! siBe !?9! value !76name!*+ !5eCeCeC!+ !?!+ !submit! value !&earc4!*+

re+ult.!m

uat result.vm

)lin3 rel !styles4eet! type !text*css! 4ref !..*..*style.css!+ )body+ )table bgcolor !5999999! border !9! cellpadding !:! cellspacing !;! 2idt4 !<=>!+ )tr bgcolor !5d9dcff!+ )td colspan !D!+ )strong+$tem)*strong+ )*td+ )*tr+ )tr bgcolor !5eCeCeC!+ )td+@ode)*td+ )td+(ama)*td+ )td+@eterangan)*td+ )td+Price)*td+ )td+.ction)*td+ )*tr+ 5foreac4(7category in 7itemcategorys# )tr bgcolor !5ffffff!+ )td+76category.code)*td+ )td+76category.name)*td+ )td+76category.description)*td+ )td+76category.price)*td+ )td+ )a 4ref !edit.actionEid 76category.id!+ )img src !..*..*images*sil3*page"edit.png! title !Edit! border !9!*+)*a+ )a 4ref !delete.actionEid 76category.id!+ )img src !..*..*images*sil3*delete.png! title !Delete! border !9!*+)*a+ )*td+ )*tr+ 5end )tr bgcolor !5eCeCeC!+ )td colspan !D!+ 5if (7currPage + 9# )a 4ref !searc4.actionEcode 76codeFname 76nameFcurrPage 9!

title !currPage!+ )img src !..*..*images*sil3*resultset"first.png! border !9!+ )*a+5end 5if (7currPage + 9# )a 4ref !searc4.actionEcode 76codeFname 76nameFcurrPage 76 prevPage! title !prevPage!+ )img src !..*..*images*sil3*resultset"previous.png! border !9!+ )*a+5end Gpage 76pageH 5if (7currPage ) 7maxPage# )a 4ref !searc4.actionEcode 76codeFname 76nameFcurrPage 76 nextPage! title !nextPage!+ )img src !..*..*images*sil3*resultset"next.png! border !9!+ )*a+5end 5if (7currPage ) 7maxPage# )a 4ref !searc4.actionEcode 76codeFname 76nameFcurrPage 76 maxPage! title !maxPage!+ )img src !..*..*images*sil3*resultset"last.png! border !9!+ )*a+5end )*td+ )*tr+ )*table+ )*body+

edit.!m

uat edit.vm

)lin3 rel !styles4eet! type !text*css! 4ref !..*..*style.css!+ 5if (67actionErrors.isEmpty(## )div class !error8essage!+Errors)*div+ )ul class !error8essage!+ 5foreac4( 7error in 7actionErrors # )li+7error)*li+ 5end )*ul+ 5end )form met4od !post! action !update!+ )table bgcolor !5999999! border !9! cellpadding !:! cellspacing !;! 2idt4 !<=>!+ )tr bgcolor !5d9dcff!+ )td colspan !?!+ )strong+$tem)*strong+ )*td+ )*tr+ )tr bgcolor !5ffffff!+ )td+ @odeA )*td+ )td+ value !76code!*+ )input name !code! siBe !?9! )*td+ )*tr+

)tr bgcolor !5ffffff!+ )td+ (amaA )*td+ )td+ )input name !name! siBe !?9! value !76name!*+ )*td+ )*tr+ )tr bgcolor !5ffffff!+ )td+ @eteranganA )*td+ )td+ )input name !description! siBe !?9! value !76description!*+ )*td+ )*tr+ )tr bgcolor !5eCeCeC!+ )td colspan !?!+ )input type !submit! value !&ave!*+ )input type !4idden! name !id! value !76id!*+ )*td+ )*tr+ )*table+ )*form+

uat delete.vm delete.!m

)lin3 rel !styles4eet! type !text*css! 4ref !..*..*style.css!+ )form met4od !post! action !confirm.action!+ )table bgcolor !5999999! border !9! cellpadding !:! cellspacing !;! 2idt4 !<=>!+ )tr bgcolor !5d9dcff!+ )td+ )strong+$tem Category)*strong+ )*td+ )*tr+ )tr bgcolor !5ffffff!+ )td align !center!+ Delete $tem Category 76name )*td+ )*tr+ )tr bgcolor !5eCeCeC!+ )td+ )input type !submit! value !Delete!+ )input type !button! value !Cancel! onclic3 !javascriptAlocation.4ref IfilterI!+ )input type !4idden! name !id! value !76id!*+ )input type !4idden! name !name! value !76name!*+ )input type !4idden! name !code! value !76code!*+ )input type !4idden! name !description! value !76 description!*+

)*td+ )*tr+ )*table+ )*form+

uat success.vm

+ucce++.!m
)lin3 rel !styles4eet! type !text*css! 4ref !..*..*style.css!+ )table bgcolor !5999999! border !9! cellpadding !:! cellspacing !;! 2idt4 !<=>!+ )tr bgcolor !5d9dcff!+ )td+ )strong+$tem Category)*strong+ )*td+ )*tr+ )tr bgcolor !5ffffff!+ )td align !center!+ &uccess )*td+ )*tr+ )tr bgcolor !5eCeCeC!+ )td+ Fnbsp; )*td+ )*tr+ )*table+

F.

Menambahkan kode &ada modul Item Menambahkan field category pada Item.!ava

Item. a!a ....... ........... private ItemCategory itemcategory" ...... ...... *Many)o,ne public ItemCategory getItemcategory+. 1 return itemcategory" 9 public void setItemcategory+ItemCategory itemcategory. 1 this.itemcategory - itemcategory" 9 ......

Menambahkan kode berikut pada ItemService.!ava

ItemService.!ava . . . . . . . . . . . . . . . . . . #ist/Item0 findItemes+String code; String name; String description; String itemcategory; String orderby; int max'esults; int first'esult." ...... ......... int get'o(Count yCriteria+String code; String name; String description; String itemcategory." ...... .........

Menambahkan kode berikut pada ItemServiceImpl.!ava

ItemServiceImpl.!ava ...... ...... *Suppress<arnings+4unchecked4. *)ransactional+read,nly - true. public #ist/Item0 findItemes+String code; String name; String description; String itemcategory; String orderby; int max'esults; int first'esult. 1 Criteria criteria - session8actory.getCurrentSession+..createCriteria+ Item.class." criteria.add+'estrictions.like+4code4; code = 44; MatchMode.ANYWHERE.." criteria.add+'estrictions.like+4name4; name = 44; MatchMode.ANYWHERE.." criteria.add+'estrictions.like+4itemcategory.id4; itemcategory = 44; MatchMode.ANYWHERE.." criteria.setMax'esults+max'esults." criteria.set8irst'esult+first'esult." return criteria.list+." 9 ...... ...... *)ransactional+read,nly - true. public int get'o(Count yCriteria+String code; String name;

String description; String itemcategory. 1 Criteria criteria - session8actory.getCurrentSession+..createCriteria+ Item.class." criteria.add+'estrictions.like+4code4; code = 44; MatchMode.ANYWHERE.." criteria.add+'estrictions.like+4name4; name = 44; MatchMode.ANYWHERE.." criteria.add+'estrictions.like+4itemcategory.id4; itemcategory = 44; MatchMode.ANYWHERE.." criteria.set%ro!ection+%ro!ections.rowCount+.." return Integer.parseInt+criteria.uni5ue'esult+..toString+.." 9 ..... ..... Menambahkan kode berikut pada Item8orm.!ava

Item8orm.!ava ....... ....... protected ItemCategory itemcategory - ne( ItemCategory+." protected #ist itemcategorys - ne( 7rray#ist+." ..... protected *7uto(ired ItemCategoryService serviceCategory" public String execute+. 1 setItemcategorys+serviceCategory.get7llItemCategoryes+.." return SUCCESS" 9 ...... ...... public ItemCategory getItemcategory+. 1 return itemcategory" 9 public void setItemcategory+ItemCategory itemcategory. 1 this.itemcategory - itemcategory" 9 public #ist getItemcategorys+. 1 return itemcategorys" 9

public void setItemcategorys+#ist itemcategorys. 1 this.itemcategorys - itemcategorys" 9 ..... ........ Menambahkan kode berikut pada SaveItem.!ava

SaveItem.!ava ........ ...... .. item.setItemcategory+getItemcategory+.." .... if +itemcategory.getId+. 2- null :: 244.e5ualsIgnoreCase+itemcategory.getId+... 1 setItemcategory+serviceCategory.getItemCategory yId+getId+..." 9 else 1 setItemcategory+null." 9 if +hasErrors+.. 1 setItemcategorys+serviceCategory.get7llItemCategoryes+.." return INPUT" 9 ..... ........ Menambahkan kode berikut pada SearchItem.!ava

SearchItem.!ava ...... . ....... public String execute+. 1 result'o(s - service.get'o(Count yCriteria+getCode+.; get>ame+.; get&escription+.; getItemcategory+..getId+.." max%age - result'o(s B max'o(%er%age" if +result'o(s C max'o(%er%age -- A. max%age - max%age D 1" itemes - service.findItemes+getCode+.; get>ame+.; get&escription+.; getItemcategory+..getId+.; get,rder y+.; getMax'o(%er%age+.; curr%age E max'o(%er%age."

prev%age - curr%age D 1" next%age - curr%age = 1" page - curr%age = 1" modelMap.put+4itemeslist4; itemes." return SUCCESS" 9 ...... ..... .... ... . .. .

Menambahkan kode berikut pada itemBform.vm

form.vm .. . . . . . . . . .
)*tr+ )tr bgcolor !5ffffff!+ )td+ PriceA )*td+ )td+ )input type !text! name !price! class !number! id !cprice! siBe !?9! value !76price!*+ )*td+ )*tr+ )tr bgcolor !5ffffff!+ )td+ @ategoriA )*td+ )td+ )select name !itemcategory.id!+ 5foreac4(7c in 7itemcategorys# )option value !76c.id! 5if(7c.id 76item.itemcategory.id# selected 5end+ 76c.name )*option+ 5end )*select+ )*td+ )*tr+ . . . . . . . . . . . .

Menambahkan kode berikut pada itemBfilter.vm

filter.vm . . . . . . . . . . . . . . . . . . .
(amaA )*td+ )td+ )input name !name! siBe !?9! value !76name!*+ )*td+ )*tr+ )tr bgcolor !5ffffff!+ )td+ @ategoriA )*td+ )td+ )select name !itemcategory.id!+ )option value !!+&emua @ategori)*option+ 5foreac4(7c in 7itemcategorys# )option value !76c.id!+76c.name)*option+ 5end )*select+ )*td+ )*tr+ . . . . . . . . . . . .

Menambahkan kode berikut pada itemBresult.vm

result.vm . . . . . . . . . . . . . . . . .
)tr bgcolor !5eCeCeC!+ )td+@ode)*td+ )td+(ama)*td+ )td+@eterangan)*td+ )td+Price)*td+ )td+@ategory)*td+ )td+.ction)*td+ )*tr+ 5foreac4(7item in 7itemes# )tr bgcolor !5ffffff!+ )td+76item.code)*td+ )td+76item.name)*td+ )td+76item.description)*td+ )td+76item.price)*td+ )td+76item.itemcategory.name)*td+ . . . . . . . . . . . . . . . . .

Menambahkan kode berikut pada strutsDitem.xml

strutsDitem.xml . . . . . . . . . . . . . . . . . . .. . . /package name-"itemcategor " extends-"!e"ault" namespace-"#mo!ule#itemcategor "0 /action name-"create" $ class-"org%&lueo' gen%meru(ian%training%itemcategor %actions%ItemCategor )orm"0 /result name-"success" type-"(elocit "0 BitemcategoryBform.vm /Bresult0 /Baction0 /action name-"sa(e" $ class-"org%&lueo' gen%meru(ian%training%itemcategor %actions%Sa(eItemCategor "0 /result name-"success" type-"(elocit "0 BitemcategoryBsuccess.vm /Bresult0 /result name-"input" type-"(elocit "0 BitemcategoryBform.vm /Bresult0 /Baction0 /action name-""ilter" $ class-"org%&lueo' gen%meru(ian%training%itemcategor %actions%ItemCategor )orm"0 /result name-"success" type-"(elocit "0 BitemcategoryBfilter.vm /Bresult0 /Baction0 /action name-"searc*"$ class-"org%&lueo' gen%meru(ian%training%itemcategor %actions%Searc*ItemCategor "0 /result name-"success" type-"(elocit "0 BitemcategoryBresult.vm /Bresult0 /Baction0 /action name-"e!it" class-"org%&lueo' gen%meru(ian%training%itemcategor %actions%E!itCategor +oa!"0 /result name-"success" type-"(elocit "0 BitemcategoryBedit.vm /Bresult0 /Baction0 /action name-"!elete" class-"org%&lueo' gen%meru(ian%training%itemcategor %actions%ItemCategor )orm"0 /result name-"success" type-"(elocit "0 BitemcategoryBdelete.vm /Bresult0 /Baction0

/action name-"con"irm" class-"org%&lueo' gen%meru(ian%training%itemcategor %actions%,eleteItemCategor "0 /result name-"success" type-"(elocit "0 BitemcategoryBsuccess.vm /Bresult0 /Baction0 /action name-"up!ate" class-"org%&lueo' gen%meru(ian%training%itemcategor %actions%E!itItemCategor "0 /result name-"success" type-"(elocit "0 BitemcategoryBsuccess.vm /Bresult0 /Baction0 /Bpackage0 . . .... ..........

&i Susun ,leh G D 7chmad 7di %rasetyo D %raditya Eldorado 7

You might also like