14

Be careful here - you are seriously changing the default behaviour of Tridion - the ability to republish all pages where a component is used by publishing the component is very useful for editors who may not know where a component is used, but want to make sure that it is up to date all over their website. Why is it that you do not want the pages to be ...


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.


13

This is a great example of the evil that is the "As" cast If you wrote your code like this: var configuration = (NameValueCollection)ConfigurationManager.GetSection("custom.events"); Instead of a Null Reference exception, you'd get an Invalid Cast Exception when GetSection returns a ConfigurationSection. Of course, you should still implement a null ...


12

The Event System is one of two official places where you can (and should) use TOM.NET in Tridion 2011 / 2013 (the other place being C# Templating). So you should not use Core Services here as they are intended for external applications only (such as the Console application you wrote).


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

How do you connect to the core service? Are you using a netTCP binding or a wsHttp/basicHttp binding? In case of the former the app.config file would be TcmServiceHost.exe.config and for the latter it would be web.config in %TRIDION_HOME%\webservices...


11

In the UnPublishEventArgs there is a member UnPublishInstruction. This will have a property - StartAt - If StartAt property is set to DateTime.MinValue that means the Unpublishing is scheduled for Immediate unpublish and if it is set to a particular datetime, that means it is schedule to unpublish at some other time.


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

From the title of your question "Event System Alternatives (Memory Leakage)", it appears that you may be looking for alternatives to using the Event System due to a memory leak that you have in some existing code. If this is the case, then I would strongly recommend that you fix the source of the memory leak problem, rather than finding workarounds. That ...


10

You can do that (alert) without a GUI extension, simply by using Event System (OnComponentSavePre event). The GUI extension framework is very different in 2011 and 2013, I would not recommend doing a real extension for 2009, as you would have to rebuild it once you upgrade. Creating a Tridion 2009 Event System is not as simple as 2011 or 2013, but ...


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 your custom resolver is not working - you can check which items are going to be published by clicking the See Items to Publish button on the bottom left of the publish popup - if your resolver is working this will only show the one component. If you want to debug your resolver, then attach to the publisher process (TcmPublisher.exe - I think) ...


9

To add to Nuno's answer, indeed using the COM based event system through .NET has a lot of potential (memory related) issues if not done correctly. I always use the following code examples to explain what needs to be done: using System; using Tridion.ContentManager.Interop.TDS; using Tridion.ContentManager.Interop.TDSDefines; namespace Tridion.Training....


9

you might want to take a look at Dominic's post here : http://www.dominic.cronin.nl/weblog/tridion-explorer-reports-system.servicemodel.serviceactivationexception and try the web.config settings he describes as a test?


9

Page.Metadata is an XmlElement, you cannot access it 'page.Metadata["categorisation"]'. You will have to set the entire metadata of the Page. page.Metadata = metadata.ToXml();


9

Something along these lines (untested code) Itemfields meta = new ItemFields(page.Metadata, page.MetadataSchema); SingleLineTextField categorisationField = (SingleLineTextField)meta["categorisation"]; categorisationField.Value = "Some value"; page.Metadata = meta.ToXml();


9

Since way back I have been working with a batch file (which calls a script for COM+ shutdown) called from a post build event in Visual Studio to deploy to my development environment (note this only really works if run on the server itself - but I typically develop event system code on the server, in order to debug it). As it works fine, I never made an ...


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 all you want is to modify component metadata on save (as you mention in a comment) then using the CoreService is complete overkill. Set your event to run on Component,Save,Initiated EventSystem.Subscribe<Component,SaveEventArgs>(MyEventHandler, EventPhases.Initiated); Then do something along these lines: ItemFields metadata = new ItemFields(...


8

I think the least disruptive way would be to: Store the "scheduled publish date/time" in the Item's AppData - use Event System, make sure to use an asynchronous event handler CME/XPM extension that checks current date/time against this value in AppData, and if applicable shows a message in the UI stating that "this item is scheduled to publish in 10 seconds,...


8

The answer to your question is no, referenced 3rd party assemblies do not need to be registered in the GAC. .NET does look in the GAC first for the assembly, but if it doesn't find it it proceeds to check private paths such as the same folder as the parent assembly and bin folders. Have a look at the answer provided here: https://stackoverflow.com/...


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

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

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

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/...


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