- Author
- Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g
Definition at line 69 of file AboutVM.java.
◆ getAboutModel()
List<AboutWrapper> org.turro.contacts.comment.AboutVM.getAboutModel |
( |
| ) |
|
Definition at line 222 of file AboutVM.java.
224 model =
new ArrayList<>();
226 boolean done =
false;
228 if(comment.getComment().startsWith(
"#cv" + lang)) {
229 AboutWrapper wrapper = new AboutWrapper(lang, chooseLabel(lang), comment);
235 AboutWrapper wrapper =
new AboutWrapper(lang, chooseLabel(lang),
new Comment());
◆ getContact()
Contact org.turro.contacts.comment.AboutVM.getContact |
( |
| ) |
|
◆ getContactsModel()
List<Contact> org.turro.contacts.comment.AboutVM.getContactsModel |
( |
| ) |
|
Definition at line 202 of file AboutVM.java.
203 ContactList list =
new ContactList();
206 .filter(r -> r.getRelation().isResponsible())
207 .map(r -> (Contact) r.getRelation().getBusiness())
208 .collect(Collectors.toList()));
209 if(!list.isEmpty()) {
212 Application.getApplication().sendRedirect(
"/user");
◆ getImage()
String org.turro.contacts.comment.AboutVM.getImage |
( |
| ) |
|
Definition at line 171 of file AboutVM.java.
172 FileAttach fileAttach =
new FileAttach(ContactsPU.getObjectPath(contact));
173 String faceFile = fileAttach.getPublicFile(
"/profile/face.png",
false);
174 if(!Strings.isBlank(faceFile)) {
175 return faceFile +
"?" + IdGenerator.generateHex();
◆ getLangModel()
List<String> org.turro.contacts.comment.AboutVM.getLangModel |
( |
| ) |
|
Definition at line 193 of file AboutVM.java.
195 langs =
new ArrayList<>();
197 langs.addAll(Arrays.asList(ElephantContext.getSiteLocales().split(
" *, *")));
◆ getTrade()
String org.turro.contacts.comment.AboutVM.getTrade |
( |
| ) |
|
Definition at line 185 of file AboutVM.java.
186 return Contacts.getContact(contact).getConnector(IUser.CONNECTOR_TRADE);
◆ getWeb()
String org.turro.contacts.comment.AboutVM.getWeb |
( |
| ) |
|
Definition at line 181 of file AboutVM.java.
182 return Contacts.getContact(contact).getConnector(
"Web");
◆ init()
void org.turro.contacts.comment.AboutVM.init |
( |
@ExecutionArgParam("contact") Contact |
contact | ) |
|
Definition at line 76 of file AboutVM.java.
77 if(contact !=
null) this.contact = contact;
◆ isInRole()
boolean org.turro.contacts.comment.AboutVM.isInRole |
( |
String |
role | ) |
|
Definition at line 189 of file AboutVM.java.
190 return Application.getApplication().isInRole(role);
◆ save()
void org.turro.contacts.comment.AboutVM.save |
( |
| ) |
|
Definition at line 142 of file AboutVM.java.
144 if(contact !=
null) {
145 for(AboutWrapper wrapper : model) {
146 if(wrapper.isNewComment() && !wrapper.isEmpty()) {
147 Comment comment = wrapper.getComment();
148 comment.setContact(contact);
149 comment.setModification(
new Date());
154 contact =
new ContactsPU().saveObject(contact);
156 sendNotification(contact);
157 Clients.showNotification(I_.get(
"Saved"));
◆ setContact()
void org.turro.contacts.comment.AboutVM.setContact |
( |
@BindingParam("contact") Object |
contact | ) |
|
Definition at line 83 of file AboutVM.java.
84 if(contact instanceof Contact) {
85 this.contact = (Contact) contact;
◆ setImage()
void org.turro.contacts.comment.AboutVM.setImage |
( |
@ContextParam(ContextType.BIND_CONTEXT) BindContext |
ctx | ) |
throws IOException |
Definition at line 111 of file AboutVM.java.
112 UploadEvent
event = (UploadEvent) ctx.getTriggerEvent();
113 FileAttach fileAttach =
new FileAttach(ContactsPU.getObjectPath(contact));
114 File newFile =
new File(ElephantContext.getRealPath(fileAttach.getPublishable() +
"/profile/face.png"));
115 if(!newFile.getParentFile().exists()) {
116 newFile.getParentFile().mkdirs();
118 try (FileOutputStream fos =
new FileOutputStream(newFile)) {
119 Media media =
event.getMedia();
121 if(media.inMemory()) {
122 fos.write(media.isBinary() ? media.getByteData() : media.getStringData().getBytes());
124 byte[] buffer =
new byte[102400];
125 try (InputStream is = media.isBinary() ? media.getStreamData() :
new ReaderInputStream(media.getReaderData())) {
127 while((r = is.read(buffer)) != -1) {
128 fos.write(buffer, 0, r);
133 }
catch (FileNotFoundException ex) {
134 Logger.getLogger(AboutVM.class.getName()).log(Level.SEVERE,
null, ex);
136 org.zkoss.lang.Threads.sleep(2000);
137 BindUtils.postNotifyChange(
null,
null, AboutVM.this,
"image");
◆ setTrade()
void org.turro.contacts.comment.AboutVM.setTrade |
( |
@BindingParam("trade") String |
trade | ) |
|
Definition at line 102 of file AboutVM.java.
103 if(!Strings.isBlank(trade)) {
104 Contacts.getContact(contact).setConnector(IUser.CONNECTOR_TRADE, trade);
106 Contacts.getContact(contact).setConnector(IUser.CONNECTOR_TRADE,
null);
◆ setWeb()
void org.turro.contacts.comment.AboutVM.setWeb |
( |
@BindingParam("web") String |
web | ) |
|
Definition at line 92 of file AboutVM.java.
93 if(!Strings.isBlank(web)) {
94 Contacts.getContact(contact).setConnector(
"Web", UrlCompose.fillWebGaps(web));
96 Contacts.getContact(contact).setConnector(
"Web",
null);
◆ update()
void org.turro.contacts.comment.AboutVM.update |
( |
| ) |
|
The documentation for this class was generated from the following file: