Sunteți pe pagina 1din 10

7/28/2015

IBMWCSIBMWebSphereCommerceBlog:August2014
0

More NextBlog

CreateBlog SignIn

IBMWCSIBMWebSphereCommerceBlog
Home

WCSconfiguration!

WebsphereCommerceClient'slistB2BB2C

Friday,August15,2014

SQLWCS
TotalPageviews

BootstrappingSolutionstoMarket

BootstrappingSolutionstoMarket
ThisblogdescribeshowtoaugmenttheWebSphereCommercestorearchive
(SAR)tomatchtherelevantbusinessrequirementsforyoursolution.For
example,theSARwillprovideyouwithsomesampledatawhichestablishesthe
storefinderfeatureintheonlinestore.Ifyouswitchthesampledatawithyour
actualbrickandmortarstores,thenyoucoulddeploytheSARquicklyand
demonstratethestorefinderfeaturetoyourstakeholderswithgreaterimpact.

362,886

SearchMyBlog

Go

BlogArchive
2015(10)
2014(28)

ThisblogwilloutlinetheSARandgiveyoutheinsightyouneedtobeabletotransition
theoutoftheboxsoftwareintoabootstrapreadysoftwaresolutiontomatchyour
businessneeds.

November(7)
October(4)
September(1)

Section1.Overview
Inthisblog,youwilllearnhowtosetupaWebSphereCommercestorearchive
(SAR)todeployyoursolution.Thesestarterstores(SAR)areintendedmostly
forjumpstartingyoursolutionoutline,however,wecantakeitastepfurtherand
incorporateengineeringprocessestocreatebootstraps.Togetmore
informationonbootstrappingwithinasolution,youcouldbenefitfromreviewing
thefollowingpatentthatIhavesubmittedthroughtheUSpatentofficewhich
outlinesthebenefitofbootstrappinginyoursolutiondelivery:
http://appft1.uspto.gov/netacgi/nphParser?
Sect1=PTO1&Sect2=HITOFF&d=PG01&p=1&u=%2Fnetahtml%2FPTO%2Fsrch
num.html&r=1&f=G&l=50&s1=%2220090187880%22.PGNR.&OS=DN/2009018
7880&RS=DN/20090187880
Inamoreinvolvedandsometimesevolvedecommerceapplication,thestore
frontassetsmaybetotallydifferentfromwhatisprovidedinagiven
WebSphereCommerceStarterStore.
Asthedevelopmentassetsevolvethroughtheiterativeprocess,youneedto
deploythoseassets.WhendeliveringaWebSphereCommerceapplication
usinganiterativeapproach,youneedalowcostandconvenientmechanism
todeploytheseassetsonanongoingregularbasis.Thebenefitofthisentire
bootstrappingexerciseistoimposeyourownbrandingandideasdirectlyinto
theproductitself.Thus,asyouevolveinyourunderstandingoftheproduct,
theproductappreciatesthisbyevolvingthroughthebootstrapmechanism
describedinthisblog.

August(1)
BootstrappingSolutions
toMarket
July(5)
June(2)
May(1)
April(3)
March(1)
February(3)
2013(17)
2012(28)
2011(37)
2010(24)
2009(1)

DevelopersLifeLine
CrossReferencebeantables
commands
TestJavaCodeOnline
EclipsePlatformTips
RegexTester
Funny404errors

Internalreusableassetsinsideastorearchive
WhendeployingaWebSphereCommerceapplication,therearemanyassets
toconsider.TheSARhasamechanismtodeploythoseasassetsaslisted
below:
ResolvingandmassloadingdataYoucanbreakupdataintoseveral
categories:coredata,configurationdata,manageddata,andoperational
http://www.ibmwcs.com/2014_08_01_archive.html

ExceltoSQLonlinetool
URLEncoding
JSONValidator
OnlineXMLValidation
GenerateHTMLescape
CHARS

SubscribeTo
1/10

7/28/2015

IBMWCSIBMWebSphereCommerceBlog:August2014

data.Coreandconfigurationdataareneededtokeepeachiterationofthe
developedassetsworkableinastoreflow.Managedandoperationaldata
enableongoingunitandregressiontestingoftheWebSphereCommerce
application.

Posts
AllComments

