Git/Editing your Eclipse project Website using Orion
You can install Orion locally to edit and test your Phoenix-based website. Editing can be done with out-of-the box Orion, but to test, you'll require a LAMP stack (like XAMPP).
Getting started with Orion
Download and install Orion. Be sure to create an account.
Note that with the default install, Orion is not configured to start automatically. Configuring automatic start-up is platform-dependent. Feel free to add platform-specific start-up instructions in this document.
Create a clone of your Website directory
The first thing that you need to know if the URL of the Git repository that you'd like to work with. In Git parlance, we need to make a clone of that repository on the Orion server. You will make edits in the local copy on Orion and then "push" your changes (commits) back to the Eclipse Git server.
Your project's website directory will be located under www.eclipse.org on the Git server. The website for your project will be in a directory named <project-short-name>.git (e.g. orion.git). Click on your project repository, scroll down to the bottom and copy the "ssh://..." URL listed under "Clone" (e.g. ssh://git.eclipse.org/gitroot/www.eclipse.org/orion.git).
Return to Orion and click on "Repositories" in the navigation bar at the top of the page. Click "Clone Repository" and paste the URL for your project's website. Modify the pasted URL to include your Eclipse committer id (e.g. ssh://firstname.lastname@example.org/gitroot/www.eclipse.org/orion.git). Click "Submit". Orion will ask for your ssh password. Enter your committer password. Orion will make a clone of your repository.
Note that you can make clones of any repository. You will be able to make local changes and commit them locally. You will only be able to push your local changes to the server if you are a committer on the project (or otherwise have write permission).
Click on "Navigator" in the navigation bar on the top of the page to see the cloned repository contents.
Note that you can open multiple Orion pages in your browser by right-clicking on links to "open in new tab|window".
- Greasemonkey Scripts make cloning a repository into Orion even easier;
To test using your local workstation, you need to install a LAMP stack. On Linux based systems, this may already be installed, or can easily be installed by pulling Apache HTTP Server, MySQL, and PHP 5 support from the software repository. For Windows users, consider installing something like XAMPP. Feel free to add platform-specific instructions to this document.
- Tip: If your XAMPP Apache server refuses to start on Windows, check to see whether your Skype client is grabbing port 80 and 443. You can find the setting via Tools->Options->Advanced->Connection in Skype.
- Tip:If you use the Phoenix-style PHP templates, via the XAMPP Console, edit your PHP.ini file to ensure that "short_open_tag = on". Many of the Phoenix pages use the short tags <? and ?>. You can edit the PHP.ini file via the Apache service Config button as shown below.
To test Phoenix-based content, you'll need to pull in the Phoenix infrastructure from Git. Use Orion to clone
git://git.eclipse.org/gitroot/www.eclipse.org/eclipse.org-common.git. Note that the Git URL provided here uses the "git" protocol which does not require user authentication. If you intend to edit eclipse.org-common, then you should use the "ssh" protocol.
Easy Set up
Edit the Apache configuration file (xampp\apache\conf\httpd.conf on Windows/XAMPP). Change the
DocumentRoot entry to point to Orion's serverworkspace directory.
This is where it gets a little weird. When Orion creates a clone of a Git repository in your workspace, it doesn't use the repository's name. It generates a unique name to avoid potential collisions in the workspace directory. As of this writing, these names are uppercase alphabetic characters.
In the Orion Navigator, hover your cursor over the
org.eclipse-common directory. Your browser should show you the link (in Chrome it appears in the lower-left corner). It will take a form like
http://localhost:8080/navigate/table.html#/file/D/?depth=1. The character following
/file/--'D' in this case--is what's interesting.
Use the platform-specific command to create a link for this directory in the serverworkspace, rename that link 'eclipse.org-common' and place it in the htdocs directory.
On Windows Vista/7/8, try:
c:\orion\serverworkspace>mklink /D eclipse.org-common D
Note that creating a shortcut won't work on Windows. Shortcuts create *.lnk files that Apache won't honour.
Repeat this for each of the directories that you need to test.
You may need to tweak some of the directory permissions to enable your LAMP stack to read the content.
Harder Set up
You can create virtual hosts; but this is a little more involved. More later.
Before starting any new work in your project website directory, be sure to update your clone of the repository.
Click on "Repositories" in the navigation bar at the top of the page. Click the "Pull from the repository" icon to the right of your repository (it's the icon that points up). You may be asked for your credentials; use your Eclipse committer password.
Click on "Show in navigator" to the right of the repository to review the contents and start editing. You can also click on "Navigator" in the navigation bar on the top of the page to access the files in your local workspace.
Editing is pretty straightforward. Expand the file hierarchy as necessary and click on a file to open the editor (note that you can right click to open the editor in a new tab or window if you wan to keep the Navigator open).
When you are done with your edits, flip back to the "Repositories" page. If you've made changes, your repository should be annotated with a brief status message (e.g. "1 file(s) to stage and 0 file(s) to commit.").
Click on "Git Status" to the right of your repository.
The files that you've changed should appear under "Unstaged". Click the "Stage the change" icon to the left of each change you want to commit (it's the icon that looks like a document with a down arrow). Do this for all of the changes that you want to commit. The files will move from "Unstaged" to "Staged".
Note that you can review the changes by clicking the "twistee" arrow to the left of the file name.
Click on the "Commit" button to right of the "Staged" section header. Enter a commit message describing your change and click "Submit".
To complete the operation, click the "Push All" button to the left of the "Commits..." section at the bottom of the page. If you are prompted, enter your committer password.
That's it. You're done.
Cleaning up your workspace
Use with care
On the "Repositories" page, click the "Git Status" link to the right of your repository. Click the "Reset" button to the right of the "Commits..." section.
Note that this will return your workspace to the current Git state. Any changed files that have not been committed will be reverted back to their last committed state (or removed if they were added).
Adding a file to your workspace
Deleting a file from your workspace
Install PHP Syntax Highlighting