Can i Use DD4T Framework on C# based Windows Service?
Clash Royale CLAN TAG#URR8PPP
up vote
2
down vote
favorite
We have a Windows Service running on CD Server, which is scheduled to run daily. This service basically does some Database interaction and send details in Email to registered Users.
Earlier Mail template was created in Tridion and published on the File System, this service they were using that template to send emails.(Template Path configured in Service Configuration file)
Now, as we have moved to DD4T, Mail template will be published as JSON in Broker, as we dint change windows service logic so our windows service is still needed that Template file available in CD Server. For temporary make it work we deployed Email Template file on CD Server. (So now Email template is no more coming from Tridion its a file which is already deployed in the server)
But, Now as we have time, we decided to fetch Email Template from Broker in my Windows Service. So that is should come to form Tridion only. I can see Two way to do this.
Add the Tridion Dll's to Windows Service, Create a class for mail template, make a broker query to retrieve Page Data as JSON then parse it to the newly created Email Class.
Add the DD4T DLL's, create a class for mail template, use DD4T Framework to Fetch JSON from Broker, and parse it to the newly created Email Class
My First Question is in both the approaches, somehow I have to create the view which will use this model, but I am not sure if this is really possible to use HTML with a model in Windows service.
The second Question is can I use DD4T on Windows Service (I believe I need a controller to initialize DD4T Objects like page factory and all), so is it possible to use DD4T Framework on Windows Service, or I should go with my first approach that is making a broker query?
If I can't make it a view in windows service then I am thinking to publish Html Template (With Html using DWT as it was earlier) to Broker then I can use this HTML in my Windows Service using above first or second approach.
web8 dd4t
add a comment |Â
up vote
2
down vote
favorite
We have a Windows Service running on CD Server, which is scheduled to run daily. This service basically does some Database interaction and send details in Email to registered Users.
Earlier Mail template was created in Tridion and published on the File System, this service they were using that template to send emails.(Template Path configured in Service Configuration file)
Now, as we have moved to DD4T, Mail template will be published as JSON in Broker, as we dint change windows service logic so our windows service is still needed that Template file available in CD Server. For temporary make it work we deployed Email Template file on CD Server. (So now Email template is no more coming from Tridion its a file which is already deployed in the server)
But, Now as we have time, we decided to fetch Email Template from Broker in my Windows Service. So that is should come to form Tridion only. I can see Two way to do this.
Add the Tridion Dll's to Windows Service, Create a class for mail template, make a broker query to retrieve Page Data as JSON then parse it to the newly created Email Class.
Add the DD4T DLL's, create a class for mail template, use DD4T Framework to Fetch JSON from Broker, and parse it to the newly created Email Class
My First Question is in both the approaches, somehow I have to create the view which will use this model, but I am not sure if this is really possible to use HTML with a model in Windows service.
The second Question is can I use DD4T on Windows Service (I believe I need a controller to initialize DD4T Objects like page factory and all), so is it possible to use DD4T Framework on Windows Service, or I should go with my first approach that is making a broker query?
If I can't make it a view in windows service then I am thinking to publish Html Template (With Html using DWT as it was earlier) to Broker then I can use this HTML in my Windows Service using above first or second approach.
web8 dd4t
add a comment |Â
up vote
2
down vote
favorite
up vote
2
down vote
favorite
We have a Windows Service running on CD Server, which is scheduled to run daily. This service basically does some Database interaction and send details in Email to registered Users.
Earlier Mail template was created in Tridion and published on the File System, this service they were using that template to send emails.(Template Path configured in Service Configuration file)
Now, as we have moved to DD4T, Mail template will be published as JSON in Broker, as we dint change windows service logic so our windows service is still needed that Template file available in CD Server. For temporary make it work we deployed Email Template file on CD Server. (So now Email template is no more coming from Tridion its a file which is already deployed in the server)
But, Now as we have time, we decided to fetch Email Template from Broker in my Windows Service. So that is should come to form Tridion only. I can see Two way to do this.
Add the Tridion Dll's to Windows Service, Create a class for mail template, make a broker query to retrieve Page Data as JSON then parse it to the newly created Email Class.
Add the DD4T DLL's, create a class for mail template, use DD4T Framework to Fetch JSON from Broker, and parse it to the newly created Email Class
My First Question is in both the approaches, somehow I have to create the view which will use this model, but I am not sure if this is really possible to use HTML with a model in Windows service.
The second Question is can I use DD4T on Windows Service (I believe I need a controller to initialize DD4T Objects like page factory and all), so is it possible to use DD4T Framework on Windows Service, or I should go with my first approach that is making a broker query?
If I can't make it a view in windows service then I am thinking to publish Html Template (With Html using DWT as it was earlier) to Broker then I can use this HTML in my Windows Service using above first or second approach.
web8 dd4t
We have a Windows Service running on CD Server, which is scheduled to run daily. This service basically does some Database interaction and send details in Email to registered Users.
Earlier Mail template was created in Tridion and published on the File System, this service they were using that template to send emails.(Template Path configured in Service Configuration file)
Now, as we have moved to DD4T, Mail template will be published as JSON in Broker, as we dint change windows service logic so our windows service is still needed that Template file available in CD Server. For temporary make it work we deployed Email Template file on CD Server. (So now Email template is no more coming from Tridion its a file which is already deployed in the server)
But, Now as we have time, we decided to fetch Email Template from Broker in my Windows Service. So that is should come to form Tridion only. I can see Two way to do this.
Add the Tridion Dll's to Windows Service, Create a class for mail template, make a broker query to retrieve Page Data as JSON then parse it to the newly created Email Class.
Add the DD4T DLL's, create a class for mail template, use DD4T Framework to Fetch JSON from Broker, and parse it to the newly created Email Class
My First Question is in both the approaches, somehow I have to create the view which will use this model, but I am not sure if this is really possible to use HTML with a model in Windows service.
The second Question is can I use DD4T on Windows Service (I believe I need a controller to initialize DD4T Objects like page factory and all), so is it possible to use DD4T Framework on Windows Service, or I should go with my first approach that is making a broker query?
If I can't make it a view in windows service then I am thinking to publish Html Template (With Html using DWT as it was earlier) to Broker then I can use this HTML in my Windows Service using above first or second approach.
web8 dd4t
web8 dd4t
edited 1 hour ago


