[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [ecf-dev] [Salvo] Function to fetch articles that "this user" has created or that "this user" has replied to



On 14 June 2011 11:56, Isuru Udana <isudana@xxxxxxxxx> wrote:


On Tue, Jun 14, 2011 at 11:47 AM, Harshana Eranga Martin <harshana05@xxxxxxxxx> wrote:


On 14 June 2011 11:41, Isuru Udana <isudana@xxxxxxxxx> wrote:


On Tue, Jun 14, 2011 at 11:19 AM, Harshana Eranga Martin <harshana05@xxxxxxxxx> wrote:
Hi Isuru,

On 14 June 2011 00:00, Isuru Udana <isudana@xxxxxxxxx> wrote:
Hi Harshana,

To Implement the function getThisUserArticles(), initially I planned to store extra information for a article or store 'this user' articles in a special location in the store.

I saw that this can be implemented without storing extra information, but executing several queries on existing database.
So I have implemented it in that way.
Is it the right way to go? WDYT?

What are these extra information you are trying to store? Are they already exist in the database and you are just trying to store them in a single table? or these information are entirely new information?

I was thinking of storing the 'senders name' with the article or storing the articles of 'this user' in a special location so that we can fetch them easily.

Sender name is already available in other table?

Yes. that can be fetch from the article header table by executing several queries. That is how I did the implementation.Â

So it seems that we are trying to store some redundant data. Hence I'm -1 for for storing this redundant data in a separate table. Therefore +1 for the current approach.

Thanks and Regards,
Harshana



Thanks and Regards,
Harshana


On Mon, Jun 13, 2011 at 11:38 PM, Isuru Udana <isudana@xxxxxxxxx> wrote:


On Mon, Jun 13, 2011 at 11:29 PM, Harshana Eranga Martin <harshana05@xxxxxxxxx> wrote:
Hi Isuru,

On 13 June 2011 23:04, Isuru Udana <isudana@xxxxxxxxx> wrote:
Hi,

I have implemented a function to fetch articles of 'this user'.
It isÂgetThisUserArticles(INewsgroup newsgroup) located on ServerStoreFacade.

To implement this function, I have define a new method in IStore.Â
getArticlesByUserId(INewsgroup newsgroup, String userId)

Currently, This function is implemented only in derby Store.
In derby store, ArticleDAOÂis responsible for doing the operations related to Articles.

I have implemeted two methods inÂArticleDAO.
1. getArticleIdsFromUser(String userId) -ÂGet articleIds of a particular user
2.ÂgetArticleById(INewsgroup newsgroup, int id) -ÂGet a article from the articleId

The first method extract the articleIds belongs to a particular user. To do that I have used the articleheader table.
The second method can be used to extract the articles from the articleId.Â
Â
Using these two methodsÂgetArticlesByUserId(INewsgroup newsgroup, String userId) method fetches articles belongs to a particular user.

So using the derby store we can fetch articles of 'this user' without going through all the articles stored in the Store.

But I am not sure how we can do this by using File System Store since we are serializing the article objects to files. So we cannot extract 'this user' articles without fetching all the articles. We may have to store 'this user' articles in a special location when saving articles to store.

I think we can Âsolve it by appending a special tag (for e.g: userId) to file name of the file that are representing the articles. Then we take out the whole file list and and then it's just gonna be a string manipulation to search the articles from there. WDYT?

Yes. That can be done.
Â
Thanks and Regards,
Harshana



On Sun, Jun 12, 2011 at 1:11 AM, Isuru Udana <isudana@xxxxxxxxx> wrote:
Hi Wim, Harshana,

I am working on implementing the $subject.

I investigate the nntp protocol to check whether there exists something to query the server for all this users articles. There is no command for query it.

For fetching "this user articles" from store we can fetch all the articles from Store and filter out the articles using isMine method. But that is not good way to do that since we have to go through every article one by one.

So I am planing of storing extra information when storing articles in the store, so that we can query easily. We have two options.

1) Storing the "this user articles" in a special locationÂ
When we are fetching articles form the server and storing them in the store, we can check whether it is a "this user article". If so we can store it in a special location.

2) Store "userId" as a parameter of Article
I thought this method thinking of using derby store.

We can store the userId as a parameter of a Article. So we can easily fetch "this user articles" from a SQL statement.
I am not sure how we can do this with File System Store. I think File System Store is not suitable for this kind of advanced dataÂretrievals.

Please express your view on this.
--
Regards,
Isuru Udana

Undergraduate
Department of Computer Science & Engineering,
University of Moratuwa
.

Blog
: http://mytecheye.blogspot.com/
gTalk: isudana skype: isudana








--
Regards,
Isuru Udana

Undergraduate
Department of Computer Science & Engineering,
University of Moratuwa
.

Blog
: http://mytecheye.blogspot.com/
gTalk: isudana skype: isudana








--
Thanks and Regards,
Harshana Martin
--
Harshana Eranga Martin
Software Engineer,
WSO2 Inc.
ÂÂ Â Â Â ÂÂhttp://wso2.org





--
Regards,
Isuru Udana

Undergraduate
Department of Computer Science & Engineering,
University of Moratuwa
.

Blog
: http://mytecheye.blogspot.com/
gTalk: isudana skype: isudana








--
Regards,
Isuru Udana

Undergraduate
Department of Computer Science & Engineering,
University of Moratuwa
.

Blog
: http://mytecheye.blogspot.com/
gTalk: isudana skype: isudana








--
Thanks and Regards,
Harshana Martin
--
Harshana Eranga Martin
Software Engineer,
WSO2 Inc.
ÂÂ Â Â Â ÂÂhttp://wso2.org





--
Regards,
Isuru Udana

Undergraduate
Department of Computer Science & Engineering,
University of Moratuwa
.

Blog
: http://mytecheye.blogspot.com/
gTalk: isudana skype: isudana








--
Thanks and Regards,
Harshana Martin
--
Harshana Eranga Martin
Software Engineer,
WSO2 Inc.
ÂÂ Â Â Â ÂÂhttp://wso2.org





--
Regards,
Isuru Udana

Undergraduate
Department of Computer Science & Engineering,
University of Moratuwa
.

Blog
: http://mytecheye.blogspot.com/
gTalk: isudana skype: isudana








--
Thanks and Regards,
Harshana Martin
--
Harshana Eranga Martin
Software Engineer,
WSO2 Inc.
Web: http://wso2.comÂ
ÂÂ Â Â Â ÂÂhttp://wso2.org

ECF Committer: http://www.eclipse.org/ecf/
Blog: http://harshana05.blogspot.com
Profile: https://www.google.com/profiles/harshana05