TopComments
ResolvingandloadingAccessControlToimplementaccesscontrolina
storeatearlierstagesoftheproject,minimizethepolicycontentionsthatmay
emergelaterduringmoretimeconstrainedphasesofaproject.Thestore
archiveconvenientlyresolvesandloadsaccesscontrolforeachdevelopment
iteration.
PublishingbusinessaccountsandcontractsAccountsandcontractshave
substantialsubsystemtouchpointsthatmayrequirecomplexloading
dependencies.Toplacetheaccountandcontractrequirementsinastore
archive,minimizetherequireddeploymentskillsandresources.
PlacementofJSPJSPfiles,alongwiththeirassociatedJavascript,CSS,and
images,haveadifferentplacementonadevelopmentserverasopposedtoa
server.Toenableadevelopertoquicklysharetheseassets,astorearchive
canconvenientlyhandletheplacementoftheseassetswithoutthe
developer'sresponsibilitytodefinethroughanexternalbuildanddeployment
tool.

Getstartedlearningallabout
SEOfromthe
indust...7/27/2015Elizabeth
J.Neal
Aqualifiedconnectedwithtech
wristwatcheshas
g...7/24/2015Tendaxes
Hobisons
www.bkstr.comFollettHigher
Education
bookstores...7/22/2015Gre
gLi
www.bkstr.comFollettHigher
Education
bookstores...7/22/2015Gre
gLi
ThanksforSharingsucha
usefulinformation....
...7/15/2015saritha

PlacementofstorepropertyfilesPropertyfileshaveadifferentplacement
onadevelopmentserverasopposedtoaserver.Toenableadeveloperto
quicklysharetheseassets,astorearchivecanconvenientlyhandlethe
placementoftheseassetswithoutthedeveloper'sresponsibilitytodefine
throughanexternalbuildanddeploymenttool.
Extendedsitesdeploymentusingcomponentstorearchives
Asthisblogfocusesonmaintainingtheassetstorearchive,WebSphere
Commerceprovidesastorearchivespecificallyfordeployingassetsforthat

Section2.Settinguptheenvironment
DeployingaStarterStore
AssumingyoudidnotalreadydeployanIBMWCSstarterstoreinyourenvironment,
thereisagreatresourceyoucanfollowintheIBMInformationCenterwhereyoucan
searchfordeployingastarterstore.Onceyoudeploythestarterstore,youareable
toredeploythatsamestorecontinuallyoverandovertorefreshthebootstrap.Asyou
changetheStoreArchiveResource,thenyourbootstrapevolves,thusrefreshingyour
environmentwiththebootstrapstarterstoreplusyourchanges.

Section3.Studyingthestorearchive
Onceyouhavesuccessfullypublishedastarterstoreinyourdevelopment
environment,youarereadytostartdevelopingthestoretofityourbusiness
requirements.IfyoustartchangingJSPfiles,codingsomenewURLstopointtothose
JSPfiles,pullingdatausingdatabeans,orevensimplydemonstratetheoutofthebox
features,thereisawaytobootstraptheexperience.
LocatingtheSAR
YouwillneedtocrossreferencetheactualSARfiletowhichyoupublishedyourstore.

http://www.ibmwcs.com/2014_08_01_archive.html

2/10

7/28/2015

IBMWCSIBMWebSphereCommerceBlog:August2014

Youcantrackthisdownbyopeningthefollowingfile:<CommerceInstall
Directory>/xml/tools/devtools/publish/StorePublishWizardArchiveList.xml,wheretheview
selectedwhenyouselectedextendedsiteswasthevaluelistedintheStorePublish
sectionoftheAdministrationConsole.
UsingtheselectedvalueyouselectedintheStorePublishasyourreference,openthe
SARregistryfileandcrossreferencetheactualSARfilethatwaspublished,<Commerce
InstallDirectory>xml/tools/devtools/SARRegistry.xml,wherethe<viewname="XXX"/>
matchesthevaluetowhichyouselectedinyourstorepublish.Theremaybeseveral
entriesforXXX.Specifically,youarelookingforthefileNamevaluetomatchthe
publishreference,whichlet'ssayisthefileName="XXX.sar".

Fromthiselementreference,thereisalsoanassociatedattributerelativePath.Inthis
case,itisrelativePath="YYY".TherelativePathvalueofYYYmeansthatyoucanfindthe
pathforfileNamein<CommerceInstallDirectory>/starterstores/YYY/XXX.sar.Thisisthe
SARfileyouwilltakeapartandstudy.

DoingittheChryslerway

JustasChryslertookaparttheLocomobileinhisownhomeandstudiedtheparts,you
willtakeapartyourstarterstoreSARanddothesame.Theremainingstepswilltake
thatSARapartintoitspiecestotakeadeeperlook.

