ibm wcs - ibm websphere commerce blog_ august 2014
DESCRIPTION
jayaTRANSCRIPT
-
7/28/2015 IBMWCSIBMWebSphereCommerceBlog:August2014
http://www.ibmwcs.com/2014_08_01_archive.html 1/10
IBMWCSIBMWebSphereCommerceBlogHome WCSconfiguration! WebsphereCommerceClient'slistB2BB2C SQLWCS
Friday,August15,2014
BootstrappingSolutionstoMarket
BootstrappingSolutionstoMarket
ThisblogdescribeshowtoaugmenttheWebSphereCommercestorearchive(SAR)tomatchtherelevantbusinessrequirementsforyoursolution.Forexample,theSARwillprovideyouwithsomesampledatawhichestablishesthestorefinderfeatureintheonlinestore.Ifyouswitchthesampledatawithyouractualbrickandmortarstores,thenyoucoulddeploytheSARquicklyanddemonstratethestorefinderfeaturetoyourstakeholderswithgreaterimpact.
ThisblogwilloutlinetheSARandgiveyoutheinsightyouneedtobeabletotransitiontheoutoftheboxsoftwareintoabootstrapreadysoftwaresolutiontomatchyourbusinessneeds.
Section1.Overview
Inthisblog,youwilllearnhowtosetupaWebSphereCommercestorearchive(SAR)todeployyoursolution.Thesestarterstores(SAR)areintendedmostlyforjumpstartingyoursolutionoutline,however,wecantakeitastepfurtherandincorporateengineeringprocessestocreatebootstraps.Togetmoreinformationonbootstrappingwithinasolution,youcouldbenefitfromreviewingthefollowingpatentthatIhavesubmittedthroughtheUSpatentofficewhichoutlinesthebenefitofbootstrappinginyoursolutiondelivery:
http://appft1.uspto.gov/netacgi/nphParser?Sect1=PTO1&Sect2=HITOFF&d=PG01&p=1&u=%2Fnetahtml%2FPTO%2Fsrchnum.html&r=1&f=G&l=50&s1=%2220090187880%22.PGNR.&OS=DN/20090187880&RS=DN/20090187880
Inamoreinvolvedandsometimesevolvedecommerceapplication,thestorefrontassetsmaybetotallydifferentfromwhatisprovidedinagivenWebSphereCommerceStarterStore.
Asthedevelopmentassetsevolvethroughtheiterativeprocess,youneedtodeploythoseassets.WhendeliveringaWebSphereCommerceapplicationusinganiterativeapproach,youneedalowcostandconvenientmechanismtodeploytheseassetsonanongoingregularbasis.Thebenefitofthisentirebootstrappingexerciseistoimposeyourownbrandingandideasdirectlyintotheproductitself.Thus,asyouevolveinyourunderstandingoftheproduct,theproductappreciatesthisbyevolvingthroughthebootstrapmechanismdescribedinthisblog.
Internalreusableassetsinsideastorearchive
WhendeployingaWebSphereCommerceapplication,therearemanyassetstoconsider.TheSARhasamechanismtodeploythoseasassetsaslistedbelow:
ResolvingandmassloadingdataYoucanbreakupdataintoseveralcategories:coredata,configurationdata,manageddata,andoperational
362,886TotalPageviews
Go
SearchMyBlog
2015(10)
2014(28)November(7)
October(4)
September(1)
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)
BlogArchive
CrossReferencebeantablescommands
TestJavaCodeOnline
EclipsePlatformTips
RegexTester
Funny404errors
ExceltoSQLonlinetool
URLEncoding
JSONValidator
OnlineXMLValidation
GenerateHTMLescapeCHARS
DevelopersLifeLine
SubscribeTo
0 More NextBlog CreateBlog SignIn
-
7/28/2015 IBMWCSIBMWebSphereCommerceBlog:August2014
http://www.ibmwcs.com/2014_08_01_archive.html 2/10
data.Coreandconfigurationdataareneededtokeepeachiterationofthedevelopedassetsworkableinastoreflow.ManagedandoperationaldataenableongoingunitandregressiontestingoftheWebSphereCommerceapplication.
ResolvingandloadingAccessControlToimplementaccesscontrolinastoreatearlierstagesoftheproject,minimizethepolicycontentionsthatmayemergelaterduringmoretimeconstrainedphasesofaproject.Thestorearchiveconvenientlyresolvesandloadsaccesscontrolforeachdevelopmentiteration.
PublishingbusinessaccountsandcontractsAccountsandcontractshavesubstantialsubsystemtouchpointsthatmayrequirecomplexloadingdependencies.Toplacetheaccountandcontractrequirementsinastorearchive,minimizetherequireddeploymentskillsandresources.
PlacementofJSPJSPfiles,alongwiththeirassociatedJavascript,CSS,andimages,haveadifferentplacementonadevelopmentserverasopposedtoaserver.Toenableadevelopertoquicklysharetheseassets,astorearchivecanconvenientlyhandletheplacementoftheseassetswithoutthedeveloper'sresponsibilitytodefinethroughanexternalbuildanddeploymenttool.
PlacementofstorepropertyfilesPropertyfileshaveadifferentplacementonadevelopmentserverasopposedtoaserver.Toenableadevelopertoquicklysharetheseassets,astorearchivecanconvenientlyhandletheplacementoftheseassetswithoutthedeveloper'sresponsibilitytodefinethroughanexternalbuildanddeploymenttool.
Extendedsitesdeploymentusingcomponentstorearchives
Asthisblogfocusesonmaintainingtheassetstorearchive,WebSphereCommerceprovidesastorearchivespecificallyfordeployingassetsforthat
Section2.Settinguptheenvironment
DeployingaStarterStore
AssumingyoudidnotalreadydeployanIBMWCSstarterstoreinyourenvironment,thereisagreatresourceyoucanfollowintheIBMInformationCenterwhereyoucansearchfordeployingastarterstore.Onceyoudeploythestarterstore,youareabletoredeploythatsamestorecontinuallyoverandovertorefreshthebootstrap.AsyouchangetheStoreArchiveResource,thenyourbootstrapevolves,thusrefreshingyourenvironmentwiththebootstrapstarterstoreplusyourchanges.
Section3.Studyingthestorearchive
Onceyouhavesuccessfullypublishedastarterstoreinyourdevelopmentenvironment,youarereadytostartdevelopingthestoretofityourbusinessrequirements.IfyoustartchangingJSPfiles,codingsomenewURLstopointtothoseJSPfiles,pullingdatausingdatabeans,orevensimplydemonstratetheoutoftheboxfeatures,thereisawaytobootstraptheexperience.
LocatingtheSAR
YouwillneedtocrossreferencetheactualSARfiletowhichyoupublishedyourstore.
Posts
AllComments
GetstartedlearningallaboutSEOfromtheindust...7/27/2015ElizabethJ.Neal
Aqualifiedconnectedwithtechwristwatcheshasg...7/24/2015TendaxesHobisons
www.bkstr.comFollettHigherEducationbookstores...7/22/2015GregLi
www.bkstr.comFollettHigherEducationbookstores...7/22/2015GregLi
ThanksforSharingsuchausefulinformation.......7/15/2015saritha
TopComments
-
7/28/2015 IBMWCSIBMWebSphereCommerceBlog:August2014
http://www.ibmwcs.com/2014_08_01_archive.html 3/10
Youcantrackthisdownbyopeningthefollowingfile:/xml/tools/devtools/publish/StorePublishWizardArchiveList.xml,wheretheviewselectedwhenyouselectedextendedsiteswasthevaluelistedintheStorePublishsectionoftheAdministrationConsole.
UsingtheselectedvalueyouselectedintheStorePublishasyourreference,opentheSARregistryfileandcrossreferencetheactualSARfilethatwaspublished,xml/tools/devtools/SARRegistry.xml,wherethematchesthevaluetowhichyouselectedinyourstorepublish.TheremaybeseveralentriesforXXX.Specifically,youarelookingforthefileNamevaluetomatchthepublishreference,whichlet'ssayisthefileName="XXX.sar".
Fromthiselementreference,thereisalsoanassociatedattributerelativePath.Inthiscase,itisrelativePath="YYY".TherelativePathvalueofYYYmeansthatyoucanfindthepathforfileNamein/starterstores/YYY/XXX.sar.ThisistheSARfileyouwilltakeapartandstudy.
DoingittheChryslerway
JustasChryslertookaparttheLocomobileinhisownhomeandstudiedtheparts,youwilltakeapartyourstarterstoreSARanddothesame.TheremainingstepswilltakethatSARapartintoitspiecestotakeadeeperlook.
1. CopytheSARfoundinthestarterstoresdirectoryandplaceitintoatemporarydirectoryinyourowndevelopmentworkstation.
2. ExtractthecontentsoftheSARfileintoasubdirectory.WhentheextendedsitesXXX.sarisextracted,thefollowingdirectorieswillbeavailable:
YYY/Directorytoholdstorefrontassets,suchasJSPfiles.tools/AssetsinthisdirectorywillenabletheStorepreviewfunctions.
SARINF/ThepublishparametersusedbythePublishwizardaredefinedbythestorerefs.xmlfileineachstorearchive.WebSphereCommerceunpackstheassetsfromthestorearchivetotheWebSphereCommerceServer.Unpackingtheassetsiscontrolledbytheunpack.xmlfile,locatedintheSARINFdirectoryinthestorearchive.
METAINF/ThisisavailablewhenaddinganewJARfileintotheclasspath.
WEBINF/Thisdirectorycontainsallthingsrelatedtotheapplicationthatarenotinthedocumentrootoftheapplication.TheWEBINFnodeisnotpartofthepublicdocumenttreeoftheapplication.NofilecontainedintheWEBINFdirectorymaybeserveddirectlytoaclientbythecontainer.However,thecontentsoftheWEBINFdirectoryarevisibletotheservletcodeusingthegetResourceandgetResourceAsStreammethodcallsontheServletContext,andmaybeexposedusingtheRequestDispatchercalls.Hence,iftheApplicationDeveloperneedsaccess,fromtheservletcode,toapplicationspecificconfigurationinformationthathedoesnotwishtobeexposeddirectlytotheWebclient,hemayplaceitunderthisdirectory.Sincerequestsarematchedtoresourcemappingsinacasesensitivemanner,clientrequestsfor/WEBINF/foo,/WEbiNf/foo,forexample,shouldnotresultincontentsoftheWebapplicationlocatedunder/WEBINFbeingreturned,noranyformofthedirectorylisting.
3. EstablishwhatpartsofthisSARyouwillcustomize:
YYY/Allofthedevelopers'changestotheJSPandstorefrontfileswillbeupdatedinthisdirectory.
tools/Therewillbenochangesinthisdirectoryforthisblog.
SARINF/Therewillbesomespecialparametersaddedtothepublishstepstobeupdatedinthisdirectory.Specifically,thefilestorerefs.xmlwillbeupdatedto
-
7/28/2015 IBMWCSIBMWebSphereCommerceBlog:August2014
http://www.ibmwcs.com/2014_08_01_archive.html 4/10
reflectthebuild.
METAINF/Therewillbenochangesinthisdirectoryforthisblog.
WEBINF/Thisiswherethepropertyfileanddatachangeswillgo.
PropertyFilessubdirectoryWEBINF/classes/YYY/
DatasubdirectoryWEBINF/stores/YYY/data/4. HowthestorearchiveunpacksthesefilesatPublishtime
AfteryouhaveclickedFinishinthePublishwizard,orrunthepublishstoreutility,WebSphereCommerceunpackstheassetsfromthestorearchivetotheWebSphereCommerceServer.Unpackingtheassetsiscontrolledbytheunpack.xmlfile,locatedintheSARINFdirectoryinthestorearchive.
Theunpack.xmlfiledetermineswhichfilestounpack(usingtheincludeandexcludeelements),towhichdirectoriesthefileswillbeunpacked(usingtheunpackdestentity),andalsorenamesdirectories(usingtherenamestoredirentity).
Bydefault,unpackunpacksallofthefilesofthestorearchivethatitislocatedin.However,unpackcanalsounpackjustcertainfileswithinthestorearchive,ifspecified.Alsobydefault,unpackunpacksthefilestothepathobtainedbycombiningtheStoreDocRootandStoreWebPathpathsfromtheDevToolselementintheinstanceXML.ThispathpointstothedocumentrootoftheStoresWebmodule.However,ifspecified,asintheprecedingexample,,unpackwillunpackthefilesinanotherlocation.Noteunpackacceptsvariables.Inthiscasethe"${wc:ToolsStoresPropertiesPath}"variableisanattributeofthedevtoolselementintheinstance.xml.
5. PublishthewizardpublishparametersThepublishparametersusedbythePublishwizardaredefinedbythestorerefs.xmlfileineachstorearchive.Note:PublishingparametersareonlyavailablethroughthePublishwizard.Ifyoupublishastorearchivethroughthecommandline,youcannotspecifyparametervalues.Thedefaultvaluescontainedinthestorearchivewillbeused.Lookatthefollowingexampleofastorerefs.xmlfilefromtheYYY.sarfile.
refidThisisusedasthekeyinthepropertiesfilespecifiedbythestorerefsresourcebundleattribute.Itisusedtoobtainthetranslatableparameternameandthedescriptionthatdisplaysinthepublishparameterspage.
entityThisisthenameoftheENTITYinthetargetdtdthatiseditedbythisparameter.
inputtypeThiscontrolshowtheparameterisdisplayedonscreen.Iftheinputtypeistext,theparameterisdisplayedinaneditablefield.Iftheinputtypeismember,alloftheexistingorganizationsdisplayinadropdownlist.Youcannoteditreadonlyparameters.
targetdtdThisdefinesthetargetdtdfile.Thevaluesthatauserentersfortheseparametersarestoredinthefileidentifiedinthetargetdtdfile.Thisfileisalsopartofthestorearchiveandisunpackedwiththestoredataassets.Theentityvaluecorrespondingtoeachparameterisupdatedintheunpackedfile.TheDTDinsidethestorearchiveisnotupdated.Thevaluesfortheparametersarestoredinthisfile(inthiscaseForeignKeys.dtd)untilthepublishisinstantiated.
resourcebundle="/SARINF/properties/publishNLS"Finally,ifastoreispublishedinseverallanguages,asthestarterstoresare,thepublishparametersandtheiraccompanyingdescriptionsarefoundinlocalespecificfiles.Thefieldlabelanddescriptionforeachpublishparameterarelocatedinthepropertiesfiledefinedintheresourcebundleattributeofthestorerefs.xml.Duringpublish,theprocesslooksforthespecificlocaleforthelanguageusedinthePublishwizard.Thestoresref.xmlfilealsodefinesthesefiles.
deploydescriptor="WEBINF/stores/XXX/data/ibmwcload.xmlThedeploydescriptorspecifiesthelocationofthefile(ibmwcload.xml)thatcontrolsthepublishdataportionofthepublishingprocess.
-
7/28/2015 IBMWCSIBMWebSphereCommerceBlog:August2014
http://www.ibmwcs.com/2014_08_01_archive.html 5/10
Youshouldexaminehowthedataishandledbythestorearchive.Thedataloadingsegmentofthestorearchivecanhandleloadingcoredata,configurationdata,manageddata,andoperationaldata.Thestorearchivecanalsohandleloadingspecialcomplicateddata,suchasaccesscontrolandcontracts.ThenextsectionwillfocusonthedataloadingsegmentoftheWebSphereCommercestorearchive.
Section4.Datainthestorearchive
TheWebSphereCommerceStoreArchivehasaverysophisticatedmannertohandledata.ThedatathatistobeloadedintoWebSphereCommerceisrepresentedasXMLfiles.YoucanhavemultipleXMLfiles,eachcanhandleaspecificsetoftables,orevenasubsystem.Amasterfiledictateswhichfilesareloadedinwhichsequence.Thatway,youcansetdatawithspecialunresolvedidentifierssothattheSARcanresolveandmanagethemassloadresponsibilitiesatruntime.Withthisdesign,youcanpackagedataintotheWebSphereCommercestorearchiveandloaditonanydatabaseonanynodewithouthavingtohardcodedatabasespecifickeys.
Theunresolvedway
Whendataisrepresentedwithunresolvedidentifiers,thisallowsthepublishingprocesstomassloadthedatawithouthavingtoerrorwithprimarykeyconflicts.Tolearnmoreaboutusinginternalaliastoresolveidentifiers,seeCreatinganXMLfiletouseinternalaliasIDresolution.
Externaldependencies
ThePublishwizardpublishparametersfromthestorerefs.xmlfilespecifiesaparticularfile,thevalueoftargetdtd,todesignateexternaldependencies.Asthepathisspecifiedfromthetargetdtdparameter,itisfounddirectlywithinthedatasubdirectory:WEBINF/stores/YYY/data/ForeignKeys.dtd.Youwillbeaddingsomenewparameterstothisfiletomakesomespecialchangestofulfillthisblogrequirement.ThedeploydescriptorThePublishwizardpublishparametersfromthestorerefs.xmlfilespecifiesaparticularfile,thevalueofdeploydescriptor,asthedeploymentdescriptor.Asthepathisspecifiedfromthedeploydescriptorparameter,itisfounddirectlywithinthedatasubdirectory:WEBINF/stores/XXX/data/ibmwcload.xml.Youwillbeaddingnewaccountsandcontractstobedeployedinthisblog.Ofspecificinteresttothisblogfromthedeploymentdescriptorarethemasterandresolved.masterassets.Thesearedenotedasfollows:XMLexample3.Deploymentdescriptortoloadingdataassets
ThemasterassetisthefilethatcontrolswhichXMLfilesthataretobemassloadedduringthestorearchivepublishprocess.WhenconsideringunresolvedidentifiersinthedataXMLfiles,thoseunresolvedentitiesthataredesignatedastheprimarykeyshouldbesequencedbeforeotherXMLdatafiles(whichholdthosesameunresolvedidentifiersasforeignkeys).Theresolved.masterassetistheoutputoftheresolvedassetsthatarelistedinthemasterassetfile.Thisresolvedfileisimportantduringthetroubleshootingphaseofthepublishprocesswhenthereareresolvingormassloaderrors.
Section5.Adevelopmentscenario
Forthisblogtorepresentarealworldscenario,therearemanyWebSphereCommercesubcomponentsthathavetobetakenintoconsideration.Therefore,thisblogwillincludethefollowingdevelopmentscenario:
1. Creatingacatalogdatatoreflecttheentitlement.2. Creatingnewviews,commands,andJSPfilestodisplaythedata.
-
7/28/2015 IBMWCSIBMWebSphereCommerceBlog:August2014
http://www.ibmwcs.com/2014_08_01_archive.html 6/10
3. MappingthenewviewsandcommandsintotheAccessControl.4. Finally,puttingallofthoseassetsintotheWebSphereCommercestore
archiveandpublishingthemtoanewenvironment.
Tostartwiththesedevelopmentsteps,youshouldreviewModifyassetstorearchivesflow(Enterprise).Asyoucanseefromthisreference,repackagingthestorearchivewillbeaniterativeprocessasyougothroughthedecisionpointsofwhatassetsneedtobeupdatedduringdevelopment.
Section6.CreatingdatainthestorearchiveCreatingdatameansupdatingthefilefromthemasterasset,storedataasset.xml,inthedeploymentdescriptor.
Eachstarterstorearchivecontainsastoredataasset.xmlfile.Thestoredataasset.xmlfileincludesplaceholdersforallofthedataassetfilesinthestorearchivethatwillbeincludedduringthepublish.
Thefollowingisaportionofthestoredataasset.xmlfilefortheConsumerDirect.sar,illustratingtheplaceholders:
Withthatchange,thereneedstobeanassociatedchangeinthestoredataassets.dtdfiletomaptheseentityreferences.
Duringthepublish,allthedataassetsidentifiedwithplaceholdersinthestoredataasset.xmlfileareconsolidatedintoonelargedocument.TheIDResolverresolvestheIDsfoundinthedocument.AftertheIDsareresolved,IDResolvercreatesthefollowingfile,storedataasset.resolved.xml,whichcontainsuniqueIDs.IfanerroroccursduringtheIDresolvingprocess,theLoaderpackageaddsanentrytothemessages.txtfile.
YouwillcreatetheseXMLfilesandaddthecorrespondingdatatothem.
ThenextfewsectionswilloutlinechangesthatcanbemadeintheSAR.Somedatafitswelltobootstrapwhileothertypesofdatadoesnotfit.Forexample,thecatalogdataisnotthebestcandidatetobootstrapintotheSAR.
ThecatalogdataisusuallyexternalizedintoaseparatestandaloneSARfile.ItisrecommendedtouseBODLtoloadthecatalogdataduetothelargeamountsofinformation.Withthat,youmostlikelywouldnotdeploycatalogdatawithyourstarterstore.
Section8.StoreLocatorDataWhendeployingaSARtodemonstratetheIBMWCSfunctionalitytoyourprojectstakeholders,itwouldbeniceifthatSARcontainedthestoresrelativetoyourproject.YoucanactuallyprovidethisbybootstrappingthoseprojectstoresintotheIBMWCSproductSAR.
ThefollowingstepsisangeneraloutlineyoucanusetofollowtobootstrapthestoresintotheSAR:
1. GenerateStoreLocatordatafile.1. PullstorelocationsfromHD.calive2. Pullcoordinatesofstorelocationsfrom
http://itouchmap.com/latlong.html3. Mapthedataintothestorelocatortables
1. GEONODEcontainsthebasiccityinformation.2. GEOTREEcontainstheassociatereferencetoGEONODE3. STLOCcontainsthestoreinformationincludingthelatitudeand
longitudealongwiththeGEOTREEstatedabove4. STLOCDSlanguagesupportforthestoreinformation5. STLOCATTRcontainsthestorehours
2. ExtractthefollowingSAR:C:\IBM\WCDE_ENT70\starterstores\YYY\XXX.sar
-
7/28/2015 IBMWCSIBMWebSphereCommerceBlog:August2014
http://www.ibmwcs.com/2014_08_01_archive.html 7/10
3. Reviewthefollowingfilestoensurethereisareferenceto"store_locator.xml"andifthereisnotonethatexists,createditandappendtothefollowing:
1. storedataassets.dtd2. storedataassets.xmlthesefilesareupdatedinthefollowing
directory:C:\installdir\starterstores\YYY\XXX\WEBINF\stores\StoreAssetsDir\data\storedataassets.xml
Section9.Viewsandcommands
Thecommand,view,andURLregistriesarepartoftheWebSphereCommercecommandframework.Thecommandframeworkdetermineshowacommandexecutes,andthenreturnsaresponsebasedontheviewreturnedbytheexecutedcommand.Thecommandexecutionandresponsearestoredependent,whichmeansthatyoucanimplementthesamecommanddifferentlyforeachstore,aswellasreturndifferentresponsesforeachstore.
Forpurposesofthisblog,youwillsimplyreuseanexistingviewandrenameit.Thus,yousavethoseadditionsinthestorearchive.
Creatinganddeployingaview
Afteracommandisexecuted,inmostcases,therequesterofthecommandrequiresaresponsetobereturned.Whendeterminingtheresponse,thecommandframeworkconsidersthefollowingfactors:
Theviewfoundintheresponsepropertiesafterthecommandisexecuted.Thestoreonwhosebehalfthecommandwasexecuted.Thedeviceformatoftherequestwhentherequestwasmade.
Everyviewthatreturnsaresponsemustbedefinedintheviewregistry,eitherperstore,orbydefault,bysite.Eachstorewillnormallydefinetheviewforeachpossibledeviceformatoftheincomingrequest.However,ifaviewisnotdefinedbyastore,thedefaultviewforthesitewillbeused.Theadapterhandlingtherequestwilldecidewhichdeviceformatandthedefaultdeviceformattousewhendeterminingwhichviewtocall.Thereisnoonegenericdeviceformat,sodependingonthedifferenttypesofrequeststhatcanbeacceptedbyWebSphereCommerce,theremaybeaviewdefinedforeachdeviceformat.
Forthisblog,youwillbecreatinganewJSPandenablingitasaviewinthestorearchive.Toaccomplishthistask,youwilldothefollowingsteps:
1. DuplicatetheJSPfortheTopCategoriesDisplaypage.2. CreatetheviewdatainthecommandXMLfileofthestorearchive.3. CreatetheAccessControlforthatviewintheAccessControlXMLfileof
thestorearchive.
CreatingtheJSP
WhenyoufirstdeployedExampleStorefrontAssetStoreduringtheinitialpublishingstagestosetupthisenvironment,therewasasetofJSPthatweredeployedfromtheSARfile.GototheextracteddirectoriesoftheYYY.sar,andlocateXXX/.
Withinthatdirectory,navigatetothesubdirectoryShoppingArea/CatalogSection/CategorySubsection/.Withinthatdirectory,thereshouldbeaJSPfilecalledTopCategoriesDisplay.jspandCachedTopCategoriesDisplay.jsp.MakeacopyofthesetwofilesandrenamethemtoExampleCategoryDisplay.jsp,andleaveCachedTopCategoriesDisplay.jsptostillbereferencedbythenewJSPfile.
-
7/28/2015 IBMWCSIBMWebSphereCommerceBlog:August2014
http://www.ibmwcs.com/2014_08_01_archive.html 8/10
NowthatyoucreatedthenewJSPfile,addtheviewExampleCategoryDisplayView.
Thefollowingisthedatafilethatwaspreviouslysetinstoredataassets.xmlastheExampleStorefrontAssetStore_command.xmlentity.
Viewdata
CreatetheExampleStorefrontAssetStore_command.xmlfileandcreatethecorrespondingdata.
NowthattheviewissettoberegisteredinWebSphereCommerce,youwillneedanassociatedaccesscontroldefinition.
Accesscontroldata
CreatetheExampleStorefrontAssetStore_accesscontrol.xmlfileandcreatethecorrespondingdata.
acaction_id="@ExampleCategoryDisplayView"/>
NoticefromthisAccessControldefinitionthatwearereusingthe@xxxAssetStoreRegisteredCustomerViewsunresolvedidentifierthatwasdeclaredintheexistingstorearchiveassignmentintheaccesscontrol.xmlfile.
NowthattheJSPandviewarereadytobedeployedintoWebSphereCommerce,youwillnowperformyourfirstiterativebuild.
Section10.Thefirstbuild
Assumingthattheextendedsiteshasbeendeployedandastorehasbeenopened,youcandeploythefirstdevelopmentbuild.Whentheprevioussectionsofthisbloghavebeensuccessfullycompleted,thereshouldbeanupdatetotheextractedversionofXXX.sar.Fromtheextracteddirectories,youwillneedtozipthosedirectoriesbackupintoanupdatedversionofXXX.sar.
Forthisexample:
Commandexample.ExtractingaWebSphereCommercestorearchivecd\testWithinthedirectorystructurethatyouupdatedtheSARcontents,packagethatbackupintoasarfilewhichreflectsthesamestructureaswhenitwasinitiallyextracted.YoucanachievethiseitherusingJAVA(jarcvfXXX.sar\test)or7ziporWinZip.
NowthatyourWebSphereCommercestorearchiveisreadyforpublishing,youwillneedtousethepublishtool.Fordifferentoptions,seePublishingaStoreArchiveintheonlineIBMWCSInformationCenter.ThefollowingisanexampleofusingthePublishWizardtosuccessfullypublishthisupdatedSARfile:
1. LogintotheWebSphereCommerceAdministrationConsoletool.2. SelectthemenutitledStoreArchives,thenclickthesubmenuPublish,the
PublishpagewillshowtheStoreArchivespanel.
-
7/28/2015 IBMWCSIBMWebSphereCommerceBlog:August2014
http://www.ibmwcs.com/2014_08_01_archive.html 9/10
3. SelectoptionsfortheViewdropdown(orselectthedefaultStoreArchivesview,andthenreselecttheoptionStoreArchivesview.
4. ChecktheSARfileXXX.sar.5. ClicktheNextbuttononthetoprightofthepanel.TheParameterspanel
appears.6. Ensuretheparametersmatchthesettingsyouadjustedinyourchanges7. ClicktheNextbuttononthetoprightofthepanel,andtheSummarypanel
appears.8. AcceptthedefaultsandclicktheFinishbuttononthetoprightofthepanel.9. ClicktheOKbuttonfortheWebpagedialog.
10. WaitforthepublishtocompleteandclickRefreshtoacknowledgethePublishStatusascomplete.
AfteryouhavecompletedpublishingthisupdatedWebSphereCommercestorearchive,youcanbegintestingyourchanges.Whenyoulogintothestorethistime,youcanlogonasusual,thenonceloggedintothestore,youcanenterintheURLwhichcorrespondstoyournewviewname:ExampleCategoryDisplayView(forexample,http://localhost/webapp/wcs/stores/servlet/ExampleCategoryDisplayView?langId=1&storeId=10151&catalogId=10001wherelangId,storeId,andcatalogIdvaluesmaybedifferentvaluesforyourstore).
Section11.Subsequentbuilds
Forsubsequentbuilds,followthestepsoutlinedinthisblog.UponeachnewversionoftheWebSphereCommercestorearchivethatyouwouldappendto,simplyupdatethedirectoryandfile,\starterstores\XXX\YYY.sar,overandover,thusevolvingyourapplicationwithapackagedandcontrolleddeploymentmechanism.
KeepinginmindthatyouhavebeenupdatingtheAccessControlpoliciesforallyournewcommandsandviews.Itwouldbewisetocontinuallyrefreshyourenvironmentuponeachdeployment.ThismeansrevertingyourdatabasebacktotheWebSphereCommercebootstrapbeforeyoupublishyourfirstdevelopedSAR.Atotalrefreshisreallynotaproblemforyourdevelopmentteamanymore.IttakesaslongasaSARpublishwouldtaketobringyourenvironmentbackupfromscratch!
Whenrefreshingyourenvironment,youensurethattheaccesscontrolpoliciesimposedbythebootstrapWebSphereCommercesystemisinplace.ThenyourlatestSARwilladdontheremainingaccesscontroldeltapolicies,whichapplytoyourlatestuseraccessrequirementsforcommandsandviews.
So,nowthatyouknowyouaregoingtorepeatthedeploymentofyourSARoverandoveragain,thenyoucansetupyourPublishwizardpublishparameterswithinthestorerefs.xmltobereflectedtowardsparametersyouknowyouarepublishing.Forexample,ourinitialstorerefs.xmlfromtheoriginalSARhadthefollowingparameters:
SinceyouaremostlikelygoingtopublishyourcatalogdataandyourstoredataalongwithyourB2BDirectStorefrontAssetStoreSARimplementation,youcanaddthefollowingentriestoyourstorerefs.xmlasawaytogetyourdatasetupfortheXMLdatathatmayneedtoreferenceit.
TheabovesettingsprovideyourSARthetargetStoreidentifier,whichusesadropdownsuppliedwithsomeselectabledataasinput.TheselectionisalreadysettosomedatathatwasrepresentedintheForeignKeys.dtdfiletopopulatetheidentifier,memberDN,anddirectory.ThehubStoreContractidentifierpullsaparameterfromtheForeignKeys.dtdfileandsetstheentityreference:hub_created_store_contract_1.TheidentifiersareusedaskeystopulllocalizedverbagefromthepublishNLS.propertiesfile
-
7/28/2015 IBMWCSIBMWebSphereCommerceBlog:August2014
http://www.ibmwcs.com/2014_08_01_archive.html 10/10
NewerPosts OlderPostsHome
Subscribeto:Posts(Atom)
PostedbyMikeShieldsat8:15AM Nocomments: Linkstothispost
inthepropertiesdirectoryofSARINF.TheentityreferencecarriesavaluetobeusedinthemappingoftheForeignKeys.dtd,whichisusedtopopulatedataduringtheSARpublishing.Toreviewthis,openthetargetdtd="WEBINF/stores/XXX/data/ForeignKeys.dtd"filereferencenotedfromthisstorerefs.xmlfile.
WithintheForeignKeys.dtd"file,youcanaddanewentityreferenceandevenincludehardcodedvaluesasnecessary.
Withthepublishparametersupdatedandwithsomeuniquewaysofcomplimentingyourdevelopmentbuilds,youcanseehowpowerfulitistousetheSARasyourdeploymentmechanism.
Section12.ConclusionLeveragingthestorearchiveasyourdevelopment,build,anddeploymentmechanismsavesalotofresourcesrequiredtobuildANTscriptstodowhatyourSARwouldalreadyprovideforyou.However,IBMWCSdoesprovideaBuildandDeploytoolwhichalreadyprovidesyouwithalltheANTlogicthatyourequire.So,thenwhyevenbotherwiththeSARaugmentation?Twofold:theSARcanbepassedtoyourteamorevenbacktotheoriginalproductteamforsupport.ThiscomplimentsAgileprocessestoincreaseresponsetimeconfirmwhathasbeenengineeredinthesolutiondirectlymatchesthebootstrapsprovidedthroughtheSAR.Also,thebenefitisthatyoudirectlyalignyoursolutiontothebootstrappingoftheproduct.
Inthefuture,IwouldchallengethatIBMWCSmergetheirSAR(starterstores)directlyintotheBuildAndDeploytool.Thatway,whenyoubootstrap,youaremodellingthatdirectlyintothebuildprocess.WhatthismeansisthatwhenyoufirstinstallIBMWCS,youactuallyinstallastarterstorefromthebuildprocess.Goodidea?LetIBMknowsothatyoucanstartboostrappingintothebuildanddeploytoolinsteadoftheSAR.
Watermarktemplate.PoweredbyBlogger.