Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Friday, November 22, 2024 
 
slxdeveloper.com Community Forums  
   
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
 Web Forums - SalesLogix Web Platform & Application Architect
Forum to discuss the use of the SalesLogix Web Platform, Client and Customer Portals, and the Application Architect (For version 7.2 and higher only). View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to SalesLogix Web Platform & Application Architect | New ThreadView:  Search:  
 Author  Thread: [7.5.4 Web] Possible to add custom deployment steps?
Tim Zech
Posts: 40
 
[7.5.4 Web] Possible to add custom deployment steps?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 12 Jan 18 8:47 AM

Is it possible to add a custom step to the deployment of the SlxClient portal? Like calling a batch file doing stuff after the deployment finished successfully?

[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: [7.5.4 Web] Possible to add custom deployment steps?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 12 Jan 18 11:44 AM

Yes. You'll need to create a custom deployment action provider and wire it up the the portal. I actually have an article on this topic that I believe is queued to publish in Feb. It will outline the complete steps, but for now, you can do the following: 



  1. Create a new Class Library project in VS, set the framework version to .NET 4.5.2

  2. Add a reference to Sage.Platform.WebPortal.Design.dll in C:\Program Files (x86)\Saleslogix\Platform

  3. Add a reference to Sage.Platform.Deployment.dll in C:\Program Files (x86)\Saleslogix\Platform

  4. Add a reference to Sage.Platform.Projects.dll in C:\Program Files (x86)\Saleslogix\Platform

  5. Add a reference to Sage.Platform.Application.dll in C:\Program Files (x86)\Saleslogix\Platform

  6. Add a new class to your project that implements the interface Sage.Platform.WebPortal.Design.IDeploymentActionProvider

  7. Implementing the interface in step #5 will give you an "AfterDeployment" that will be invoked after the deployment completes, you can add your custom code here to do whjat you're after

  8. For the GetDeployableItems method, you can just add "return new IShadowCopyItem[0];"

  9. Copy the assembly to C:\Program Files (x86)\Saleslogix\Platform

  10. Restart Application Architect

  11. In Application Architect, expand the Portal Manager and the select the portal you want to add this to, such as the SlxClient portal

  12. In the Properties grid with the SlxClient portal selected, you'll see a property for DeploymentActionTypes. Click that to bring up the editor

  13. Add your new assebmbly to the list

  14. Deploy and your code will execute


Hope this gets you started.


Ryan

[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: [7.5.4 Web] Possible to add custom deployment steps?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 12 Jan 18 1:04 PM

Here's a sample project you can look at that implements this. It also shows how to get the deployment folder, connection string to the saleslogix database, etc.


https://github.com/CustomerFX/SampleDeploymentAction


Ryan

[Reply][Quote]
Tim Zech
Posts: 40
 
Re: [7.5.4 Web] Possible to add custom deployment steps?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 15 Jan 18 7:17 AM

Thanks, Ryan. I'll give it a shot. I only wonder:


since SLX 7.5.4 runs on .Net Framework 3.5, shouldn't I set the framework version to .Net 3.5 in the first step?

Also, in the sample project, you added a reference to Sage.Platform, too (so this should be step 7, then?). And then there're objects of type "PortalBase" in the signature of your implementation of some of the interface's methods, when they should be of type "PortalApplication".


Edit: I replaced all "PortalBase" references with "PortalApplication" and added code to the method "AfterDeployment". When building the solution, I get the following error:



  • ... does not implement interface member '...AfterDeployment(PortalApplication, BackgroundWorker)' (you added "object deployment" to the signature?)


How can I resolve this issue?

[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: [7.5.4 Web] Possible to add custom deployment steps?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 15 Jan 18 10:31 AM

Sorry, yeah, for 7.5.4 you'll need .NET 3.5 (I coped those steps from my article that is referencing SLX 8.3). Also, the signatures are different in SLX 8.3 than 7.5.4. The correct way for this to look for 7.5.4 is as follows: 


 


using System;
using System.ComponentModel;
using System.DirectoryServices;
using Sage.Platform.Application;
using Sage.Platform.WebPortal.Design;

namespace FX.Deployment
{
public class SampleDeploymentAction : IDeploymentActionProvider
{
public bool RunOnBackgroundBuilds => true;

public void AfterDeployment(PortalApplication application, BackgroundWorker worker)
{
}

public void BeforeDeployment(PortalApplication application, BackgroundWorker worker)
{
}

public IShadowCopyItem[] GetDeployableItems(PortalApplication portal, BackgroundWorker worker)
{
return new IShadowCopyItem[0];
}

public void SetupDeployment(DirectoryEntry virtualDirectory, PortalApplication application, BackgroundWorker worker)
{
}
}
}

 


https://pastebin.com/cPVEpdws


Also, my sample does add a reference to Sage.Platform.dll, but (at least in 8.3) that's not a requirement of the deployment action provider, but is needed for the other code I added in the sample. 


Hope this helps.


Ryan

[Reply][Quote]
 Page 1 of 1 
  You can subscribe to receive a daily forum digest in your user profile. View the site code of conduct for posting guidelines.

   Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
 

 
 slxdeveloper.com is brought to you courtesy of Ryan Farley & Customer FX Corporation.
 This site, and all contents herein, are Copyright © 2024 Customer FX Corporation. The information and opinions expressed here are not endorsed by Sage Software.

code of conduct | Subscribe to the slxdeveloper.com Latest Article RSS feed
   
 
page cache (param): 11/22/2024 10:26:45 AM