1. CopytheSARfoundinthestarterstoresdirectoryandplaceitintoatemporary

directoryinyourowndevelopmentworkstation.
2. ExtractthecontentsoftheSARfileintoasubdirectory.Whentheextendedsites

XXX.sarisextracted,thefollowingdirectorieswillbeavailable:
YYY/Directorytoholdstorefrontassets,suchasJSPfiles.tools/Assetsinthis
directorywillenabletheStorepreviewfunctions.
SARINF/ThepublishparametersusedbythePublishwizardaredefinedbythe
storerefs.xmlfileineachstorearchive.WebSphereCommerceunpacksthe
assetsfromthestorearchivetotheWebSphereCommerceServer.Unpacking
theassetsiscontrolledbytheunpack.xmlfile,locatedintheSARINFdirectoryin
thestorearchive.
METAINF/ThisisavailablewhenaddinganewJARfileintotheclasspath.
WEBINF/Thisdirectorycontainsallthingsrelatedtotheapplicationthatarenot
inthedocumentrootoftheapplication.TheWEBINFnodeisnotpartofthe
publicdocumenttreeoftheapplication.NofilecontainedintheWEBINF
directorymaybeserveddirectlytoaclientbythecontainer.However,the
contentsoftheWEBINFdirectoryarevisibletotheservletcodeusingthe
getResourceandgetResourceAsStreammethodcallsontheServletContext,
andmaybeexposedusingtheRequestDispatchercalls.Hence,iftheApplication
Developerneedsaccess,fromtheservletcode,toapplicationspecific
configurationinformationthathedoesnotwishtobeexposeddirectlytotheWeb
client,hemayplaceitunderthisdirectory.Sincerequestsarematchedto
resourcemappingsinacasesensitivemanner,clientrequestsfor/WEBINF/foo,
/WEbiNf/foo,forexample,shouldnotresultincontentsoftheWebapplication
locatedunder/WEBINFbeingreturned,noranyformofthedirectorylisting.
3. EstablishwhatpartsofthisSARyouwillcustomize:

YYY/Allofthedevelopers'changestotheJSPandstorefrontfileswillbe
updatedinthisdirectory.
tools/Therewillbenochangesinthisdirectoryforthisblog.
SARINF/Therewillbesomespecialparametersaddedtothepublishstepsto
beupdatedinthisdirectory.Specifically,thefilestorerefs.xmlwillbeupdatedto
http://www.ibmwcs.com/2014_08_01_archive.html

3/10

7/28/2015

IBMWCSIBMWebSphereCommerceBlog:August2014

reflectthebuild.
METAINF/Therewillbenochangesinthisdirectoryforthisblog .
WEBINF/Thisiswherethepropertyfileanddatachangeswillgo.
PropertyFilessubdirectoryWEBINF/classes/YYY/
DatasubdirectoryWEBINF/stores/YYY/data/
4. HowthestorearchiveunpacksthesefilesatPublishtime

AfteryouhaveclickedFinishinthePublishwizard,orrunthepublishstoreutility,
WebSphereCommerceunpackstheassetsfromthestorearchivetothe
WebSphereCommerceServer.Unpackingtheassetsiscontrolledbythe
unpack.xmlfile,locatedintheSARINFdirectoryinthestorearchive.
Theunpack.xmlfiledetermineswhichfilestounpack(usingtheincludeand
excludeelements),towhichdirectoriesthefileswillbeunpacked(usingthe
unpackdestentity),andalsorenamesdirectories(usingtherenamestoredir
entity).
Bydefault,unpackunpacksallofthefilesofthestorearchivethatitislocatedin.
However,unpackcanalsounpackjustcertainfileswithinthestorearchive,if
specified.Alsobydefault,unpackunpacksthefilestothepathobtainedby
combiningtheStoreDocRootandStoreWebPathpathsfromtheDevTools
elementintheinstanceXML.ThispathpointstothedocumentrootoftheStores
Webmodule.However,ifspecified,asintheprecedingexample,<unpack
dest="${wc:ToolsStoresPropertiesPath}">,unpackwillunpackthefilesinanother
location.Noteunpackacceptsvariables.Inthiscasethe
"${wc:ToolsStoresPropertiesPath}"variableisanattributeofthedevtoolselementin
theinstance.xml.
5. PublishthewizardpublishparametersThepublishparametersusedbythe

