Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
update doclist rpc to allow filters
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmason committed Dec 6, 2011
1 parent 44c9217 commit 456b012
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 5 deletions.
Expand Up @@ -54,10 +54,13 @@ public GetDocumentListResult execute(GetDocumentList action, ExecutionContext co
Collection<HDocument> hDocs = hProjectIteration.getDocuments().values();
for (HDocument hDoc : hDocs)
{
DocumentId docId = new DocumentId(hDoc.getId());
TranslationStats stats = documentDAO.getStatistics(hDoc.getId(), localeId);
DocumentInfo doc = new DocumentInfo(docId, hDoc.getName(), hDoc.getPath(), stats);
docs.add(doc);
if (action.getFilters() == null || action.getFilters().contains(hDoc.getPath() + hDoc.getName()))
{
DocumentId docId = new DocumentId(hDoc.getId());
TranslationStats stats = documentDAO.getStatistics(hDoc.getId(), localeId);
DocumentInfo doc = new DocumentInfo(docId, hDoc.getName(), hDoc.getPath(), stats);
docs.add(doc);
}
}
return new GetDocumentListResult(iterationId, docs);
}
Expand Down
@@ -1,5 +1,7 @@
package org.zanata.webtrans.shared.rpc;

import java.util.ArrayList;

import org.zanata.webtrans.shared.model.ProjectIterationId;


Expand All @@ -9,25 +11,42 @@ public class GetDocumentList extends AbstractWorkspaceAction<GetDocumentListResu
private static final long serialVersionUID = 1L;

private ProjectIterationId projectIterationId;
private ArrayList<String> filters;

@SuppressWarnings("unused")
private GetDocumentList()
{
}

public GetDocumentList(ProjectIterationId id)
{
this(id, null);
}

public GetDocumentList(ProjectIterationId id, ArrayList<String> filters)
{
this.projectIterationId = id;
this.filters = filters;
}

public ProjectIterationId getProjectIterationId()
{
return projectIterationId;
}

public void setProjectContainerId(ProjectIterationId projectIterationId)
public void setProjectIterationId(ProjectIterationId projectIterationId)
{
this.projectIterationId = projectIterationId;
}

public ArrayList<String> getFilters()
{
return filters;
}

public void setFilters(ArrayList<String> filters)
{
this.filters = filters;
}

}

0 comments on commit 456b012

Please sign in to comment.