Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Create a Web MVC project in your solution

  2. Delete all useless files/folders until you have only one Views folder.

  3. Add a reference to all the .dll and .exe files that are in the zip above

  4. Copy over to your bin/debug or bin/release all the files in the zip above, it contains the executable that will deploy the html templates (a good idea would be to copy these files as a pre-build event)

  5. Add a cshtml file under Views folder OR html file under Html folder (for IPMC only that support rest API). IMPORTANT! The file name will be your template name.

  6. Add using @using Absolunet.InRiver.HtmlTemplate.Core.Helpers in the file header. With that, you'll be able to use intellisense with TemplateHelper static class.

  7. Obviously, your HTML tag should look like: <html inriver-razor-template="true">

Deploy your HTML Template

...

The program Absolunet.InRiver.HtmlTemplate.Core.exe take named parameters that supports connection with Remoting Api Key or with username and password.

...

Code Block
Absolunet.InRiver.HtmlTemplate.Core.exe --RemotingApiUrl apiUrl --RemotingUsername userName --RemotingPassword password --RemotingEnvironment environment [--HtmlTemplatesToUpdate htmlToUpdate]

HtmlTemplatesToUpdate is an optional parameter. If provided, the application will update only the HTML templates provided. The name of the HTML Template must the name in the PIM and they must be separated by a  comma. For example, if you have Views TestTemplate1.cshtmlTestTemplate2.cshtmlTestTemplate3.cshtml and you want to update the first two, your parameter will be "TestTemplate1,TestTemplate2". Finally, if the parameter is not provided, the application will update all HTML templates. 

Deploy automatically your HTML Template to iPMC after each build (For nuget version under 7.9.0)

1- In your project post build events (Right click on the project in solution explorer --> Properties --> Build Events --> Post-Build event command line), add a line that should look like this:

Post build event
Code Block
languagepowershell
$(TargetDir)Absolunet.InRiver.HtmlTemplate.Core.exe REMOTING_URL USERNAME PASSWORD ENV HTML_TEMPLATES_TO_UPDATE

2- Obviously, you must use your credentials. Replace REMOTING_URL USERNAME PASSWORD ENV with your credentials. 

Warning

Escape special characters

If your password contains a "%", it must be escaped with "%%".

3- HTML_TEMPLATES_TO_UPDATE is an optional parameter. If provided, the application will update only the HTML templates provided. The name of the HTML Template must the name in the PIM and they must be separated by a  comma. For example, if you have Views TestTemplate1.cshtmlTestTemplate2.cshtmlTestTemplate3.cshtml and you want to update the first two, your parameter will be "TestTemplate1,TestTemplate2". Finally, if the parameter is not provided, the application will update all HTML templates. So with that, at each build, your project will get all cshtml files under Views folder and will try to create or update your HTML Templates. As mentioned above, the file name will be the HTML Template name. In case of a new HTML Template, you must set manually the display name, entity types, roles & language. But the content will be there.