Can i Use DD4T Framework on C# based Windows Service?

The name of the pictureThe name of the pictureThe name of the pictureClash 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.



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


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










share|improve this question



























    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.



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


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










    share|improve this question

























      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.



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


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










      share|improve this question















      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.



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


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






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 1 hour ago









      Velmurugan

      2,547717




      2,547717










      asked 1 hour ago









      Neelesh Raghuvanshi

      461210




      461210




















          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.






          share|improve this answer



























            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.






            share|improve this answer
















            • 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










            Your Answer








            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "485"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            convertImagesToLinks: false,
            noModals: false,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "",
            contentPolicyHtml: "",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













             

            draft saved


            draft discarded


















            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






























            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.






            share|improve this answer
























              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.






              share|improve this answer






















                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.






                share|improve this answer












                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.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered 55 mins ago









                Quirijn

                4,291830




                4,291830




















                    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.






                    share|improve this answer
















                    • 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














                    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.






                    share|improve this answer
















                    • 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












                    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.






                    share|improve this answer












                    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.







                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    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












                    • 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

















                     

                    draft saved


                    draft discarded















































                     


                    draft saved


                    draft discarded














                    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













































































                    Comments

                    Popular posts from this blog

                    What does second last employer means? [closed]

                    List of Gilmore Girls characters

                    Confectionery