Publishwizardaredefinedbythestorerefs.xmlfileineachstorearchive.
Note:PublishingparametersareonlyavailablethroughthePublishwizard.Ifyou
publishastorearchivethroughthecommandline,youcannotspecifyparameter
values.Thedefaultvaluescontainedinthestorearchivewillbeused.
Lookatthefollowingexampleofastorerefs.xmlfilefromtheYYY.sarfile.
refidThisisusedasthekeyinthepropertiesfilespecifiedbythestorerefs
resourcebundleattribute.Itisusedtoobtainthetranslatableparametername
andthedescriptionthatdisplaysinthepublishparameterspage.
entityThisisthenameoftheENTITYinthetargetdtdthatiseditedbythis
parameter.
inputtypeThiscontrolshowtheparameterisdisplayedonscreen.Iftheinput
typeistext,theparameterisdisplayedinaneditablefield.Iftheinputtypeis
member,alloftheexistingorganizationsdisplayinadropdownlist.Youcannot
editreadonlyparameters.
targetdtdThisdefinesthetargetdtdfile.Thevaluesthatauserentersforthese
parametersarestoredinthefileidentifiedinthetargetdtdfile.Thisfileisalsopart
ofthestorearchiveandisunpackedwiththestoredataassets.Theentityvalue
correspondingtoeachparameterisupdatedintheunpackedfile.TheDTDinside
thestorearchiveisnotupdated.Thevaluesfortheparametersarestoredinthis
file(inthiscaseForeignKeys.dtd)untilthepublishisinstantiated.
resourcebundle="/SARINF/properties/publishNLS"Finally,ifastoreis
publishedinseverallanguages,asthestarterstoresare,thepublishparameters
andtheiraccompanyingdescriptionsarefoundinlocalespecificfiles.Thefield
labelanddescriptionforeachpublishparameterarelocatedinthepropertiesfile
definedintheresourcebundleattributeofthestorerefs.xml.
Duringpublish,theprocesslooksforthespecificlocaleforthelanguageusedin
thePublishwizard.Thestoresref.xmlfilealsodefinesthesefiles.
deploydescriptor="WEBINF/stores/XXX/data/ibmwcload.xmlThedeploy
descriptorspecifiesthelocationofthefile(ibmwcload.xml)thatcontrolsthe
publishdataportionofthepublishingprocess.
http://www.ibmwcs.com/2014_08_01_archive.html

4/10

7/28/2015

IBMWCSIBMWebSphereCommerceBlog:August2014

Youshouldexaminehowthedataishandledbythestorearchive.Thedata
loadingsegmentofthestorearchivecanhandleloadingcoredata,configuration
data,manageddata,andoperationaldata.Thestorearchivecanalsohandle
loadingspecialcomplicateddata,suchasaccesscontrolandcontracts.Thenext
sectionwillfocusonthedataloadingsegmentoftheWebSphereCommerce
storearchive.

Section4.Datainthestorearchive
TheWebSphereCommerceStoreArchivehasaverysophisticatedmannerto
handledata.ThedatathatistobeloadedintoWebSphereCommerceis
representedasXMLfiles.YoucanhavemultipleXMLfiles,eachcanhandlea
specificsetoftables,orevenasubsystem.Amasterfiledictateswhichfilesare
loadedinwhichsequence.Thatway,youcansetdatawithspecialunresolved
identifierssothattheSARcanresolveandmanagethemassload
responsibilitiesatruntime.Withthisdesign,youcanpackagedataintothe
WebSphereCommercestorearchiveandloaditonanydatabaseonany
nodewithouthavingtohardcodedatabasespecifickeys.
Theunresolvedway
Whendataisrepresentedwithunresolvedidentifiers,thisallowsthepublishing
processtomassloadthedatawithouthavingtoerrorwithprimarykeyconflicts.
Tolearnmoreaboutusinginternalaliastoresolveidentifiers,seeCreatingan
XMLfiletouseinternalaliasIDresolution.
Externaldependencies
ThePublishwizardpublishparametersfromthestorerefs.xmlfilespecifiesa
particularfile,thevalueoftargetdtd,todesignateexternaldependencies.Asthepath
isspecifiedfromthetargetdtdparameter,itisfounddirectlywithinthedata
subdirectory:WEBINF/stores/YYY/data/ForeignKeys.dtd.Youwillbeaddingsomenew
parameterstothisfiletomakesomespecialchangestofulfillthisblogrequirement.
ThedeploydescriptorThePublishwizardpublishparametersfromthestorerefs.xml
filespecifiesaparticularfile,thevalueofdeploydescriptor,asthedeployment
descriptor.Asthepathisspecifiedfromthedeploydescriptorparameter,itisfound
directlywithinthedatasubdirectory:WEBINF/stores/XXX/data/ibmwcload.xml.You
willbeaddingnewaccountsandcontractstobedeployedinthisblog.
Ofspecificinteresttothisblogfromthedeploymentdescriptorarethemasterand
resolved.masterassets.Thesearedenotedasfollows:
XMLexample3.Deploymentdescriptortoloadingdataassets
<assetid="master"location="storedataassets.xml"/><assetid="resolved.master"location="storedata
assets.resolved.xml"/>

