BrightSide Workbench Full Report + Source Code
org.turro.publication.zul.www.PublicationResults Class Reference

Public Member Functions

String getAuthor ()
 
void setAuthor (String author)
 
long getCategory ()
 
void setCategory (long category)
 
long getGroup ()
 
void setGroup (long group)
 
PublicationOrdering getOrdering ()
 
void setOrdering (PublicationOrdering ordering)
 
List< String > getPathList ()
 
void setPathList (List< String > pathList)
 
List< PublicationgetPublications (int max)
 
String convertToIn (List< String > paths)
 

Detailed Description

Author
Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g

Definition at line 30 of file PublicationResults.java.

Member Function Documentation

◆ convertToIn()

String org.turro.publication.zul.www.PublicationResults.convertToIn ( List< String >  paths)

Definition at line 102 of file PublicationResults.java.

102  {
103  String result = null;
104  for(String s : paths) {
105  result = (String) ((result == null) ? s.substring(13) : (result + "," + s.substring(13))); // "/publication/n"
106  }
107  return result;
108  }
Here is the caller graph for this function:

◆ getAuthor()

String org.turro.publication.zul.www.PublicationResults.getAuthor ( )

Definition at line 37 of file PublicationResults.java.

37  {
38  return author;
39  }

◆ getCategory()

long org.turro.publication.zul.www.PublicationResults.getCategory ( )

Definition at line 45 of file PublicationResults.java.

45  {
46  return category;
47  }

◆ getGroup()

long org.turro.publication.zul.www.PublicationResults.getGroup ( )

Definition at line 53 of file PublicationResults.java.

53  {
54  return group;
55  }

◆ getOrdering()

PublicationOrdering org.turro.publication.zul.www.PublicationResults.getOrdering ( )

Definition at line 61 of file PublicationResults.java.

61  {
62  return ordering;
63  }

◆ getPathList()

List<String> org.turro.publication.zul.www.PublicationResults.getPathList ( )

Definition at line 69 of file PublicationResults.java.

69  {
70  return pathList;
71  }

◆ getPublications()

List<Publication> org.turro.publication.zul.www.PublicationResults.getPublications ( int  max)

Definition at line 77 of file PublicationResults.java.

77  {
78  WhereClause wc = new WhereClause();
79  wc.addClause("select publication from Publication publication");
80  wc.addClause("where publication.accepted = true");
81  wc.addClause("and publication.publicationGroup.publishable = true");
82  wc.addClause("and publication.publicationCategory.publishable = true");
83  if(group != 0) {
84  wc.addClause("and publication.publicationGroup.id = :group");
85  wc.addNamedValue("group", group);
86  }
87  if(category != 0) {
88  wc.addClause("and publication.publicationCategory.id = :category");
89  wc.addNamedValue("category", category);
90  }
91  if(!Strings.isBlank(author)) {
92  wc.addClause("and publication.author = :author");
93  wc.addNamedValue("author", author);
94  }
95  if(pathList != null && !pathList.isEmpty()) {
96  wc.addClause("and publication.id in (" + convertToIn(pathList) + ")");
97  }
98  wc.addClause(ordering.getOrderStr());
99  return new PublicationPU().getResultList(wc, max);
100  }
Here is the call graph for this function:

◆ setAuthor()

void org.turro.publication.zul.www.PublicationResults.setAuthor ( String  author)

Definition at line 41 of file PublicationResults.java.

41  {
42  this.author = author;
43  }

◆ setCategory()

void org.turro.publication.zul.www.PublicationResults.setCategory ( long  category)

Definition at line 49 of file PublicationResults.java.

49  {
50  this.category = category;
51  }

◆ setGroup()

void org.turro.publication.zul.www.PublicationResults.setGroup ( long  group)

Definition at line 57 of file PublicationResults.java.

57  {
58  this.group = group;
59  }

◆ setOrdering()

void org.turro.publication.zul.www.PublicationResults.setOrdering ( PublicationOrdering  ordering)

Definition at line 65 of file PublicationResults.java.

65  {
66  this.ordering = ordering;
67  }

◆ setPathList()

void org.turro.publication.zul.www.PublicationResults.setPathList ( List< String >  pathList)

Definition at line 73 of file PublicationResults.java.

73  {
74  this.pathList = pathList;
75  }

The documentation for this class was generated from the following file: