Jump to content


form-out trigger documentation - add default text in submit changelist form

trigger submit perforce changelist

  • Please log in to reply
7 replies to this topic

#1 littlechap22

littlechap22

    Newbie

  • Members
  • Pip
  • 5 posts

Posted 14 November 2013 - 10:31 AM

I am looking for a way to add default text in the perforce submit form; where we add the description.

I found that form-out triggers are best suited to do this job.

I am looking for good documentation where I can learn how to build such trigger. The docs I have encountered are fragmented, teaching in parts.

Kindly let me know such sources wherein I can study some code samples.

Attached Perforce submit box image for a p4 client.

Thanks.

#2 P4Matt

P4Matt

    Advanced Member

  • Members
  • PipPipPip
  • 1383 posts

Posted 14 November 2013 - 07:54 PM

The admin guide should have all the information you need:

   http://www.perforce.....scripting.html

If there's anything you feel that is missing let me know and I'll help find that info for you.

#3 littlechap22

littlechap22

    Newbie

  • Members
  • Pip
  • 5 posts

Posted 15 November 2013 - 05:32 PM

Thanks P4Matt. I'll use that and get back if I am unable to move ahead.

#4 littlechap22

littlechap22

    Newbie

  • Members
  • Pip
  • 5 posts

Posted 03 December 2013 - 05:58 PM

I got another link which might also address the same problem by using Perforce Javascript API for Visual Tools.[1] . I am exploring more on these two.

[1] - http://www.perforce....pi.html#1110579

#5 littlechap22

littlechap22

    Newbie

  • Members
  • Pip
  • 5 posts

Posted 08 December 2013 - 11:03 AM

Hi P4Matt,

Some of my mates suggested using custom tools [2] to get what I need. I made a very basic tool which runs the p4v command: p4v -ztag describe 123123
using help from [3].

Also, I looked into the triggers and Javascript API. Both need access as superuser to configure settings which I may need to request.

I plan to start reading the perforce scripting docs to know about perforce commands' specification which then I could use to build my feature. Before that, I would need your suggestion to know if my feature could be implemented using custom tools or ( I would have to jump to triggers or Javascript API). Would you please help me out here?

Thanks.

[2] - http://www.perforce....stom_tools.html
[3] - http://forums.perfor...hl__custom tool

#6 P4Matt

P4Matt

    Advanced Member

  • Members
  • PipPipPip
  • 1383 posts

Posted 09 December 2013 - 06:33 PM

The Javascript API is a better bet than a custom tool for what you are looking to do. With a custom tool you can create a new menu item that would launch an interface you created to do the submit, but the normal submit menu item would still be there, making it easy for users to pick the wrong one.

With the Javascript API you can create a replacement submit dialog. I have to confess I've never done it; it's perpetually on my list of things to do, but it never seems to get done. =)

One thing to note, there is a tricky way to configure the Javascript API locally without having super access. I've documented it on our 'Hacking Perforce' wiki page:

http://wiki.workshop...acking_Perforce

#7 littlechap22

littlechap22

    Newbie

  • Members
  • Pip
  • 5 posts

Posted 11 December 2013 - 04:50 AM

@P4Matt - Thanks for the link. It eventually points to the solution [4] which is given as part of examples and more than what I could expect.

While I was trying to make it run, it seems the P4V is clever. I followed the 'Hacking Perforce' page, created the local version of the centralSettings file. But when I restart the P4V client, it overrides those changes. The ApplicationSettings.xml does not have the xml tag I created.

I read some perforce noted [2] which said "if a central settings file is configured for you in the protections table, it overrides any locally-configured file". I verified if the perforce admins has created any file by going to Help > System Info. It has these lines specifying no such location:

"
Checking permissions table for central settings file
Central settings file specified for user: no path found in permissions table
"

Could you let me know what I am doing wrong? Thanks.

[1] - http://swarm.worksho...4jsapi/examples
[2] - http://www.perforce....er/p4vnotes.txt

#8 P4Matt

P4Matt

    Advanced Member

  • Members
  • PipPipPip
  • 1383 posts

Posted 11 December 2013 - 05:06 AM

Make sure to enable applets from the preferences menu. I just tried it on my Mac and it worked like a charm.





Also tagged with one or more of these keywords: trigger, submit, perforce, changelist

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users