cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
bhenderson256
Level 2

Update Server 4.5 Server Side plugin issues

Hello all,

I was hoping someone could help with some issues that I am encountering while attempting to write a server side plugin to provide business logic to determine whether the customer has a valid service agreement, and cater their updates based on that finding. I want one instance of my plugin to be called for all products that we support.

Issue #1: Filters

I can't seem to get the AllProductFilter to work. If I setup the filter for ProductID and specify the GUID, my sse plugin gets called. But, if I specify the AllProductFilter, my plugin doesn't get called.

I wrote a custom filter based of AbstractISUSExtensionFilter to provide some debug output. The constructor is called, but the accept method is never called.

Issue #2: Modifying/Removing updates

I am attempting to modify/remove updates during the requestProcessed event in the plugin. I have setup a product that has 2 updates and 1 message. I do a request for updates from another machine, the plugin is called, but the RequestProcessedEventContext says that there are no updates (getUpdatesSize() returns zero & getAllUpdates() always returns null).

Of course, I know that there are updates available! The machine that did the check for updates does receive the notification of 2 updates and 1 message.

So, here are my questions:

1) How do I get the plugin to be called for All products?
2) How do I get a list of the updates & messages that being sent back to the requestor?
3) How do I modify the URL for the message (to redirect to an ASP page) or get access to the html message to replace variable values in the message (%CUSTOMER_FIRST_NAME% = "John") ?

TIA,
Ben
0 Kudos
(1) Reply
RobCoon
Level 3

Hello Ben.

To make sure your plugin gets called for multiple products, you don't need to change any code to add filter classes. Instead, you need to update your plugin descriptor file to have the plugin loaded for more than just the one product. Unfortunatelly, we don't currently support an "ALL" filter, and the section of the portion of the descriptor file can only have one of each type. So, what you need to do is create a new section for each product you want to support. To use the same plugin, these sections can all be identical with the exception of specifying a different product ID in the appropriate .

You can get and modify the resulting messages through the RequestProcessedEventContext. You would create your own modifier class with the appropriate filter to make sure the changes get applied to the correct update. An example that changes the URL is below:

RequestProcessedEventContext context = (RequestProcessedEventContext) event.getEventContext();
HashSet updateModifiers = new HashSet();
// modify the download URL pointing to the mirror site for this
// update
ISUSUpdateModifier modifier = new StandardISUSUpdateModifier(ISUSUpdate.DOWNLOADURL,
"http://mirror.site.com/updates/update.exe");
updateModifiers.add(modifier);
context.modifyUpdates(updateModifiers);

Unfortunately, the methods providing easy access to the individual updates are not yet implemented. I hope to get these into the next release. However, currently the context can return a ISUSUpdatesObject that contains the raw xml representing the updates.

I apologize that the documentation on this topic is quite sparse. As I mentioned, I am hoping to implement some more usable functionality in the next release, and I would be interested in hearing about your experiences with the server side plugins. Please feel free to send me a private message, or post in this forum, any comments, criticisms, and suggestions you might have.
0 Kudos