Saturday, 23 August 2014

Hosting AContent

I have hosted AContent at http://acontent.j.layershift.co.uk/home/index.php
and presently i have linked it to master branch of my github.

Now, whatever changes i will commit on github this will automatically reflect on the website.

Friday, 22 August 2014

Technical Documentation

Technical Documentation:

https://docs.google.com/document/d/1h4A1QpTYb3zq5OBPB5HMXjXP1NSgIuNk5PdEDgUDnUY/edit?usp=sharing

Looking forwards towards continuing to work on AContent !!!

Sunday, 17 August 2014

Debugging

06/08/2014

The major implementation work was finished today. From today onwards I'll start testing the implemented functionalities and remove the existing bugs.

The major issues that I have seen is in the Admin and the Author permissions. Since the admin has sudo permissions to do anything, therefore, it is important to see that the admin is given those permissions.

Difference Engine

04/08/2014


The Difference Engine was imported from DokuWiki and the differences between any two versions can be seen successfully.

There are four types of views possible in difference engine.

Inline view (HTML):-


Tabular view (HTML):-


Inline View (TEXT):-





Tabular View (TEXT):-


These are the four possible views in Difference Engine.

Thursday, 31 July 2014

Versioning

In order to implement versioning the best method would be to implement it again, as it would be quiet difficult to import whole DokuWiki into AContent as a single module. Even simulating DokuWiki externally from AContent was not an easy task and involved a large number of complications.

Therefore, I have decided to implement versioning from scratch and later use the difference engine in DokuWiki for showing the differences or changes in various documents.


02/08/2014

I was able to implement versioning from scratch and used similar functions used by Dokuwiki for maintaining versions of various content pages in AContent.

I have created two folders in the content directory of AContent :- attic and meta

The attic folder contains the older revisions of the document and the document is compressed as a tar file to save space.

The meta folder contains the user information corresponding to each content, such as who created the document, who reverted the document and what the lastest version of the document is.

Sample data of meta file for random content id:-

version_id       user_id   action revision_id
1408297143 2      A
1408297167 2      E
1408297170 2      E
1408297173 2      E
1408297184 2      R   1408297170

"A" tells the revision number and user who first created the document.
"E" tells the new version of the document and the user_id who created it.
"R" tells whether the version was reverted from an older revision and if it is reverted then the revision id from which it was reverted is displayed to the user.


From tomorrow onwards I'll start with the Difference Engine.


Sunday, 20 July 2014

Locking Implementation Refined Ideas

A new database containing the following information would be created in the database:-

(Content_id, User_id, Last login/edit time)

In this the content_id would be the primary key, hence only one entry for each content_id would be possible and necessary. Whenever, a shared content is edited, it's corresponding entry would be added in the database.

1. Suppose User “A” wants to edit a page “p1”, and currently no one hold the lock on “p1”  i.e., there is no entry in the database for page “p1”, then “A” gets the lock for “p1” and a row is inserted in database for “A”.

2. Now if “A” remains inactive for 14 min, then a notification pop up is shown to “A”, warning him that his lock would expire in a minute if he remains inactive and could be given to any other user requesting the lock.

3. If another user “B” asks for lock held by “A”, then we check:-
If (Present_time – Last_edited_time(from DB) by A > 15 min), then{
“B” is given the lock of “p1” and database is updated. Now if “A” tries to edit after he has lost his lock then he would not be able to do so and would be notified that some other user has the lock now and he should request for lock again.
}
else {
“B” would wait for the session of “A” to end.
}

4. If “A” completes the editing and clicks on save button then the row from database corresponding to “A” and “p1” is removed. This is important so that any other user could get the lock even before 15 minutes.

5. If two or more users are waiting for lock held by “A”, then the user who would refresh first or send the request for the lock first after expiration of time would receive the lock. In this way no priority is given to user who comes first and demands for the lock, but is given to the user who demands for the lock once the lock is released.

Tab Positioning in Shared Content

There are two different types of tabs for Shared Content made:-

1. Shared Content With Me :- This tab is available along with Home, Profile and Manage User Groups Tab. This is basically to view the pages which are shared by various other authors with the author currently logged in. This position for tab is selected because it is a general tab and has no link to any course authored by the currently logged in user.

2. Shared Content :- This tab is available when the user clicks on a particular course/lesson, along with various other tabs like Manage Tests. This tab is to share the contents of some particular course. In this tab the whole structure of the course is visible for easy sharing of contents with users. It further has two sub-tabs a) first give editing right to other users b) second to revoke editing rights from users.

The author can also share the hidden content with other users. In this case, a warning will be shown to the user that the content was hidden content and he is trying to share hidden content. In this way two authors can collaboratively edit the content and when the content gains structure it can be made visible to the other users.

The author can also share the content with any type of user (author/non-author/enabled/disabled). Hence the editing rights can also be extended to non-authors.

The Non-authors can then view the shared content with them, but to be able to edit the shared content they need to convert themselves to authors by going to their profile and making the required changes.
This ensures the current work flow that only authors can edit the content and hence make the things possible easily.

Thursday, 10 July 2014

Change in Create User Group GUI

