Decompiled by Jad v1 8g Copyright 2001 Pavel Kouznetsov Jad home page

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) nocasts braces
package com.stf.workflow.web.controller.impl;
import com.stf.workflow.core.controller.*;
import com.stf.workflow.model.BlockException;
import com.stf.workflow.model.entity.*;
import com.stf.workflow.model.entity.registrationCard.*;
import com.stf.workflow.model.security.helper.EntityAccessHelper;
import com.stf.workflow.model.service.ContentService;
import com.stf.workflow.model.service.ReferenceService;
import com.stf.workflow.model.service.helper.HibernateHelper;
import com.stf.workflow.web.controller.DocumentController;
import com.stf.workflow.web.form.DocumentForm;
import com.stf.workflow.web.service.RouterService;
import java.io.*;
import java.util.*;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartRequest;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;
// Referenced classes of package com.stf.workflow.web.controller.impl:
// LoginController
public class DocumentControllerImpl extends MultiFormController
implements Controller, DocumentController
{
public DocumentControllerImpl()
{
C3 = new EntityAccessHelper();
}
public synchronized Object createForm()
{
return new DocumentForm();
}
protected synchronized void initForm(Object obj, Map map)
{
DocumentForm documentform = (DocumentForm)obj;
Document document = null;
User user = C4.getCurrentUser();
if(map.get("documentId") == null && map.get("delegationId") == null)
{
document = (Document)EntityCreator.createEntity(com/stf/workflow/model/entity/Document, user);
Block block = new Block();
block.setUser(user);
block.setTarget(document);
document.setBlock(block);
C8.assignRegistrator(document, C4.getCurrentUser());
documentform.setDocument(document);
return;
}
if(map.get("delegationId") != null)
{
long l1 = ((Integer)map.get("delegationId")).longValue();
DelegationItem delegationitem;
for(delegationitem = C5.getDelegation(Long.valueOf(l1), C4.getCurrentUser()); delegationitem.getParentDelegation() != null; delegationitem = delegationitem.getParentDelegation()) { }
document = delegationitem.getParentDocument();
} else
if(map.get("documentId") != null)
{
long l = ((Integer)map.get("documentId")).longValue();
document = C5.getDocument(Long.valueOf(l), user);
}
if(document != null)
{
hibernateHelper.initializeAll(document);
Flow flow = document.getFlow();
com.stf.workflow.model.entity.registrationCard.RegistrationCard.RegistrationCardType registrationcardtype = flow.getRegCardType();
if(registrationcardtype == com.stf.workflow.model.entity.registrationCard.RegistrationCard.RegistrationCardType.IN)
{
documentform.setInRegCard((InRegistrationCard)document.getRegistrationCard());
} else
if(registrationcardtype == com.stf.workflow.model.entity.registrationCard.RegistrationCard.RegistrationCardType.OUT)
{
documentform.setOutRegCard((OutRegistrationCard)document.getRegistrationCard());
} else
if(registrationcardtype == com.stf.workflow.model.entity.registrationCard.RegistrationCard.RegistrationCardType.INNER)
{
documentform.setInnerRegCard((InnerRegistrationCard)document.getRegistrationCard());
}
documentform.setFlowIdAndCardType((new StringBuilder()).append(flow.getId().toString()).append("_").append(flow.getRegCardType().toString()).toString());
documentform.setDocument(document);
}
}
protected synchronized Map referenceData(Object obj)
{
Map map = C7.getVocabularyReferenceData(C4.getCurrentUser());
List list = C7.getFlowTypesReferenceData(C4.getCurrentUser(), Boolean.valueOf(true));
map.put("flowTypes", list);
ArrayList arraylist = new ArrayList();
arraylist.add(new String[] {
localizator.getString("controlcard.hour"), com.stf.workflow.model.entity.DeadLine.DeadLineTerm.HOUR.toString()
});
arraylist.add(new String[] {
localizator.getString("controlcard.day"), com.stf.workflow.model.entity.DeadLine.DeadLineTerm.DAY.toString()
});
arraylist.add(new String[] {
localizator.getString("controlcard.month"), com.stf.workflow.model.entity.DeadLine.DeadLineTerm.MONTH.toString()
});
map.put("terms", arraylist);
return map;
}
public Set getFiles(int i)
{
Set set = ((DocumentForm)form.get(Integer.valueOf(i))).getDocument().getAttachedDocFiles();
return DocFile.getDocFileList(set);
}
public Deligator getResolutor(int i)
{
return ((DocumentForm)form.get(Integer.valueOf(i))).getDocument().getResolutor();
}
public void startFlow(int i, Set set, Deligator deligator)
{
putKKToDocument(i, set, deligator);
Document document = ((DocumentForm)form.get(Integer.valueOf(i))).getDocument();
C8.startFlow(document, C4.getCurrentUser());
}
public synchronized void sendOnResolution(int i, Deligator deligator)
{
saveResolutor(i, deligator);
Document document = ((DocumentForm)form.get(Integer.valueOf(i))).getDocument();
C8.sendToResolution(document, C4.getCurrentUser());
}
public synchronized void returnResolution(int i)
{
Document document = ((DocumentForm)form.get(Integer.valueOf(i))).getDocument();
C8.returnResolution(document, C4.getCurrentUser());
}
public void saveResolutor(int i, Deligator deligator)
{
((DocumentForm)form.get(Integer.valueOf(i))).getDocument().setResolutor(deligator);
}
public synchronized void acceptDelegation(int i, String s, String s1)
{
Document document = ((DocumentForm)form.get(Integer.valueOf(i))).getDocument();
Long long1 = Long.valueOf(s1);
C8.acceptDelegation(document, long1, s, C4.getCurrentUser());
}
public synchronized void declineDelegation(int i, String s, String s1)
{
Document document = ((DocumentForm)form.get(Integer.valueOf(i))).getDocument();
Long long1 = Long.valueOf(s1);
C8.declineDelegation(document, long1, s, C4.getCurrentUser());
}
public synchronized void reportDelegation(int i, String s, String s1)
{
Document document = ((DocumentForm)form.get(Integer.valueOf(i))).getDocument();
Long long1 = Long.valueOf(s1);
C8.reportDelegation(document, long1, s, C4.getCurrentUser());
}
public synchronized void acceptResolution(int i, String s, String s1)
{
Document document = ((DocumentForm)form.get(Integer.valueOf(i))).getDocument();
Long long1 = Long.valueOf(s1);
C8.acceptResolution(document, long1, s, C4.getCurrentUser());
DocFile.signFiles(document.getAttachedDocFiles(), C4.getCurrentUser());
}
public synchronized void declineResolution(int i, String s, String s1)
{
Document document = ((DocumentForm)form.get(Integer.valueOf(i))).getDocument();
Long long1 = Long.valueOf(s1);
C8.declineResolution(document, long1, s, C4.getCurrentUser());
}
public synchronized void takeDelegationFromControl(int i, String s, String s1)
{
Document document = ((DocumentForm)form.get(Integer.valueOf(i))).getDocument();
Long long1 = Long.valueOf(s1);
C8.takeDelegationFromControl(document, long1, s, C4.getCurrentUser());
}
public synchronized void returnDelegation(int i, String s, String s1)
{
Document document = ((DocumentForm)form.get(Integer.valueOf(i))).getDocument();
Long long1 = Long.valueOf(s1);
C8.returnDelegation(document, long1, s, C4.getCurrentUser());
}
public synchronized void forwardDelegation(int i, String s, String s1, Set set, Deligator deligator)
{
if(s1.equals("NaN"))
{
throw new Error(localizator.getString("error.controlcard.delegationnotsaved"));
} else
{
putKKToDocument(i, set, deligator);
Document document = ((DocumentForm)form.get(Integer.valueOf(i))).getDocument();
Long long1 = Long.valueOf(s1);
C8.forwardDelegation(document, long1, s, C4.getCurrentUser());
return;
}
}
public synchronized void cancelDelegation(int i, String s, String s1)
{
Document document = ((DocumentForm)form.get(Integer.valueOf(i))).getDocument();
Long long1 = Long.valueOf(s1);
C8.cancelDelegation(document, long1, s, C4.getCurrentUser());
}
public synchronized void takeDocumentFromControl(int i, String s)
{
Document document = ((DocumentForm)form.get(Integer.valueOf(i))).getDocument();
C8.takeDocumentFromControl(document, s, C4.getCurrentUser());
}
public synchronized void cancelDocument(int i, String s)
{
Document document = ((DocumentForm)form.get(Integer.valueOf(i))).getDocument();
C8.cancelDocument(document, s, C4.getCurrentUser());
}
public void onSave(DocumentForm documentform, Map map)
throws SecurityException
{
documentform.getDocument().getDelegationHistory();
Long long1 = Long.valueOf(documentform.getFlowIdAndCardType().split("_")[0]);
Flow flow = C7.getFlow(long1, C4.getCurrentUser());
Document document = documentform.getDocument();
document.setFlow(flow);
com.stf.workflow.model.entity.registrationCard.RegistrationCard.RegistrationCardType registrationcardtype = flow.getRegCardType();
if(registrationcardtype == com.stf.workflow.model.entity.registrationCard.RegistrationCard.RegistrationCardType.IN)
{
document.setRegistrationCard(documentform.getInRegCard());
} else
if(registrationcardtype == com.stf.workflow.model.entity.registrationCard.RegistrationCard.RegistrationCardType.OUT)
{
document.setRegistrationCard(documentform.getOutRegCard());
} else
if(registrationcardtype == com.stf.workflow.model.entity.registrationCard.RegistrationCard.RegistrationCardType.INNER)
{
document.setRegistrationCard(documentform.getInnerRegCard());
}
if(document.getId() == null)
{
Long long2 = flow.getCounter();
Long long3 = long2;
Long long4 = long2 = Long.valueOf(long2.longValue() + 1L);
Long _tmp = long3;
flow.setCounter(long2);
C7.saveFlow(flow, C4.getCurrentUser());
document.getRegistrationCard().getRegistrationNumber().setDocNr(long2);
documentform.getInnerRegCard().getRegistrationNumber().setDocNr(long2);
documentform.getInRegCard().getRegistrationNumber().setDocNr(long2);
documentform.getOutRegCard().getRegistrationNumber().setDocNr(long2);
}
Block block = document.getBlock();
if(block != null && block.getId() != null && (block == null || !block.getUser().equals(block.getUser())))
{
throw new BlockException(localizator.getString("sequrity.objectNotBlocked"));
} else
{
B(documentform);
System.out.println("Document saved -------------");
return;
}
}
private void B(DocumentForm documentform)
{
Document document = documentform.getDocument();
User user = C4.getCurrentUser();
DelegationHistoryItem delegationhistoryitem;
for(Iterator iterator = document.getDelegationHistory().iterator(); iterator.hasNext(); C5.saveNotifier(delegationhistoryitem.getNotify(), C4.getCurrentUser()))
{
delegationhistoryitem = (DelegationHistoryItem)iterator.next();
Notifier notifier;
if(delegationhistoryitem.getNotify() == null)
{
notifier = (Notifier)EntityCreator.createEntity(com/stf/workflow/model/entity/Notifier, C4.getCurrentUser());
} else
if(delegationhistoryitem.getNotify().getId() == null)
{
notifier = delegationhistoryitem.getNotify();
} else
{
notifier = C5.getNotifier(delegationhistoryitem.getNotify().getId(), C4.getCurrentUser());
notifier.getUsers().clear();
notifier.getUsers().addAll(delegationhistoryitem.getNotify().getUsers());
}
delegationhistoryitem.setNotify(notifier);
}
Set set = document.getControlCard().getDeligations();
A(set);
DelegationHistoryItem delegationhistoryitem1;
for(Iterator iterator1 = document.getDelegationHistory().iterator(); iterator1.hasNext(); delegationhistoryitem1.setNotify(C5.mergeNotifier(delegationhistoryitem1.getNotify(), C4.getCurrentUser())))
{
delegationhistoryitem1 = (DelegationHistoryItem)iterator1.next();
}
Iterator iterator2 = document.getControlCard().getDeligations().iterator();
do
{
if(!iterator2.hasNext())
{
break;
}
DelegationItem delegationitem = (DelegationItem)iterator2.next();
if(delegationitem.getDelegationHistory() != null)
{
Iterator iterator3 = delegationitem.getDelegationHistory().iterator();
while(iterator3.hasNext())
{
DelegationHistoryItem delegationhistoryitem2 = (DelegationHistoryItem)iterator3.next();
delegationhistoryitem2.setNotify(C5.mergeNotifier(delegationhistoryitem2.getNotify(), C4.getCurrentUser()));
}
}
} while(true);
C5.saveDocument(document, C4.getCurrentUser());
}
private void A(Set set)
{
Iterator iterator = set.iterator();
do
{
if(!iterator.hasNext())
{
break;
}
DelegationItem delegationitem = (DelegationItem)iterator.next();
if(delegationitem.getChildren() != null)
{
A(delegationitem.getChildren());
}
if(delegationitem.getDelegationHistory() != null)
{
Iterator iterator1 = delegationitem.getDelegationHistory().iterator();
while(iterator1.hasNext())
{
DelegationHistoryItem delegationhistoryitem = (DelegationHistoryItem)iterator1.next();
Notifier notifier;
if(delegationhistoryitem.getNotify() == null)
{
notifier = (Notifier)EntityCreator.createEntity(com/stf/workflow/model/entity/Notifier, C4.getCurrentUser());
} else
if(delegationhistoryitem.getNotify().getId() == null)
{
notifier = delegationhistoryitem.getNotify();
} else
{
notifier = C5.getNotifier(delegationhistoryitem.getNotify().getId(), C4.getCurrentUser());
notifier.getUsers().clear();
notifier.getUsers().addAll(delegationhistoryitem.getNotify().getUsers());
}
delegationhistoryitem.setNotify(notifier);
C5.saveNotifier(delegationhistoryitem.getNotify(), C4.getCurrentUser());
}
}
} while(true);
}
private void A(DocumentForm documentform)
{
File file;
File file1;
for(Iterator iterator = documentform.getDocument().getAttachedDocFiles().iterator(); iterator.hasNext(); file.renameTo(file1))
{
DocFile docfile = (DocFile)iterator.next();
String s = C6.getDocumentDirectory(documentform.getDocument().getId());
file = new File((new StringBuilder()).append(s).append('/').append(docfile.getName()).toString());
file1 = new File((new StringBuilder()).append(s).append('/').append(docfile.getId()).toString());
}
}
public void setContentService(ContentService contentservice)
{
C5 = contentservice;
}
public void setFileSaver(FileReceiverController filereceivercontroller)
{
C6 = filereceivercontroller;
}
public synchronized void putKKToDocument(int i, Set set, Deligator deligator)
{
DocumentForm documentform = (DocumentForm)form.get(Integer.valueOf(i));
B(set);
Set set1 = documentform.getDocument().getControlCard().getDeligations();
set1.clear();
set1.addAll(set);
if(deligator != null)
{
deligator.setAccountId(C4.getCurrentUser().getAccountId());
}
documentform.getDocument().getControlCard().setController(deligator);
}
private void B(Set set)
{
Iterator iterator = set.iterator();
do
{
if(!iterator.hasNext())
{
break;
}
DelegationItem delegationitem = (DelegationItem)iterator.next();
delegationitem.setAccountId(C4.getCurrentUser().getAccountId());
if(delegationitem.getCreationDate() == null)
{
delegationitem.setCreationDate(new Date());
}
delegationitem.setAccountId(C4.getCurrentUser().getAccountId());
if(delegationitem.getDelegatorsArray() != null)
{
Deligator deligator;
for(Iterator iterator1 = delegationitem.getDelegatorsArray().iterator(); iterator1.hasNext(); deligator.setAccountId(C4.getCurrentUser().getAccountId()))
{
deligator = (Deligator)iterator1.next();
}
}
if(delegationitem.getChildren() != null)
{
B(delegationitem.getChildren());
}
} while(true);
}
public synchronized Deligator getController(int i)
{
DocumentForm documentform = (DocumentForm)form.get(Integer.valueOf(i));
if(documentform != null)
{
return documentform.getDocument().getControlCard().getController();
} else
{
return null;
}
}
public synchronized ModelAndView handleRequestInternal(HttpServletRequest httpservletrequest, HttpServletResponse httpservletresponse)
throws Exception
{
InputStream inputstream;
Integer integer2;
String s3;
Long long3;
Object obj;
String s11;
FileOutputStream fileoutputstream;
if(!(httpservletrequest instanceof MultipartRequest))
{
break MISSING_BLOCK_LABEL_330;
}
MultipartRequest multipartrequest = (MultipartRequest)httpservletrequest;
MultipartFile multipartfile = multipartrequest.getFile("file");
inputstream = multipartfile.getInputStream();
if(inputstream == null)
{
break MISSING_BLOCK_LABEL_330;
}
integer2 = Integer.valueOf(httpservletrequest.getParameter("windowId"));
s3 = httpservletrequest.getParameter("version");
long3 = Long.valueOf(httpservletrequest.getParameter("parentDocumentId"));
Long long4 = ((DocumentForm)form.get(integer2)).getDocument().getId();
obj = multipartfile.getOriginalFilename();
String s9 = C6.getDocumentDirectory(long4);
s11 = (new StringBuilder()).append(s9).append('/').append(obj).toString();
fileoutputstream = new FileOutputStream(s11);
byte abyte1[] = new byte[1000];
int j;
while((j = inputstream.read(abyte1)) != -1)
{
fileoutputstream.write(abyte1, 0, j);
}
fileoutputstream.flush();
fileoutputstream.close();
break MISSING_BLOCK_LABEL_224;
Exception exception1;
exception1;
exception1.printStackTrace();
fileoutputstream.close();
break MISSING_BLOCK_LABEL_224;
Exception exception2;
exception2;
fileoutputstream.close();
throw exception2;
File file2 = new File(s11);
DocFile docfile1 = (DocFile)EntityCreator.createEntity(com/stf/workflow/model/entity/DocFile, C4.getCurrentUser());
docfile1.setProperties(obj, file2.length(), s3);
DocFile.addNewDocument(((DocumentForm)form.get(integer2)).getDocument().getAttachedDocFiles(), docfile1, long3);
B((DocumentForm)form.get(integer2));
A((DocumentForm)form.get(integer2));
FileInputStream fileinputstream;
String s7;
String s = httpservletrequest.getParameter("action");
if(s == null || !s.equals("downloadFile"))
{
break MISSING_BLOCK_LABEL_661;
}
fileinputstream = null;
Integer integer = Integer.valueOf(httpservletrequest.getParameter("formId"));
String s2 = httpservletrequest.getParameter("fileId");
Long long2 = Long.valueOf(s2);
String s5 = C6.getDocumentDirectory(((DocumentForm)form.get(integer)).getDocument().getId());
s7 = (new StringBuilder()).append(s5).append('/').append(s2).toString();
obj = DocFile.getDocFile(((DocumentForm)form.get(integer)).getDocument().getAttachedDocFiles(), long2);
httpservletresponse.setContentType("application/octet-stream");
String s10 = (new StringBuilder()).append("Attachment;Filename=").append(obj.getName().replaceAll(" ", "%20")).toString();
httpservletresponse.setHeader("Content-Disposition", s10);
File file1 = new File(s7);
fileinputstream = new FileInputStream(file1);
byte abyte0[] = new byte[1000];
int i;
while((i = fileinputstream.read(abyte0)) != -1)
{
httpservletresponse.getOutputStream().write(abyte0, 0, i);
}
httpservletresponse.getOutputStream().flush();
httpservletresponse.getOutputStream().close();
fileinputstream.close();
httpservletresponse.getOutputStream().close();
fileinputstream.close();
break MISSING_BLOCK_LABEL_661;
Exception exception;
exception;
exception.printStackTrace();
httpservletresponse.getOutputStream().close();
fileinputstream.close();
break MISSING_BLOCK_LABEL_661;
Exception exception3;
exception3;
httpservletresponse.getOutputStream().close();
fileinputstream.close();
throw exception3;
String s1 = httpservletrequest.getHeader("operation");
if(s1 != null && s1.equals("scanner"))
{
Integer integer1 = Integer.valueOf(httpservletrequest.getHeader("num"));
Long long1 = ((DocumentForm)form.get(integer1)).getDocument().getId();
String s4 = C6.getDocumentDirectory(long1);
String s6 = "Scanned document.pdf";
String s8 = (new StringBuilder()).append(s4).append('/').append(s6).toString();
try
{
C6.savePDFDocument(httpservletrequest.getInputStream(), s8);
httpservletresponse.getWriter().print("success");
}
catch(IOException ioexception)
{
ioexception.printStackTrace();
httpservletresponse.getWriter().print("failed");
}
File file = new File(s8);
DocFile docfile = (DocFile)EntityCreator.createEntity(com/stf/workflow/model/entity/DocFile, C4.getCurrentUser());
docfile.setProperties(s6, file.length(), "1.0");
DocFile.addNewDocument(((DocumentForm)form.get(integer1)).getDocument().getAttachedDocFiles(), docfile, Long.valueOf(-1L));
B((DocumentForm)form.get(integer1));
A((DocumentForm)form.get(integer1));
}
return null;
}
public synchronized void removeFiles(int i, List list)
{
File file;
for(Iterator iterator = list.iterator(); iterator.hasNext(); file.delete())
{
String s = (String)iterator.next();
long l = Long.valueOf(s).longValue();
DocFile.removeFile(((DocumentForm)form.get(Integer.valueOf(i))).getDocument().getAttachedDocFiles(), Long.valueOf(l));
String s1 = C6.getDocumentDirectory(((DocumentForm)form.get(Integer.valueOf(i))).getDocument().getId());
file = new File((new StringBuilder()).append(s1).append('/').append(l).toString());
}
B((DocumentForm)form.get(Integer.valueOf(i)));
}
public synchronized void renameFile(int i, Long long1, String s)
{
DocFile.renameFile(((DocumentForm)form.get(Integer.valueOf(i))).getDocument().getAttachedDocFiles(), long1, s);
B((DocumentForm)form.get(Integer.valueOf(i)));
}
public synchronized Map getTemporaryACL(int i)
{
HashMap hashmap = new HashMap();
DocumentForm documentform = (DocumentForm)form.get(Integer.valueOf(i));
if(documentform != null)
{
hashmap.put("temporaryACL", documentform.getDocument().getTemporaryACL());
hashmap.put("block", documentform.getDocument().getBlock());
hashmap.put("run", documentform.getDocument().getRun());
hashmap.put("onRegistration", documentform.getDocument().getOnRegistration());
}
return hashmap;
}
public synchronized Document getDeligationsAndDocumentHistory(int i)
{
try
{
DocumentForm documentform = (DocumentForm)form.get(Integer.valueOf(i));
if(documentform != null && documentform.getDocument().getControlCard().getDeligations() == null)
{
documentform.getDocument().getControlCard().setDeligations(new HashSet());
}
return documentform.getDocument();
}
catch(Exception exception)
{
exception.printStackTrace();
}
return null;
}
public synchronized ACL getDocumentACL(int i)
{
DocumentForm documentform = (DocumentForm)form.get(Integer.valueOf(i));
return documentform.getDocument().getAcl();
}
public synchronized void setDocumentACL(int i, ACL acl)
{
DocumentForm documentform = (DocumentForm)form.get(Integer.valueOf(i));
C3.checkAccess(documentform.getDocument(), C4.getCurrentUser(), com.stf.workflow.model.security.helper.EntityAccessHelper.Access.WRITE);
documentform.getDocument().setAcl(acl);
}
public synchronized Block blockDocument(int i)
{
DocumentForm documentform = (DocumentForm)form.get(Integer.valueOf(i));
C5.evictDocument(documentform.getDocument());
Document document = C5.getDocument(documentform.getDocument().getId(), C4.getCurrentUser());
hibernateHelper.initializeAll(document);
documentform.setDocument(document);
C5.createDocumentBlock(document, C4.getCurrentUser());
return document.getBlock();
}
public synchronized void removeForm(int i)
{
DocumentForm documentform = (DocumentForm)form.get(Integer.valueOf(i));
if(documentform.getDocument().getId() != null)
{
C5.removeDocumentBlock(documentform.getDocument(), C4.getCurrentUser());
}
super.removeForm(i);
}
public void setLoginController(LoginController logincontroller)
{
C4 = logincontroller;
}
public LoginController getLoginController()
{
return C4;
}
public void setReferenceService(ReferenceService referenceservice)
{
C7 = referenceservice;
}
public void setRouterService(RouterService routerservice)
{
C8 = routerservice;
}
public Set superGetR()
{
DocumentForm documentform = (DocumentForm)form.get(Integer.valueOf(1));
return documentform.getDocument().getDelegationHistory();
}
private ContentService C5;
private ReferenceService C7;
private FileReceiverController C6;
private LoginController C4;
private RouterService C8;
private EntityAccessHelper C3;
private static final String C1 = "documentId";
private static final String C2 = "delegationId";
}