ThemasterassetisthefilethatcontrolswhichXMLfilesthataretobemassloaded
duringthestorearchivepublishprocess.Whenconsideringunresolvedidentifiersin
thedataXMLfiles,thoseunresolvedentitiesthataredesignatedastheprimarykey
shouldbesequencedbeforeotherXMLdatafiles(whichholdthosesame
unresolvedidentifiersasforeignkeys).
Theresolved.masterassetistheoutputoftheresolvedassetsthatarelistedinthe
masterassetfile.Thisresolvedfileisimportantduringthetroubleshootingphaseof
thepublishprocesswhenthereareresolvingormassloaderrors.

Section5.Adevelopmentscenario
Forthisblogtorepresentarealworldscenario,therearemanyWebSphere
Commercesubcomponentsthathavetobetakenintoconsideration.
Therefore,thisblogwillincludethefollowingdevelopmentscenario:

1. Creatingacatalogdatatoreflecttheentitlement.
2. Creatingnewviews,commands,andJSPfilestodisplaythedata.

http://www.ibmwcs.com/2014_08_01_archive.html

5/10

7/28/2015

IBMWCSIBMWebSphereCommerceBlog:August2014
3. MappingthenewviewsandcommandsintotheAccessControl.
4. Finally,puttingallofthoseassetsintotheWebSphereCommercestore

archiveandpublishingthemtoanewenvironment.
Tostartwiththesedevelopmentsteps,youshouldreviewModifyassetstore
archivesflow(Enterprise).Asyoucanseefromthisreference,repackagingthe
storearchivewillbeaniterativeprocessasyougothroughthedecisionpoints
ofwhatassetsneedtobeupdatedduringdevelopment.

Section6.Creatingdatainthestorearchive
Creatingdatameansupdatingthefilefromthemasterasset,storedata
asset.xml,inthedeploymentdescriptor.
Eachstarterstorearchivecontainsastoredataasset.xmlfile.Thestoredata
asset.xmlfileincludesplaceholdersforallofthedataassetfilesinthestore
archivethatwillbeincludedduringthepublish.
Thefollowingisaportionofthestoredataasset.xmlfilefortheConsumerDirect.sar,
illustratingtheplaceholders:
Withthatchange,thereneedstobeanassociatedchangeinthestoredata
assets.dtdfiletomaptheseentityreferences.
Duringthepublish,allthedataassetsidentifiedwithplaceholdersinthestore
dataasset.xmlfileareconsolidatedintoonelargedocument.TheIDResolver
resolvestheIDsfoundinthedocument.AftertheIDsareresolved,IDResolver
createsthefollowingfile,storedataasset.resolved.xml,whichcontainsunique
IDs.IfanerroroccursduringtheIDresolvingprocess,theLoaderpackage
addsanentrytothemessages.txtfile.
YouwillcreatetheseXMLfilesandaddthecorrespondingdatatothem.
ThenextfewsectionswilloutlinechangesthatcanbemadeintheSAR.Some
datafitswelltobootstrapwhileothertypesofdatadoesnotfit.Forexample,
thecatalogdataisnotthebestcandidatetobootstrapintotheSAR.
ThecatalogdataisusuallyexternalizedintoaseparatestandaloneSARfile.It
isrecommendedtouseBODLtoloadthecatalogdataduetothelarge
amountsofinformation.Withthat,youmostlikelywouldnotdeploycatalog
datawithyourstarterstore.

Section8.StoreLocatorData
WhendeployingaSARtodemonstratetheIBMWCSfunctionalitytoyour
projectstakeholders,itwouldbeniceifthatSARcontainedthestoresrelative
toyourproject.Youcanactuallyprovidethisbybootstrappingthoseproject
storesintotheIBMWCSproductSAR.
Thefollowingstepsisangeneraloutlineyoucanusetofollowtobootstrapthe
storesintotheSAR:
1. GenerateStoreLocatordatafile.
1. PullstorelocationsfromHD.calive
2. Pullcoordinatesofstorelocationsfrom

