Setting Up a Development Environment in Oracle WebCenter Sites
Function1 would like to take this opportunity to welcome Mike Field (co-author of this blog) to our Web Experience Management team. Mike joins us from Metastratus Web Solutions and brings in-depth expertise in all aspects of Oracle WebCenter Sites. Mike and I worked together on creating a development environment in Oracle WebCenter Sites for a client and decided to document the process.
As all of us enthusiastic developers know, setting up an initial development environment can sometimes be a tedious and painstaking process, regardless of the platform or software we use. It can take trial and error, and documenting the correct process is key to more efficient setups in the future.
We want to start coding, but all the setup and configuration steps always get in the way!
This blog post will outline a detailed, step-by-step guideline to set up an Oracle WebCenter Sites (OWCS) development environment that runs on Tomcat, connects to a Bitbucket version control system using Git, utilizes the GSF (GST Site Foundation), and integrates with Eclipse and the Content Server Developer Tools (CSDT).
- Install a fresh OWCS JumpStart Kit (JSK), with no sample sites
- The JSK could be a fresh local installation of OWCS
- Start the JSK
- Create a new ContentServer (CS) workspace in Eclipse
- Open eclipse, switch to Oracle WebCenter Sites (or ContentServer) perspective
- Connect to the JSK (it will prompt you for the project name)
- The new CSDT workspace will always default to the directory "<ContentServer_Root>/export/envision/cs_workspace"
- Once connected to the JSK via CSDT, continue
- Rename the "/cs_workspace/" folder to "/cs_workspace_old/"
- Create a new, empty "/cs_workspace/" folder
- Switch to Git perspective in Eclipse
- Clone an existing remote repository
- Enter the Bitbucket repository URL
- Example: https://user@bitbucket.org/company/project.git
- The destination for this clone should be your new, empty "/cs_workspace/" folder (if need be, delete the ".project" file). Other than that, accept all the defaults. This will download all files from the remote repository onto your local machine.
- Copy the ".classpath" and ".project" files from your old "/cs_workspace_old/" folder into the new one
- Back in Eclipse, change back to the Oracle WebCenter Sites (or ContentServer) perspective
- Right-click on project in the Project Explorer in Eclipse
- Select Team --> Share Project
- Choose Git
- If available, check the box for "Use or create repository in parent folder of project"
- Select a ".git" file that points to the repository you cloned in your local CSDT workspace (<ContentServer_Root>/export/envision/cs_workspace)
- Switch back to Oracle WebCenter Sites (or ContentServer) perspective and begin syncing data to WebCenter Sites
- Import ONLY the following: ("Sync to WebCenter Sites"):
- <YourSite> and GST Sites (@SITE)
- Login to the JSK and via the WEM Admin interface, add user 'fwadmin' (or whatever admin user you want) to <YourSite> as well as the GST site
- Assign ALL Roles to user 'fwadmin'
- All Asset Types (@ASSET_TYPE)
- All GSTDefinitions
- All GSTAttributes
- <YourSite> and GST Sites (@SITE)
- Install the GSF, which is just the steps:
- Deploy the GSF jar file "gst-foundation-all-11.6.0-SNAPSHOT.jar" into Tomcat’s "/webapps/cs/WEB-INF/lib" directory
- Copy the GSF folder "/web-resources/gsf/" into Tomcat’s "/webapps/cs/" folder
- Use CatalogMover to auto-import the file "gst-foundation-all-11.6.0-SNAPSHOT-elements.zip"
- Back in the JSK, via the GSF interface, run the GSF WEM App Installer ("Install/reinstall GSF components")
- Restart Tomcat
- Login to <YourSite> in the Admin interface
- Enable any Asset Types required for <YourSite>. Do NOT create any new Start Menus (we'll import them later)
- Back in Eclipse in the Oracle WebCenter Sites (or ContentServer) perspective, import all Roles (@ROLE)
- Import all @ELEMENTCATALOG elements
- Import all assets (anything without an @ symbol in front of it, or @ALL_ASSETS)
- Import all @TREETAB elements
- Import all @STARTMENU elements
- Import all AttrType elements (if you haven't already)
And there you have it! Our local JSK now has all required elements imported to it from our local CSDT workspace, and we can run <YourSite> in order for it to be used in development!
Verify that all Git functionality in Eclipse cooperates with your remote repository in Bitbucket. In particular, some hints:
- TO COMMIT CHANGES
- First do Team > Commit
- Then do Team > Push Upstream
- TO RETRIEVE CHANGES (AKA UPDATE)
- First do Team > Fetch From Upstream
- Then do Team > Pull
- IF YOU CAN'T AUTHENTICATE VIA EGIT, PULL FROM THE COMMAND LINE:
- git pull https://username@bitbucket.org/company/project.git master
Good luck, and please let us know if you have any questions!
- Log in to post comments