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.


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

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

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

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

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


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

The problem is that you are setting Bundle schema as BundleType schema. Read this to understand it better. Basically you need to determine your "true" bundle type schema and set bundle schema you are setting as MetadataSchema


7

In case of publishing Events, I noticed that some areas are hosted by the TcmPublisher.exe process and other ones by the TcmServiceHost.exe process. I would attach both processes to be sure my code will stop in the break point. Also make sure your local dll/pdb and deployed dll/pdb files are for the same code version.


7

How about creating a report which displays a table listing all items and where they're published. You can add various sorting or filter options to it. One quick way is to knock up a page template and a page that editors will publish to Preview/Staging. You can add a TBB to this template allowing to only be published to Staging/Preview. The nice thing here ...


7

I think this is what happens: You are using the Core Service through the Net TCP binding so the Core Service call is handled by the Tridion Content Manager Service Host process. Also the publish event is executed by this process. The Tridion Content Manager Service Host is running as the Network Service user and this user has no access to the textfile. When ...


7

Judging by the tags you used, it looks like you already thought about using a custom resolver for this. Have you actually tried using one? I would normally handle this with a custom resolver, but the event system approach should have worked anyway, maybe there's something else going on there. There's plenty of examples on custom resolvers out there.


7

The thing to watch out for here is that your Sitemap could end up getting published very frequently, and occupying all your publishing threads. Perhaps it's not the case you want it submitting to the publishing queue every time a page is published? This could cause it to be in the queue multiple times. This Stack Overflow post explains the problem well, ...


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