http://itouchmap.com/latlong.html
3. Mapthedataintothestorelocatortables
1. GEONODEcontainsthebasiccityinformation.
2. GEOTREEcontainstheassociatereferencetoGEONODE
3. STLOCcontainsthestoreinformationincludingthelatitudeand

longitudealongwiththeGEOTREEstatedabove
4. STLOCDSlanguagesupportforthestoreinformation
5. STLOCATTRcontainsthestorehours
2. ExtractthefollowingSAR:C:\IBM\WCDE_ENT70\starterstores\YYY\XXX.sar

http://www.ibmwcs.com/2014_08_01_archive.html

6/10

7/28/2015

IBMWCSIBMWebSphereCommerceBlog:August2014
3. Reviewthefollowingfilestoensurethereisareferenceto"store_locator.xml"

andifthereisnotonethatexists,createditandappendtothefollowing:
1. storedataassets.dtd
2. storedataassets.xmlthesefilesareupdatedinthefollowing

directory:C:\installdir\starterstores\YYY\XXX\WEB
INF\stores\StoreAssetsDir\data\storedataassets.xml

Section9.Viewsandcommands
Thecommand,view,andURLregistriesarepartoftheWebSphereCommerce
commandframework.Thecommandframeworkdetermineshowacommand
executes,andthenreturnsaresponsebasedontheviewreturnedbythe
executedcommand.Thecommandexecutionandresponsearestore
dependent,whichmeansthatyoucanimplementthesamecommand
differentlyforeachstore,aswellasreturndifferentresponsesforeachstore.
Forpurposesofthisblog,youwillsimplyreuseanexistingviewandrenameit.Thus,
yousavethoseadditionsinthestorearchive.
Creatinganddeployingaview
Afteracommandisexecuted,inmostcases,therequesterofthecommand
requiresaresponsetobereturned.Whendeterminingtheresponse,the
commandframeworkconsidersthefollowingfactors:

Theviewfoundintheresponsepropertiesafterthecommandis
executed.
Thestoreonwhosebehalfthecommandwasexecuted.
Thedeviceformatoftherequestwhentherequestwasmade.
Everyviewthatreturnsaresponsemustbedefinedintheviewregistry,either
perstore,orbydefault,bysite.Eachstorewillnormallydefinetheviewfor
eachpossibledeviceformatoftheincomingrequest.However,ifaviewisnot
definedbyastore,thedefaultviewforthesitewillbeused.Theadapter
handlingtherequestwilldecidewhichdeviceformatandthedefaultdevice
formattousewhendeterminingwhichviewtocall.Thereisnoonegeneric
deviceformat,sodependingonthedifferenttypesofrequeststhatcanbe
acceptedbyWebSphereCommerce,theremaybeaviewdefinedforeach
deviceformat.
Forthisblog,youwillbecreatinganewJSPandenablingitasaviewinthe
storearchive.Toaccomplishthistask,youwilldothefollowingsteps:

1. DuplicatetheJSPfortheTopCategoriesDisplaypage.
2. CreatetheviewdatainthecommandXMLfileofthestorearchive.
3. CreatetheAccessControlforthatviewintheAccessControlXMLfileof

thestorearchive.

CreatingtheJSP
WhenyoufirstdeployedExampleStorefrontAssetStoreduringtheinitialpublishingstages
tosetupthisenvironment,therewasasetofJSPthatweredeployedfromtheSARfile.
GototheextracteddirectoriesoftheYYY.sar,andlocateXXX/.
Withinthatdirectory,navigatetothesubdirectory
ShoppingArea/CatalogSection/CategorySubsection/.Withinthatdirectory,thereshouldbea
JSPfilecalledTopCategoriesDisplay.jspandCachedTopCategoriesDisplay.jsp.Makeacopy
ofthesetwofilesandrenamethemtoExampleCategoryDisplay.jsp,andleave
CachedTopCategoriesDisplay.jsptostillbereferencedbythenewJSPfile.
http://www.ibmwcs.com/2014_08_01_archive.html

7/10

7/28/2015

IBMWCSIBMWebSphereCommerceBlog:August2014

NowthatyoucreatedthenewJSPfile,addtheviewExampleCategoryDisplayView.
Thefollowingisthedatafilethatwaspreviouslysetinstoredataassets.xmlasthe
ExampleStorefrontAssetStore_command.xmlentity.