Velmurugan
2,547717
2,547717
asked 1 hour ago
Neelesh Raghuvanshi
461210
461210
add a comment |Â
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
2
down vote
You can use DD4T for this, with two caveats:
- Don't reference DD4T.MVC4 or 5 (this won't work in a Windows service)
- Don't use Rich Text fields in your model (regular text and other types work)
This is because Rich Text fields must be modeled as MvcHtmlString, which brings in MVC.
add a comment |Â
up vote
1
down vote
My recommended approach go to option 1, It's simple to use SDL Web CIL, It's simple to create broker query API to get your Email Template and do your business logic with your existing windows service.
Reference to Quick start CIL
I hope it helps.
1
Just make sure NOT to copy the app settings from the PDF as you will get the wrong '-' characters, or if you do copy, make sure to replace the dashes afterwards. See tridion.stackexchange.com/questions/19040/…
– Atila Sos
43 mins ago
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
You can use DD4T for this, with two caveats:
- Don't reference DD4T.MVC4 or 5 (this won't work in a Windows service)
- Don't use Rich Text fields in your model (regular text and other types work)
This is because Rich Text fields must be modeled as MvcHtmlString, which brings in MVC.
add a comment |Â
up vote
2
down vote
You can use DD4T for this, with two caveats:
- Don't reference DD4T.MVC4 or 5 (this won't work in a Windows service)
- Don't use Rich Text fields in your model (regular text and other types work)
This is because Rich Text fields must be modeled as MvcHtmlString, which brings in MVC.
add a comment |Â
up vote
2
down vote
up vote
2
down vote
You can use DD4T for this, with two caveats:
- Don't reference DD4T.MVC4 or 5 (this won't work in a Windows service)
- Don't use Rich Text fields in your model (regular text and other types work)
This is because Rich Text fields must be modeled as MvcHtmlString, which brings in MVC.
You can use DD4T for this, with two caveats:
- Don't reference DD4T.MVC4 or 5 (this won't work in a Windows service)
- Don't use Rich Text fields in your model (regular text and other types work)
This is because Rich Text fields must be modeled as MvcHtmlString, which brings in MVC.
answered 55 mins ago
Quirijn
4,291830
4,291830
add a comment |Â
add a comment |Â
up vote
1
down vote
My recommended approach go to option 1, It's simple to use SDL Web CIL, It's simple to create broker query API to get your Email Template and do your business logic with your existing windows service.
Reference to Quick start CIL
I hope it helps.
1
Just make sure NOT to copy the app settings from the PDF as you will get the wrong '-' characters, or if you do copy, make sure to replace the dashes afterwards. See tridion.stackexchange.com/questions/19040/…
– Atila Sos
43 mins ago
add a comment |Â
up vote
1
down vote
My recommended approach go to option 1, It's simple to use SDL Web CIL, It's simple to create broker query API to get your Email Template and do your business logic with your existing windows service.
Reference to Quick start CIL
I hope it helps.
1
Just make sure NOT to copy the app settings from the PDF as you will get the wrong '-' characters, or if you do copy, make sure to replace the dashes afterwards. See tridion.stackexchange.com/questions/19040/…
– Atila Sos
43 mins ago
add a comment |Â
up vote
1
down vote
up vote
1
down vote
My recommended approach go to option 1, It's simple to use SDL Web CIL, It's simple to create broker query API to get your Email Template and do your business logic with your existing windows service.
Reference to Quick start CIL
I hope it helps.
My recommended approach go to option 1, It's simple to use SDL Web CIL, It's simple to create broker query API to get your Email Template and do your business logic with your existing windows service.
Reference to Quick start CIL
I hope it helps.
answered 1 hour ago


Velmurugan
2,547717
2,547717
1
Just make sure NOT to copy the app settings from the PDF as you will get the wrong '-' characters, or if you do copy, make sure to replace the dashes afterwards. See tridion.stackexchange.com/questions/19040/…
– Atila Sos
43 mins ago
add a comment |Â
1
Just make sure NOT to copy the app settings from the PDF as you will get the wrong '-' characters, or if you do copy, make sure to replace the dashes afterwards. See tridion.stackexchange.com/questions/19040/…
– Atila Sos
43 mins ago
1
1
Just make sure NOT to copy the app settings from the PDF as you will get the wrong '-' characters, or if you do copy, make sure to replace the dashes afterwards. See tridion.stackexchange.com/questions/19040/…
– Atila Sos
43 mins ago
Just make sure NOT to copy the app settings from the PDF as you will get the wrong '-' characters, or if you do copy, make sure to replace the dashes afterwards. See tridion.stackexchange.com/questions/19040/…
– Atila Sos
43 mins ago
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftridion.stackexchange.com%2fquestions%2f19445%2fcan-i-use-dd4t-framework-on-c-based-windows-service%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password