GSoC: Creating a draft content in Joomla
I am back with the next article of GSoC 2016 project. Previously I wrote about the central idea Shareable Draft Content, so much to be coded but not so much time to finish it! The previous article explained the scope of the project, the steps of implementation and the advantages of this enhancement feature. In my second article the progress so far on this project, all the yay-nay moments over the past weeks of the coding is shared!
I started coding after 4th June due to final exams. The first PR was for share button. The phase 1 was about adding the share button at the required places. The required condition here was that the article needs to be saved before it can be shared. Hence, initially I started working on enabling/disabling the button based on the condition if the article is saved or not. Then a much easier way was found out with help of mentors that the button would be visible only when the article is saved. Hence the button is visible once the articleId is generated.
The button is placed next to version button. JToolbarHelper::custom method helped me do that!
The next was to create the Database schema for the project. After the previous PR (3 days to be precise) the next PR containing the db updates with the new table #__shared_draft was done. The update was for mysql, postgresql and azure. The fields in the table were id (pk), articleId, title, created, modified and sharetoken.
Yay moment: The first mini step was completed.
Nay moment: The coding started late.
It was decided with mentors to have a weekly meeting on friday so as that easier evaluation and updating can be done.
These meetings helped me a lot from discussing about time management to learning about how to create finer code. The learning curve was exponential. I came to know about the best coding practices with great help from my mentors.
This was the time to implement the backbone of the project, the share token. The generation of share token and its usage was discussed, the same at first hardcoding the logic for creation of token. Roland advised me to use genRandomPassword(), JTables, exception handling and Rishi helped me with understanding the usage of JTables in this process instead of inserting the values directly in the table. The help from mentors is immense at every moment.
This consumed good amount of time as I have quite basic knowledge of JS and JQ. Thus error solving, writing code according to coding standards, weekly meets were helpful in this process.
Yay moment: Passing mid term evaluation! Greatly thankful to my mentors who showed immense faith on me after delays in the project.
Nay moments: Dealing with time loss.
This phase is about the draft manager, the initial step was to add an option in submenu of articles page for ‘Shared Articles’.
The initial outline for the view of draft manager have been prepared and the PR is currently in progress. This would contain all the articles that are shared and the share links for the same
Things to be done:
Adding filters for shared article
Phase 4 as mentioned in previous article.
I thank my mentors Rishi and Roland for answering my queries whenever I have doubts. GSoC team for encouraging me and giving the necessary push. I also thank Yves Hoppe for all his help and his encouraging words and to entire Joomla! Community where one can approach anyone at any time. I am happy to say that I don’t have just 2 mentors but many more in community.
Wait for my next article to check how this project ends... Will I complete it in time? You will know it in the next JCM Edition. :)
By accepting you will be accessing a service provided by a third-party external to https://magazine.joomla.org/