Works:
1. Moved the tab to create user group with home and profile.
2. Showing only email, first name and last name to the author.
3. Explored how Locking can be implemented.

Working on :
1. Edit a present group to share content.
2. Improvements in the Share Contents.

Thursday, 26 June 2014

Shared Content - Slight Change of Plans

So, initially it was intended to have a single table called "shared_content" to store information regarding the shared content, which would have the following fields:-

(content_id, user_id), both of which form the primary keys.

In the current implementation, when a particular content is shared with a group, we populate the database with all the users, who are in that group. But this would make the modification to any particular group difficult, as in that case corresponding changes to the "shared_content" table would also be needed.

So I think rather than populating the "shared_content" table with multiple rows, when content is shared with a group, it would be better to make another table "shared_content_group", with the following structure:-
(content_id, group_name), both of which form the primary keys.

In this way the group can be modified by the user. In case a group is deleted by the user, then we need to make sure that the corresponding entry is also removed from the "shared_content_group" table, otherwise if the user makes the group with the same name he deleted then this would result in problems, due to wrong entries in the database.

Now we have two scenarios:-

1. Find the users, with whom the author shared his content :- This is needed for making the UI of content shared by the author. I plan to do this by first querying the "shared_content" table, which would give the list of users, with whom the content is shared, then query the "shared_content_group" table and find the groups with which the content is shared. Finally, use this information to extract the users from the "group_users" table and make the complete list of users with whom the data is shared.

2. Find the content shared with any register user :- Getting this information from the "shared_content" table is easy, but getting it from the "shared_content_group" is a bit difficult. For this we need to first extract all the groups of which the user is a part of. Then find the content_id's (if any) associated with these groups from the "shared_content_group" table.

I think this would do the trick, I'll try to come up with the implementation of this in the next few days.

Wednesday, 25 June 2014

Details of Adding Shared Pages in AContent


This feature would allow an author to give editing permissions to the registered members, thus giving the fellow authors and non-authors the right to edit his content.

In order to add this feature a new tab to display and manage the Shared Pages is created and a new table called "shared_content" is created, which contains the information regarding what content is shared with a registered member.

This table contains two columns currently.

content_id user_id

Both of which forms the primary key.

Using this information we can find the content shared with any particular user and give him the editing rights.

There is a possibility that we might have to add another column to this table which tells the type of the content :- "page", "folder" or "web-link", in order to add support of sharing all the data recursively under a particular folder or to enable the sharing of entire course.

Currently the work of displaying the content shared with the user in the side menu is under progress. There is also need to modify the current display of content under the shared menu tab. I am working to find the right javascript library which can help in giving a better and more intuitive display.

Tuesday, 24 June 2014

Details of Create User Group - Error Handling


On testing the system on the before described database table structure, I found that the system crashed when duplicate entries were added to the database, as the database would throw an error when duplicate entries would be added to the "group_users" table and the DAO library would thus call the die function, due to error in executing the database query.

For eg.

If groupname1 has already been created by author-1 and user-2 is in this group, then again groupname1 with user-2, should not be created by the same author-1 on pressing the Create Group button.

This step was giving errors due to duplicate entries being entered to the database.

So in order to resolve the issue, the database is now first queried if the row is already present in the database and if the row is already there, and if the entry is missing in that case it's added to the database.

Details of Create User Group -Problem-1(resolved)

There are two ways to do things:
1. If author1 ( say auth_1) creates a group (say gp_1) then it should be visible all the other authors as well. This is easy to implement but this way we do not ensure that every author must have his own preferences and thus auth_1 must have his own gp_1 and auth_2 must have his own gp_1

2. If author1 ( say auth_1) creates a group (say gp_1) then it should be visible to him only. If this is the case then auth_2 will also be able to create a group named gp_1 because for him user groups are different.

So to accommodate this the older suggested database(in proposal) could not work and had to be changed from :

1. group (group_id , group_name ,author_id)
2. group_users (group_id, user_id)
This will not work because here now if auth_1 submits the same form 2 times then 2 group_id's are generated and so we thought lets make group_name a primary key instead of group_id
1. group (group_name ,author_id)
2. group_users (group_id, user_id)
But now 2 authors cannot have the same group name for them as described above the group users list should be different for different authors.

So, finally to handle both the above issue, the following table is used

group_users(group_name, group_creator, user_id) PRIMARY KEY (`group_name`, `group_creator`, `user_id`)

This would handle both the above problems, different authors can have the same group name and single author cannot have two groups with the same name.



Monday, 9 June 2014

User Group

I have created a new tab to add user groups for all the authors. Now any author will be able to create a user group so that he could share permissions with a user or a group of users.
On start-up the database schema for the user group will be added. 

Tuesday, 20 May 2014

Create User Groups and Share Pages

Presently i am working to link the new database having group details with the code.

Thursday, 1 May 2014

Understanding the architecture and code of AContent.

By next week I will update the summary of the code/architecture i have gone through and what changes i need to make to accommodate collaborative editing. 

Wednesday, 19 March 2014

Introduction

The aim of the blog is to track the progress of the AContent project "Collaborative Editing for AContent" selected for GSOC 2014.