8 Replies Latest reply on Jun 6, 2013 12:29 AM by CQdev416

    Creating Node data on Author server from outside source?

    CQdev416 Level 1

      I was wondering if it is possible to create node data on the author server from an outside source such as the publish server, without using reverse replication?

       

      IE,

       

      User accessing form page on publish server, enters data, submits the form. Which somehow would create node data directly on the author server without storing any data on the publish server.

      Is this even possible?

       

      Thanks

        • 1. Re: Creating Node data on Author server from outside source?
          orotas Level 4

          In theory it is certianly possible. It opens security holes that may be of concern depending on your internal standards and policies. The issues you'd have to deal with are:

          • Network security - often author instances are on an internal network which would require you to move your author instance into the DMZ or open up your firewalls to allow the posts through from the public.
          • You'd have to open up an unsecured servlet or path on your author server to allow the post. 

           

          An alternative that would reduce security concers have your publish instance function as a proxy and have a servlet on the publish instance that does validation and forwards the post back to author, including some sort of authentication. There are still security concerns here, however the risks are reduced.

           

          Another alternative to a proxy servlet would be a workflow option where you created a temporary node in publish, trigger a workflow and have the workflow replicate the node and then delete it.

          • 2. Re: Creating Node data on Author server from outside source?
            CQdev416 Level 1

            Thank you for your answer.

             

            >>An alternative that would reduce security concers have your publish instance function as a proxy and have a servlet on the publish instance that does validation and forwards the post back to author, including some sort of authentication. There are still security concerns here, however the risks are reduced.

             

            Does this mean creating two custom OSGI servlets, one running on the Publish server, and the other running on the Author server? I would have to write some kind of code to connect the two servlets and send the post data to the servlet running on the Author server, correct? Is there a standard way of doing this?

             

            Thanks

            • 3. Re: Creating Node data on Author server from outside source?
              orotas Level 4

              Whether or not you need to write two servlets or not depends on what data you are creating and whether or not you can do it using a standard Sling POST. Unless you are doing something unusually I would think you could get away with not having to write a servlet that resided on author, and instead focus on creating a servlet or sevlet plus a service that handled validating the post and then tranforming it into a standard Sling POST back to the author server. Unless you are doing something really unusually you shouldn't have to write any code on your author server.

              • 4. Re: Creating Node data on Author server from outside source?
                CQdev416 Level 1

                Ah I see. I only need to send simple post data to the Author, so the standard POST should work fine. So I just need to write a servlet to send the post to the Author server but in this case how do I send the authentication to the Author server so that the post goes through?

                • 5. Re: Creating Node data on Author server from outside source?
                  Yogesh Upadhyay Level 4

                  Your node creation should be controlled by author server. So you will write a servlet in author server that will get information of node as a post from outside. Then that servlet will use internal session to write data to repository. Hope it make sense ?

                   

                  In short,

                   

                  External application will post to servlet in author -> author servlet will read post data and create node.

                   

                  Yogesh

                  • 6. Re: Creating Node data on Author server from outside source?
                    Ove Lindström Level 4

                    Why invent the wheel again??

                     

                    I understand how you think about the requirement. "When the user creates x in publish, we should create x in author". But imho, that is the wrong way of thinking. I would think like "When something under path /x/y/z is created in the publish repository, synk it with the author repository". Then what will happens when the nodes get synked, that is another question. I would then use the created nodes as an "inbox" and process it.

                     

                    The upside to this is that you do not need to code for the case where someone posts to the publisher but the author is down for maintenace. Using the reverse replication, you will use a publish-subscriber, or producer-consumer pattern and that will make your life a lot easier. At least codevise.

                     

                    /Ove

                    • 7. Re: Creating Node data on Author server from outside source?
                      Yogesh Upadhyay Level 4

                      Ove,

                       

                      I guess requirement here is to create node from outside source (which can be any application) directly in author. Publish instance might not be involve here. That's why reverse replication will not work.

                       

                      However if you want to create node through publish instance then reverse replication is right approach.

                       

                      Yogesh

                      • 8. Re: Creating Node data on Author server from outside source?
                        CQdev416 Level 1

                        Thank you for all the responses.

                         

                        Yes I do agree that not using reverse replication as the system is designed is not exactly a wise design choice. The problem I am facing is that the end user generated content is security sensitive and cannot be store on the publish instance. (Even temporarily)

                         

                        I have managed to write a servlet on the Author server to accept the post data and create node data on the Author repository.

                        However to do this, I have had to disable login/security on the Author server for the servlet path (IE /bin/posthandlerservlet ) so that the author servlet can be accessed from the outside. Firewall has also been adjusted to let traffic through as well.

                         

                        Now my remaining question would be, is opening up this path to the Author server much more dangerous and less secure that creating the node data on the Publish server in a place that protected access? We are really worried that the node created data on the publish server could somehow be accessed by end users in the event of a security problem.