It's all about the answers!

Ask a question

Edit code on JazzHub


Cesar Ivan Orozco Cervantes (10910) | asked Feb 24 '14, 1:35 p.m.
Hi everybody,

I´m just starting with JazzHub and I have a few questions, but the most important is how can I edit code directly on the browser?, Here is what I did:

1.- Create a project on my RTC Eclipse client.
2.- Push the project to JazzHub.

I can see the project on JazzHub, and I can open a java class I created there, but it is read-only, if I click the EDIT CODE button on the upper right corner it redirects me to the repository root (where is located the readme file).

Any one knows how to do this?
thanks guys.

Comments
Fariz Saracevic commented Feb 24 '14, 2:11 p.m.
FORUM MODERATOR / JAZZ DEVELOPER

 Did you try finding your file from the root repository, opening it and then clicking inside the file to modify it?


Cesar Ivan Orozco Cervantes commented Feb 24 '14, 2:16 p.m.

Yes, I opened the file but as I mention is read-only

Accepted answer


permanent link
McQ Wilson (613) | answered Feb 24 '14, 3:44 p.m.
FORUM ADMINISTRATOR
The source code you see on the project's home page *is* read-only. It is simply a direct view into the contents of the repository.  If you want to edit the source, you should click the "EDIT CODE" button. This button takes you to an online work area (like an Eclipse workspace) where you can work with your code. 

It is important to note that the contents of this workspace will be the same as it was the last time you were there, which may _not_match_what's_in_the_repository_.

Because you may have clicked through to that area before, you should check whether the contents you have there are the latest (it may even look empty). Just select the icon that looks like a repository (if you hover over it you get the menu you described above). Clicking on it, will do the same thing as clicking the first item in that menu (i.e. it should be "Git Status"). When you are the Git Status page, click the button labeled "FETCH" and then click "MERGE". Assuming there are no conflicts, this will make your workspace match what was in the repository.
Cesar Ivan Orozco Cervantes selected this answer as the correct answer

Comments
Cesar Ivan Orozco Cervantes commented Feb 24 '14, 3:53 p.m.

Thanks! this is exactly what I missed, the repository was updated but not the workspace, now I can edit the code.

Thanks again!

2 other answers



permanent link
Robin Garside (411) | answered Feb 24 '14, 2:45 p.m.
FORUM ADMINISTRATOR / JAZZ DEVELOPER
Hi Cesar - thank you for reaching out! I wanted to make sure I understand your situation. You created the project via JazzHub (@ hub.jazz.net), loaded it through Rational Team Concert, created a few Java files, and now you'd like to be able to edit those files on JazzHub web through the "Edit Code" function. Is this correct?

Assuming so, here is what I did to make that work. I imported the JazzHub project through RTC, loaded up the workspace as a project and created a few files within that project. I then checked in and delivered those files.

On JazzHub, I navigated to the project and hit "Edit Code." When the workspace loaded, I hovered over the cylinder icon (on the left-hand menu) and clicked on "Jazz SCM Changes". Under "Workspace Changes," I hit the triangle icon for "Accept incoming change sets for the stream," and that loaded up the files. I was then able to modify those files by clicking on the pencil icon and clicking on the project name to expand the folder/file list.

Let me know if this doesn't work for you.



Comments
Cesar Ivan Orozco Cervantes commented Feb 24 '14, 3:06 p.m.

Hi, thanks for your answer,

When I hover the cylinder icon only this options are shown:

Git Status
All Jazz SCM Repositories
Git Log
Git Repository
All Git Repositories

I can't find the options Jazz SCM Changes, sorry if it is a silly question, I'm completely new to JazzHub


McQ Wilson commented Feb 24 '14, 3:19 p.m.
FORUM ADMINISTRATOR

Cesar,


Given the contents of that menu, I believe you created a git backed project. If that's true, then you will need to use the Git SCM system to load the source.


permanent link
Miran Badzak (312) | answered Feb 24 '14, 3:13 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Hi Cesar - did you end up delivering the changed files through RTC? If you open the "Pending Changes" Eclipse view, you may notice that your files have not been delivered. They will show up in the "Unresolved" folder under your workspace. To deliver the changes, right-click on the Unresolved folder, and click "Check in and Deliver." After the delivery is complete, you should see the Jazz SCM Changes option in the browser (you may need to refresh the page).

Comments
Cesar Ivan Orozco Cervantes commented Feb 24 '14, 3:20 p.m. | edited Feb 25 '14, 1:16 a.m.

I'm using RTC client but also I'm testing EGit, from the Repositories view I selected Commit and then Push to Upstream, after that I can see the folder of my project on JazzHub and I can open the java class but still I can´t edit it.


Miran Badzak commented Feb 24 '14, 3:40 p.m. | edited Feb 25 '14, 1:16 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Ah, I see. Are you viewing the file on the project page? If so, that file viewer is indeed read-only. From the project page, can you try to click on the "Edit Code" button to open the full JazzHub code editor? From that interface, you should be able to modify the file.

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.