◆ CommentItCtrl()
org.turro.www.commentit.CommentItCtrl.CommentItCtrl |
( |
IConstructor |
constructor | ) |
|
◆ getRemoveUrl()
String org.turro.www.commentit.CommentItCtrl.getRemoveUrl |
( |
String |
commentId, |
|
|
String |
id |
|
) |
| |
Definition at line 135 of file CommentItCtrl.java.
136 return "$.post(\"" + ElephantContext.getRootWebPath() +
"/xpaction/contact\"," +
137 "{ action: \"comment-it\", id: \"" + commentId +
"\", remove: true, domid: \"" +
id +
"\" })" +
138 ".done(function(data) { $(\"#" +
id +
"\").html(data); });";
◆ getSubmitUrl()
String org.turro.www.commentit.CommentItCtrl.getSubmitUrl |
( |
String |
id | ) |
|
Definition at line 128 of file CommentItCtrl.java.
129 return "$.post(\"" + ElephantContext.getRootWebPath() +
"/xpaction/contact\"," +
130 "$(\"#form_" +
id +
"\").serialize())" +
131 ".done(function(data) { $(\"#" +
id +
"\").html(data); });" +
◆ renderComments()
void org.turro.www.commentit.CommentItCtrl.renderComments |
( |
boolean |
container | ) |
|
Definition at line 85 of file CommentItCtrl.java.
86 if(ElephantMarker.existsTemplate(constructor,
false,
"widgets/webcomp",
"commentIt")) {
90 IContact contact = Authentication.getIContact();
91 SoftContact scontact =
new SoftContact();
92 scontact.contact = contact;
93 scontact.author_ip = constructor.
getRequest().getRemoteAddr();
94 Collection<CommentIt> comments = CommentItUtil.comments(entityPath, scontact);
95 html =
new HTMLHelper(constructor);
96 String
id = container ?
"cic_" + IdGenerator.generate() : constructor.
getParameter(
"domid");
98 html.
startTag(
"div",
"id='" +
id +
"'");
100 for(CommentIt ci : comments) {
101 String cid =
"cid" + ci.getId();
102 html.
startTag(
"div",
"class='commentit-comment' id='" + cid +
"'")
103 .
startTag(
"div",
"class='commentit-details'")
108 .
write(DateFormats.format(ci.getDateCreation(), DateFormat.SHORT, DateFormat.SHORT, I_.api().used()))
113 .
startTag(
"a",
"onClick='" +
getRemoveUrl(ci.getId(), cid) +
"' style='display:" + (ci.isAccepted() ?
"none" :
"") +
"'")
114 .
doTag(
"img",
"src='" + ElephantContext.getRootWebPath() +
"/_internal/system/images/delete.png'")
118 .
write(StringParser.toHTML(ci.getBody()))
123 renderNewComment(html,
id, contact);
HTMLGenerator endAllTags()
HTMLGenerator write(String value)
HTMLGenerator doTag(String tag)
HTMLGenerator startTag(String tag)
HttpServletRequest getRequest()
String getParameter(String param)
◆ renderTemplateComments()
void org.turro.www.commentit.CommentItCtrl.renderTemplateComments |
( |
boolean |
container | ) |
|
Definition at line 62 of file CommentItCtrl.java.
63 IContact contact = Authentication.getIContact();
64 SoftContact scontact =
new SoftContact();
65 scontact.contact = contact;
66 scontact.author_ip = constructor.
getRequest().getRemoteAddr();
67 Collection<CommentIt> comments = CommentItUtil.comments(entityPath, scontact);
68 String
id = container ?
"cic_" + IdGenerator.generate() : constructor.
getParameter(
"domid");
69 ElephantMarker em =
new ElephantMarker(constructor);
70 em.put(
"control",
this);
71 em.put(
"contact", contact);
72 em.put(
"controlId",
id);
73 em.put(
"container", container);
74 em.put(
"comments", comments);
75 em.put(
"entityPath", entityPath);
76 em.put(
"readOnly", readOnly);
77 if(contact !=
null && contact.isValid()) {
78 em.put(
"name", contact.getName());
79 em.put(
"email", contact.getConnector(IUser.CONNECTOR_EMAIL));
80 em.put(
"web", contact.getConnector(
"Web"));
82 em.process(
"widgets/webcomp",
"commentIt");
◆ setEntityPath()
void org.turro.www.commentit.CommentItCtrl.setEntityPath |
( |
String |
entityPath | ) |
|
◆ setReadOnly()
void org.turro.www.commentit.CommentItCtrl.setReadOnly |
( |
boolean |
readOnly | ) |
|
◆ toHTML()
String org.turro.www.commentit.CommentItCtrl.toHTML |
( |
String |
value | ) |
|
The documentation for this class was generated from the following file: