14

The only obvious problem is that you should subscribe to EventPhases.Initiated instead of EventPhases.TransactionCommitted. Other than that it looks fine, unless you are calling component.Save somewhere down the line.


12

The event system code loads when the Tridion Content Manager Service Host service loads, and you can see this in the Windows Event Viewer. As each event handler loads you will see the status showing that the TCM Extension has been initialized. or


11

Unless you're trying to implement really granular permissions (more on that in a minute) it makes more sense to handle this on the check-out event instead. The rudimentary issue that I see - and this also applies to implementing granular permissions (e.g., treating check-in and check-out as two separate permissions) - is that by the time the check-in event ...


11

What have you tried? If you're just starting your search then the docs references below are a great start. Both the TOM.NET and Core Service APIs are available but it shouldn't be about what's easiest. It would be interesting to understand if there some technical or business reason you want to consider using the Event System? If you have Alchemy installed,...


10

I may just not be seeing it in the code, but you're not implementing IDisposable and there's nothing in your code calling Dispose(). If you're not disposing of the subscription it never actually finishes executing, as Dispose is what enables garbage collection to clean up all of your references. Have your class implement IDisposable.


9

It sounds like you are hooking into the Processed (or later) phase of the Save operation, which will only be called after the save has happened. You should instead hook into the Initiated phase of the save. This one occurs before the save and so giving the field a value will satisfy the mandatory requirement of the field when the save does occur. Update: ...


9

For #1 publishing priority is the way to go. Maybe changing the default priority to "low" will give you enough of an override to push things through quickly. Using publishing priorities in conjunction with the information I share in the blog post on keeping threads available. Item #2 might need event system, but you should be careful of performance impacts. ...


9

