Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to open p4 file by a hyperlink

For example, I have written a document and submited to p4.Then I would like to share it on the company intranet or notify the others by email.

I create a post and refer to the p4 document as a hyperlink in the post. When the user click on it, his local P4 will be launched to sync the document according to his p4 config(would be failed if he is not allow to access the relevant repo), then the document will be opend on his PC.

By imaging this feature, I am just trying to find a solution to share p4 document easily. Since I dont want to upload the documents to the intranet then sync it between p4 manually. Any suggestion is welcome. thanks.

like image 364
OliverWho Avatar asked Oct 24 '11 05:10

OliverWho


People also ask

How do I open p4 files?

Quick start with p4Open p4v (visual Perforce client). Right click on the project folder. Click "Open Terminal". Now you can use p4 in a preconfigured console, you don't need to setup workspace and server connection.

How to add files to changelist p4?

To add files to the depot, create the files in your workspace, then issue the p4 add command. The p4 add command opens the files for add in the default pending changelist. The files are added when you successfully submit the default pending changelist.

What is tree in perforce?

The Tree view is the page P4Web shows you when you first connect. It's where you'll spend most of your time in P4Web. You can use it to navigate through path hierarchies and run commands that affect all the files in the current path at once.

What does p4 add do?

p4 add opens files within the client workspace for addition to the depot. The specified files are linked to a changelist. The command can add files to a new, empty depot or to a depot that already contains files. The files are added to the depot when the changelist is committed with p4 submit .


2 Answers

Another simple technique is to set up your intranet web server to serve documents from a frequently-sync'd workspace, as described here: http://www.perforce.com/customers/white_papers/web_content_management_perforce in the section "2. A Simple WCM Approach".

I have used this mechanism, with an Apache web server, and a Perforce client workspace with a cron script sync'ing the workspace every 10 seconds, to share documents via URL in a development environment with dozens of active developers, quite successfully.

like image 199
Bryan Pendleton Avatar answered Sep 25 '22 14:09

Bryan Pendleton


You can try using a custom url protocol and handler. This would allow you to write urls like p4v://Some/place/some/where/. The setup will depend on your platform.

  • Windows
  • Gnome

You could then set the handler to the p4v executable with the -s option. This will open a location, but it won't provide any kind of syncing.

p4v -s "//Some/place/some/where/"

You may also need to coerce the url into a valid perforce path. For example, windows urls will include the text before the colon, causing problems.

p4v -s "p4v://Some/place/some/where/"

So you will probably have to write a wrapper script around the execution of p4v to do some text filtering. This is all kind of a pain, which is why I haven't done it myself.

like image 45
tprk77 Avatar answered Sep 24 '22 14:09

tprk77