Viewdata
CreatetheExampleStorefrontAssetStore_command.xmlfileandcreatethecorresponding
data.
NowthattheviewissettoberegisteredinWebSphereCommerce,youwillneedan
associatedaccesscontroldefinition.

Accesscontroldata
CreatetheExampleStorefrontAssetStore_accesscontrol.xmlfileandcreatethe
correspondingdata.
acaction_id="@ExampleCategoryDisplayView"/><acactdesc
acaction_id="@ExampleCategoryDisplayView"displayname="ExampleCategoryDisplayView"description="Example
CategoryDisplayView"language_id="&en_US"/>

NoticefromthisAccessControldefinitionthatwearereusingthe
@xxxAssetStoreRegisteredCustomerViewsunresolvedidentifierthatwasdeclaredin
theexistingstorearchiveassignmentintheaccesscontrol.xmlfile.
NowthattheJSPandviewarereadytobedeployedintoWebSphereCommerce,you
willnowperformyourfirstiterativebuild.

Section10.Thefirstbuild
Assumingthattheextendedsiteshasbeendeployedandastorehasbeenopened,
youcandeploythefirstdevelopmentbuild.Whentheprevioussectionsof
thisbloghavebeensuccessfullycompleted,thereshouldbeanupdatetotheextracted
versionofXXX.sar.Fromtheextracteddirectories,youwillneedtozipthosedirectories
backupintoanupdatedversionofXXX.sar.
Forthisexample:
Commandexample.ExtractingaWebSphereCommercestorearchive
cd<DevelopmentDirectory>\testWithinthedirectorystructurethatyouupdatedtheSARcontents,
packagethatbackupintoasarfilewhichreflectsthesamestructureaswhenitwas
initiallyextracted.YoucanachievethiseitherusingJAVA(jarcvfXXX.sar
<DevelopmentDirectory>\test)or7ziporWinZip.
NowthatyourWebSphereCommercestorearchiveisreadyforpublishing,youwill
needtousethepublishtool.Fordifferentoptions,seePublishingaStoreArchiveinthe
onlineIBMWCSInformationCenter.ThefollowingisanexampleofusingthePublish
WizardtosuccessfullypublishthisupdatedSARfile:

1. LogintotheWebSphereCommerceAdministrationConsoletool.
2. SelectthemenutitledStoreArchives,thenclickthesubmenuPublish,the

PublishpagewillshowtheStoreArchivespanel.
http://www.ibmwcs.com/2014_08_01_archive.html

8/10

7/28/2015

