A confluence attachment event plugin - plugins

I would like to make a plugin with some kind of a listener when an attachment is uploaded / or dragdropped. Anyone who might help?

There is one specialized Event extending ConfluenceEvent named AttachmentEvent - I think this is what you should listen to.
In the next step you simply need to implement an event listener module as describe in Atlassian's developer documentation.

Related

Listener for all jface actions similar to IExecutionListener

In eclipse, there is a listener for any org.eclipse.core.command that is executed - org.eclipse.core.commands.IExecutionListener.
Is there such listener for jface action? I know you can add a property change listener to a jface action. But what I am looking for is a listener at framework level where it listens to all actions being executed in the application. It is probably possible to write such a listener, but is anything provided out of the box?
No, there is nothing that does this.
Lots of code in Eclipse calls the IAction run or runWithEvent methods directly without going through any centralised service so it is not possible to do this.

Create new work item type using VSTS Extension

Based on the documentation https://learn.microsoft.com/en-us/vsts/extend/overview?view=vsts#what-makes-up-an-extension, a VSTS extension can be used to extend the work item form.
However, I would like my extension to automatically create a new work item type once it is installed. Is this something that is possible? I can't find any documentation online that suggests how to do it.
Theoretically this is possible, the extension has a "first load" call which you can use to use the rest api to create a custom process or update the existing custom process. The REST Api to change processes isn't public yet, so you'll have to work from using fiddler to watch how the web ui does it.
Due to the way processes are linked to projects, all projects with that process will get the new work item type.
I could not find a lot of documentation online for this, but the VSS web extensions SDK(https://www.npmjs.com/package/vss-web-extension-sdk) has a REST client called 'ProcessDefinitionsRestClient' declared in the typings/tfs.d.ts file. This client has a createWorkItemType method available that looks like this:
createWorkItemType(workItemType: ProcessDefinitionsContracts.WorkItemTypeModel, processId: string): IPromise<ProcessDefinitionsContracts.WorkItemTypeModel>;.
The 'ProcessRestClient' client has methods to create a new/inherited process to which the new WIT can be added.
I have not tried it out yet, and these APIs are still in preview, but maybe they can get you started on the right path.

Execute code upon content-changes in TYPO3

Is it possible to notice if the content changed in the Backend and then, for example, to send a mail?
In other words, can I somehow notice who modified the contents in the backend and then automatically send an email?
Yes. When content is changed in the backend, several hooks are called before and after the database operations. You can register for each of those hooks. The class you want to have a look at for the right hook is \TYPO3\CMS\Core\DataHandling\DataHandler.
You can e.g. register a class for the processDatamap_afterDatabaseOperations hook by adding the class name to the array
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass']
in your ext_localconf.php.
You can find more about hooks in TYPO3 here: https://usetypo3.com/signals-and-hooks-in-typo3.html

Manatee.Trello: Webhook Code Sample

I am looking for a code sample on how to use Manatee.Trello Webhook feature.
I found some documentation here: https://bitbucket.org/gregsdennis/manatee.trello/wiki/Webhooks, but it's not clear enough for me.
It only demonstrates how to create a Webhook, but doesn't demonstrate how the real-time updates are received and processed. Tried the Updated event on the Webhook, Card and Actions - but clearly I am not doing something correctly.
Any help would be appreciated.
This article demonstrates webhooks in general:
https://blogs.msdn.microsoft.com/webdev/2015/09/04/introducing-microsoft-asp-net-webhooks-preview/
Basically, there is a NuGet package Microsoft.AspNet.WebHooks.Receivers.Trello that you can install that does all the heavy lifting.
Once the NuGet package is installed I can override the built-in Controller and use Webhook.ProcessNotification() as Greg Dennis had suggested.
Hope someone out there finds this useful.
You'll need to set up the web portion yourself. This can be done with an ApiController (or others).
Once you receive a POST message, read the content as a string (don't deserialize), and pass that to Webhook.ProcessNotification(). Manatee.Trello well take care of the rest.
This will trigger the Updated events.
EDIT
I have created some better docs. Here is the example you seek!
https://gregsdennis.github.io/Manatee.Trello/examples/webhook.html#processing-a-webhook-notification

How do I use the Groups.pm in Request Tracker?

In lib\RT\CustomFieldValues\ there is the groups.pm file which is supposed to be an example of how to get data into a custom field, but how do I actually use that once I have written it? Does anyone have any documentation or a sample of this?
I have finally figured it out, to use the Groups.pm module you need to go to /opt/rt3/etc and edit the RT_SiteConfig.pm and add the line
Set(#CustomFieldValuesSources, "RT::CustomFieldValues::Groups");
Restart Apache and it will be available as a new field source.
I have written a blog post on doing this which also includes details on how to build your own module in case anyone is interested in doing this: AD Lookup Control in Request Tracker