You can try the below events related to Workflow: 1.Event for Workflow process starts EventSystem.Subscribe<ProcessInstance, StartWorkflowEventArgs>(OnProcessInstanceStart, EventPhases.Initiated); 2.Event for Workflow activity starts EventSystem.Subscribe<ActivityInstance, StartActivityEventArgs>(OnActivityInstanceStart, EventPhases....


9

You would have to make CSS updates through a GUI extension besides using the new line (\n) in your exception message. In your event system exception, you will be using the new line like this: throw new Exception("Some text before new line.\nSome text after new line."); In the GUI extension, set the CSS white-space property to pre-wrap in the div element of ...


8

If the main purpose of this code is just delete keywords that are not used, you can just try to delete each keyword one by one. If the keyword is in use, the api just won't allow you to delete if the keyword is used for classify, is used in metadata, is localized, etc... You can capture the exception and continue with the next one. I recommend to do a ...


8

Open the Properties of the DLL on the server and click the Unblock button at the bottom of the dialog. That should fix the issue.


8

My guess would be that when you are creating a new page based on page type in XPM, XPM is actually cloning/copy and paste the type and then updating it with the appropriate values. Recommend subscribing to CopyEventArgs to confirm. Update Creating a new page in XPM using a Page Type should fire CopyEventArgs, however, copy operation is done on system, and ...


8

You see event viewer message that your extension was initialized, so no problem here. However, it might be the case that you (NETWORK SERVICE) don't have rights to write to event log, or your code is just wrong. I would suggest trying something simpler, like creating a file on the hard drive, or just throwing exception. This way you will at least know that ...


8

You could consider [[removed:OOTB]] Supported category use with the Tree View. The user would select from the top-down and the field populated with the final select. Of course, by supported I mean without having to provide a custom extension - to add them is a content job; you could initially do this as a manual process and then automate the creation/...


8

Another option is to temporarily elevate permissions of the current user in the event handler: using (ElevatedPrivilegesScope scope = new ElevatedPrivilegesScope(nonAdminSession, Privileges.SysAdmin)) { // Do your admin tasks } In this case, the component will be created on behalf of the current user (even if that user does not have privileges to do so ...


7

I see your point, there is an old PS implementation called Metadata Processor that performs the following logic. At publishing time there an special syntax written at the beginning of the template that writes the Output variable, that special syntax will instruct which design fields should be considered metadata. At deployment time a Deployer Processor (...


7

This issue is probably related with the MSDTC settings. Verify that Distribute Transaction Coordinator Service is running on the server Go to Administrative Tools > Services Turn on the "Distribute Transaction Coordinator" Service if it is not running If it is running then: Go to Administrative Tools > Component Services On the left navigation tree, go ...


7

It may help for us to know more about the operations that you need to perform when publishing. Here are a few guidelines though... A Deployer Extension only has access to items that are stored within the Transport Package. Therefore, if your operation needs to access content that is not stored within this (e.g. user information, version history, etc.) then ...


7

To get the user who published, you need to use PublishTransaction.Creator Here Creator returns the User Object. private void OnPagePublishPre(Page page, PublishEventArgs mPublishEventArgs, EventPhases phase) { List<PublishTransaction> mPublishTransactionList = mPublishEventArgs.PublishTransactions.ToList(); foreach (PublishTransaction ...


7

Here just for your reference I pasted a code to get the user and also Groupname if you publish any component. private void PublishingFinish(Component subject, PublishEventArgs e, EventPhases phase) { User user = subject.Session.User; foreach (GroupMembership group in user.GroupMemberships) { ...


7

Perhaps you can do this through a GUI extension - and thus better inform a user that a value was entered. I presume you're aware that fields can have 'default' values already - which may negate your code even running in many instances? The best way to approach this (event system, GUI extensions, user process/education) will likely depend on the specifics of ...


7

So you set the title after making sure your Component is checked out, but you tried to sync back the changes of the content before ensuring it is checked out: ... // sync content back to Component newComp.Content = content.ToXml(); ... // sync metadata back to Component newComp.Metadata = embeddedFields.ToXml(); ... if (!newComp.IsCheckedOut) { newComp....


7

Bart already pointed out the proper order to do this check-out/modify/check-in cycle after the copy operation is performed. Do note that this approach leads to a version 2 on the copy: version 1 is the unmodified copy and your post-processing creates a version 2. This may be exactly what you want, but note that it is also possible to modify the copy without ...


7

For 2011 and up I would actually say it is preferred to use multiple DLLs, specifically so you can isolate different features and have a better control over what events you want enabled or not. You see SDL doing it already by themselves, ECL for example comes with it own event DLL and so do a few other extensions. Personally I would separate the DLLs ...


7

You should be able to do this by subscribing to initiated phase of the copy event of a Keyword and removing the related Keywords. For example: EventSystem.Subscribe<Keyword, CopyEventArgs> (HandlerForKeywordCopyInitiated, EventPhases.Initiated); Cutting and pasting is really just a save event with a new parent item. But since you wish to keep the ...


7

Have you googled, you must have found following http://yatb.mitza.net/2012/03/debugging-tridion-2011-event-system.html


7

What you are requiring is mainly to use publish queue in a way its not meant to be used. For #1 you want to publish items before all others. That is the exact purpose of "high" priority. Problem is when editors abuse this priority so you have thousand of items in queue on high. Using event system to remove/resend transactions can be very time and resource ...


7

Use the StructureGroup constructor to get a new SG, something like this: StructureGroup newSg = new StructureGroup(session, parentSGTcmId); Here is a snippet from the API docs:


7

I would not try to impersonate an admin user from the event system. It opens up all kinds of vulnerabilities that you probably don't want. Instead, I would create a separate service (e.g. a REST service) that accesses the core service with an admin account, and call that service from the event system.


7

The difference is that on an ASYNC (SubscribeAsync) event, your code will run without blocking the main event from happening, while on SYNC events (Subscribe) the main event will wait for your code to run. If you're doing content validation in your event, and you need to block a save from happening by throwing an error that should be displayed to the editor,...


Only top voted, non community-wiki answers of a minimum length are eligible