ibm wcs - ibm websphere commerce blog_ august 2014

10
 7/ 28/2015 I BM WCS - IBM WebSphere Commerce Blog: August 2014 ht tp: //www.i bmwcs.com/2014 08_01_archi ve. html 1/10 IBM WCS - IBM WebSphere Commerce Blog Home WCS conf igur ati on ! Webspher e Commerce Client's list B2B B2 C S QL - WC S Friday, August 15, 2014 Bootstrapping Solutions to Market Bootstrapping Solutions to Market This blog describes how to augment the WebSphere® Commerce store archive (SAR) to match the relevant business requirements for your solution. For example, the SAR will provide you with some sample data which establishes the store finder featur e in the online store. If you switch the sample data with your actual brick-and-mortar stores, then you could deploy t he S  AR q uickly and demonstrate the store finder feature to your stakeholders with greater impact. This blog will outline the SAR and give you the insight you ne ed to be abl e to transition the out-of-the-box software into a bootstrap ready software  solution to match your business needs. Section 1. Overview In this blog, you will learn how to set up a WebSphere Commerce store archive (SAR) to deploy your solution. These starter stores (SAR) are intended mostly for jump starting your solution outline, however, we can take it a step further and incorporate engineering processes to create bootstr aps. To get mor e information on bootstrapping within a solution, you could benefit from reviewing the following patent that I have submitted through the US patent office which outlines the benefit of bootstrapping in your solution delivery: http://appft1.uspto.gov/netacgi/nph-Parser? Sect1=PTO1&Sect2=HITOFF&d=PG01&p=1&u=%2Fnetahtml%2FPTO%2Fsrch num.html&r=1&f =G&l= 50&s1=%222009 0187880%22.PGNR.&OS=DN/2009018 7880&RS=DN/20090187880 In a more involved and sometimes evolved e-commerce application, the store front assets may be totally different from what is provided in a given WebSphere Commerce Starter Store.  As the deve lopme nt a sse ts e volve throug h the iterative proce ss, you nee d to deploy those assets. When delivering a WebSphere Commerce application using an iterative approach, you need a low-cost and convenient mechanism to deploy these assets on an ongoing regular basis. The benefit of this entire bootstrapping exercise is to impose your own branding and ideas directly into the product it self. Thus, as you evolve in your understanding of t he product, the product appreciates this by evolving through the bootstrap mechanism described in this blog. Internal reusable assets inside a store archive When deploying a WebSphere Commerce application, there are many assets to consider. The SAR has a mechanism to deploy those as assets as listed below: Resolving and massloading data You can break up data into several categories: core data, configuration data, managed data, and operational  362,886 Total Pageviews  Go Search My Blog 2015 (10) 2014 (28) November (7) October (4) September (1)  Augus t (1) Bootstrapping Solutions to Market July (5) June (2) May (1)  April (3) March (1) February (3) 2013 (17) 2012 (28) 2011 (37) 2010 (24) 2009 (1) Blog Archive Cross Reference bean tables commands Test Java Code Online Eclipse Platform Tips Regex Tester Funny 404 errors Excel to SQL online tool URL Encoding JSON Validator Online XML Validation Generate HTML escape CHARS Developers LifeLine Subscribe To 0  More Next Blog»  Create Blog Sign In

Upload: jeffa123

Post on 02-Nov-2015

16 views

Category:

Documents


0 download

DESCRIPTION

jaya

TRANSCRIPT

  • 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.