IBMWCSIBMWebSphereCommerceBlog:August2014
3. SelectoptionsfortheViewdropdown(orselectthedefaultStoreArchivesview,

andthenreselecttheoptionStoreArchivesview.
4. ChecktheSARfileXXX.sar.
5. ClicktheNextbuttononthetoprightofthepanel.TheParameterspanel

appears.
6. Ensuretheparametersmatchthesettingsyouadjustedinyourchanges
7. ClicktheNextbuttononthetoprightofthepanel,andtheSummarypanel

appears.
8. AcceptthedefaultsandclicktheFinishbuttononthetoprightofthepanel.
9. ClicktheOKbuttonfortheWebpagedialog.
10. WaitforthepublishtocompleteandclickRefreshtoacknowledgethePublish

Statusascomplete.

AfteryouhavecompletedpublishingthisupdatedWebSphereCommercestore
archive,youcanbegintestingyourchanges.Whenyoulogintothestorethistime,
youcanlogonasusual,thenonceloggedintothestore,youcanenterintheURL
whichcorrespondstoyournewviewname:ExampleCategoryDisplayView(forexample,
http://localhost/webapp/wcs/stores/servlet/ExampleCategoryDisplayView?
langId=1&storeId=10151&catalogId=10001wherelangId,storeId,andcatalogId
valuesmaybedifferentvaluesforyourstore).

Section11.Subsequentbuilds
Forsubsequentbuilds,followthestepsoutlinedinthisblog.Uponeachnewversionof
theWebSphereCommercestorearchivethatyouwouldappendto,simplyupdatethe
directoryandfile,<WC_installdir>\starterstores\XXX\YYY.sar,overandover,thus
evolvingyourapplicationwithapackagedandcontrolleddeploymentmechanism.
KeepinginmindthatyouhavebeenupdatingtheAccessControlpoliciesforallyour
newcommandsandviews.Itwouldbewisetocontinuallyrefreshyourenvironment
uponeachdeployment.ThismeansrevertingyourdatabasebacktotheWebSphere
CommercebootstrapbeforeyoupublishyourfirstdevelopedSAR.Atotalrefreshis
reallynotaproblemforyourdevelopmentteamanymore.IttakesaslongasaSAR
publishwouldtaketobringyourenvironmentbackupfromscratch!
Whenrefreshingyourenvironment,youensurethattheaccesscontrolpolicies
imposedbythebootstrapWebSphereCommercesystemisinplace.Thenyourlatest
SARwilladdontheremainingaccesscontroldeltapolicies,whichapplytoyourlatest
useraccessrequirementsforcommandsandviews.
So,nowthatyouknowyouaregoingtorepeatthedeploymentofyourSARoverand
overagain,thenyoucansetupyourPublishwizardpublishparameterswithinthe
storerefs.xmltobereflectedtowardsparametersyouknowyouarepublishing.For
example,ourinitialstorerefs.xmlfromtheoriginalSARhadthefollowingparameters:
<refid="storeDir"entity="STORE_DIR"><inputtype="text"/></ref><refid="storeIdent"entity="STORE_IDENTIFIER">
<inputtype="text"/></ref><refid="parentOrg"entity="ORGANIZATION_DN"><inputtype="member"/></ref></store
refs>

Sinceyouaremostlikelygoingtopublishyourcatalogdataandyourstoredataalong
withyourB2BDirectStorefrontAssetStoreSARimplementation,youcanaddthe
followingentriestoyourstorerefs.xmlasawaytogetyourdatasetupfortheXMLdata
thatmayneedtoreferenceit.
TheabovesettingsprovideyourSARthetargetStoreidentifier,whichusesadrop
downsuppliedwithsomeselectabledataasinput.Theselectionisalreadysetto
somedatathatwasrepresentedintheForeignKeys.dtdfiletopopulatetheidentifier,
memberDN,anddirectory.ThehubStoreContractidentifierpullsaparameterfromthe
ForeignKeys.dtdfileandsetstheentityreference:hub_created_store_contract_1.The
identifiersareusedaskeystopulllocalizedverbagefromthepublishNLS.propertiesfile
http://www.ibmwcs.com/2014_08_01_archive.html

9/10

7/28/2015

IBMWCSIBMWebSphereCommerceBlog:August2014

inthepropertiesdirectoryofSARINF.Theentityreferencecarriesavaluetobeused
inthemappingoftheForeignKeys.dtd,whichisusedtopopulatedataduringtheSAR
publishing.Toreviewthis,openthetargetdtd="WEB
INF/stores/XXX/data/ForeignKeys.dtd"filereferencenotedfromthisstorerefs.xmlfile.
WithintheForeignKeys.dtd"file,youcanaddanewentityreferenceandeveninclude
hardcodedvaluesasnecessary.
Withthepublishparametersupdatedandwithsomeuniquewaysofcomplimenting
yourdevelopmentbuilds,youcanseehowpowerfulitistousetheSARasyour
deploymentmechanism.

Section12.Conclusion
Leveragingthestorearchiveasyourdevelopment,build,anddeploymentmechanism
savesalotofresourcesrequiredtobuildANTscriptstodowhatyourSARwould
alreadyprovideforyou.However,IBMWCSdoesprovideaBuildandDeploytool
whichalreadyprovidesyouwithalltheANTlogicthatyourequire.So,thenwhyeven
botherwiththeSARaugmentation?Twofold:theSARcanbepassedtoyourteamor
evenbacktotheoriginalproductteamforsupport.ThiscomplimentsAgileprocesses
toincreaseresponsetimeconfirmwhathasbeenengineeredinthesolutiondirectly
matchesthebootstrapsprovidedthroughtheSAR.Also,thebenefitisthatyoudirectly
alignyoursolutiontothebootstrappingoftheproduct.
Inthefuture,IwouldchallengethatIBMWCSmergetheirSAR(starterstores)directly
intotheBuildAndDeploytool.Thatway,whenyoubootstrap,youaremodellingthat
directlyintothebuildprocess.WhatthismeansisthatwhenyoufirstinstallIBMWCS,
youactuallyinstallastarterstorefromthebuildprocess.Goodidea?LetIBMknow
sothatyoucanstartboostrappingintothebuildanddeploytoolinsteadoftheSAR.

PostedbyMikeShieldsat8:15AM

Nocomments:

NewerPosts

Linkstothispost

Home

OlderPosts

Subscribeto:Posts(Atom)

Watermarktemplate.PoweredbyBlogger.

http://www.ibmwcs.com/2014_08_01_archive.html

10/10

S-ar putea să vă placă și