joomla-projects / gsoc16_shareable-draft-content

Shareable Draft Content
https://summerofcode.withgoogle.com/projects/#5268339920207872
GNU General Public License v2.0
4 stars 2 forks source link

Share token generate- Separate branch #13

Open nikitadhiman opened 8 years ago

nikitadhiman commented 8 years ago

Pull Request is for creation of a share token and storing that token in the #__share_draft database.

Summary of Changes:

  1. A new button is created for 'share', this button would be visible only when article is saved and is placed next to version button.
  2. A function shareTokenGenerate() and shareDraft() are created in the controller, shareTokenGenerate() will generate a random token containing a-z,A-Z and 0-9 but no special characters.
  3. In model file, query has been made to store this token in the database.

Testing Instruction:

  1. Apply the patch, make sure that the #__share_draft db exists. Have used JTables for the same
  2. create a new article and save the article. 3.Once saved, hit share button, the values that should be stored the db are articleId, title of the article and newly generated random token.

Test 1 results:

  1. When the table exists: {"success":true,"message":"Token Saved","messages":null,"data":"IeOrhUISqtAm3PXV"}
  2. When table does not exists: {"success":false,"message":"Token not Saved","messages":null,"data":false}

Tasks: