|
@@ -289,249 +289,254 @@ class ActionDescription(object):
|
289
|
289
|
]
|
290
|
290
|
|
291
|
291
|
|
292
|
|
-class ContentStatus(object):
|
293
|
|
- """
|
294
|
|
- Allowed status are:
|
295
|
|
- - open
|
296
|
|
- - closed-validated
|
297
|
|
- - closed-invalidated
|
298
|
|
- - closed-deprecated
|
299
|
|
- """
|
300
|
|
-
|
301
|
|
- OPEN = 'open'
|
302
|
|
- CLOSED_VALIDATED = 'closed-validated'
|
303
|
|
- CLOSED_UNVALIDATED = 'closed-unvalidated'
|
304
|
|
- CLOSED_DEPRECATED = 'closed-deprecated'
|
305
|
|
-
|
306
|
|
- # TODO - G.M - 10-04-2018 - [Cleanup] Drop this
|
307
|
|
- # _LABELS = {'open': l_('work in progress'),
|
308
|
|
- # 'closed-validated': l_('closed — validated'),
|
309
|
|
- # 'closed-unvalidated': l_('closed — cancelled'),
|
310
|
|
- # 'closed-deprecated': l_('deprecated')}
|
311
|
|
- #
|
312
|
|
- # _LABELS_THREAD = {'open': l_('subject in progress'),
|
313
|
|
- # 'closed-validated': l_('subject closed — resolved'),
|
314
|
|
- # 'closed-unvalidated': l_('subject closed — cancelled'),
|
315
|
|
- # 'closed-deprecated': l_('deprecated')}
|
316
|
|
- #
|
317
|
|
- # _LABELS_FILE = {'open': l_('work in progress'),
|
318
|
|
- # 'closed-validated': l_('closed — validated'),
|
319
|
|
- # 'closed-unvalidated': l_('closed — cancelled'),
|
320
|
|
- # 'closed-deprecated': l_('deprecated')}
|
321
|
|
- #
|
322
|
|
- # _ICONS = {
|
323
|
|
- # 'open': 'fa fa-square-o',
|
324
|
|
- # 'closed-validated': 'fa fa-check-square-o',
|
325
|
|
- # 'closed-unvalidated': 'fa fa-close',
|
326
|
|
- # 'closed-deprecated': 'fa fa-warning',
|
327
|
|
- # }
|
328
|
|
- #
|
329
|
|
- # _CSS = {
|
330
|
|
- # 'open': 'tracim-status-open',
|
331
|
|
- # 'closed-validated': 'tracim-status-closed-validated',
|
332
|
|
- # 'closed-unvalidated': 'tracim-status-closed-unvalidated',
|
333
|
|
- # 'closed-deprecated': 'tracim-status-closed-deprecated',
|
334
|
|
- # }
|
335
|
|
-
|
336
|
|
- def __init__(self,
|
337
|
|
- id,
|
338
|
|
- # TODO - G.M - 10-04-2018 - [Cleanup] Drop this
|
339
|
|
- # type=''
|
340
|
|
- ):
|
341
|
|
- self.id = id
|
342
|
|
- # TODO - G.M - 10-04-2018 - [Cleanup] Drop this
|
343
|
|
- # self.icon = ContentStatus._ICONS[id]
|
344
|
|
- # self.css = ContentStatus._CSS[id]
|
345
|
|
- #
|
346
|
|
- # if type==ContentType.Thread:
|
347
|
|
- # self.label = ContentStatus._LABELS_THREAD[id]
|
348
|
|
- # elif type==ContentType.File:
|
349
|
|
- # self.label = ContentStatus._LABELS_FILE[id]
|
350
|
|
- # else:
|
351
|
|
- # self.label = ContentStatus._LABELS[id]
|
352
|
|
-
|
353
|
|
-
|
354
|
|
- @classmethod
|
355
|
|
- def all(cls, type='') -> ['ContentStatus']:
|
356
|
|
- # TODO - G.M - 10-04-2018 - [Cleanup] Drop this
|
357
|
|
- # all = []
|
358
|
|
- # all.append(ContentStatus('open', type))
|
359
|
|
- # all.append(ContentStatus('closed-validated', type))
|
360
|
|
- # all.append(ContentStatus('closed-unvalidated', type))
|
361
|
|
- # all.append(ContentStatus('closed-deprecated', type))
|
362
|
|
- # return all
|
363
|
|
- status_list = list()
|
364
|
|
- for elem in cls.allowed_values():
|
365
|
|
- status_list.append(ContentStatus(elem))
|
366
|
|
- return status_list
|
367
|
|
-
|
368
|
|
- @classmethod
|
369
|
|
- def allowed_values(cls):
|
370
|
|
- # TODO - G.M - 10-04-2018 - [Cleanup] Drop this
|
371
|
|
- # return ContentStatus._LABELS.keys()
|
372
|
|
- return [
|
373
|
|
- ContentStatus.OPEN,
|
374
|
|
- ContentStatus.CLOSED_UNVALIDATED,
|
375
|
|
- ContentStatus.CLOSED_VALIDATED,
|
376
|
|
- ContentStatus.CLOSED_DEPRECATED
|
377
|
|
- ]
|
378
|
|
-
|
379
|
|
-
|
380
|
|
-class ContentType(object):
|
381
|
|
- Any = 'any'
|
382
|
|
-
|
383
|
|
- Folder = 'folder'
|
384
|
|
- File = 'file'
|
385
|
|
- Comment = 'comment'
|
386
|
|
- Thread = 'thread'
|
387
|
|
- Page = 'page'
|
388
|
|
- Event = 'event'
|
389
|
|
-
|
390
|
|
- # TODO - G.M - 10-04-2018 - [Cleanup] Do we really need this ?
|
391
|
|
- # _STRING_LIST_SEPARATOR = ','
|
392
|
|
-
|
393
|
|
- # TODO - G.M - 10-04-2018 - [Cleanup] Drop this
|
394
|
|
- # _ICONS = { # Deprecated
|
395
|
|
- # 'dashboard': 'fa-home',
|
396
|
|
- # 'workspace': 'fa-bank',
|
397
|
|
- # 'folder': 'fa fa-folder-open-o',
|
398
|
|
- # 'file': 'fa fa-paperclip',
|
399
|
|
- # 'page': 'fa fa-file-text-o',
|
400
|
|
- # 'thread': 'fa fa-comments-o',
|
401
|
|
- # 'comment': 'fa fa-comment-o',
|
402
|
|
- # 'event': 'fa fa-calendar-o',
|
403
|
|
- # }
|
404
|
|
- #
|
405
|
|
- # _CSS_ICONS = {
|
406
|
|
- # 'dashboard': 'fa fa-home',
|
407
|
|
- # 'workspace': 'fa fa-bank',
|
408
|
|
- # 'folder': 'fa fa-folder-open-o',
|
409
|
|
- # 'file': 'fa fa-paperclip',
|
410
|
|
- # 'page': 'fa fa-file-text-o',
|
411
|
|
- # 'thread': 'fa fa-comments-o',
|
412
|
|
- # 'comment': 'fa fa-comment-o',
|
413
|
|
- # 'event': 'fa fa-calendar-o',
|
414
|
|
- # }
|
415
|
|
- #
|
416
|
|
- # _CSS_COLORS = {
|
417
|
|
- # 'dashboard': 't-dashboard-color',
|
418
|
|
- # 'workspace': 't-less-visible',
|
419
|
|
- # 'folder': 't-folder-color',
|
420
|
|
- # 'file': 't-file-color',
|
421
|
|
- # 'page': 't-page-color',
|
422
|
|
- # 'thread': 't-thread-color',
|
423
|
|
- # 'comment': 't-thread-color',
|
424
|
|
- # 'event': 't-event-color',
|
425
|
|
- # }
|
426
|
|
-
|
427
|
|
- _ORDER_WEIGHT = {
|
428
|
|
- 'folder': 0,
|
429
|
|
- 'page': 1,
|
430
|
|
- 'thread': 2,
|
431
|
|
- 'file': 3,
|
432
|
|
- 'comment': 4,
|
433
|
|
- 'event': 5,
|
434
|
|
- }
|
435
|
|
-
|
436
|
|
- # TODO - G.M - 10-04-2018 - [Cleanup] Drop this
|
437
|
|
- # _LABEL = {
|
438
|
|
- # 'dashboard': '',
|
439
|
|
- # 'workspace': l_('workspace'),
|
440
|
|
- # 'folder': l_('folder'),
|
441
|
|
- # 'file': l_('file'),
|
442
|
|
- # 'page': l_('page'),
|
443
|
|
- # 'thread': l_('thread'),
|
444
|
|
- # 'comment': l_('comment'),
|
445
|
|
- # 'event': l_('event'),
|
446
|
|
- # }
|
447
|
|
- #
|
448
|
|
- # _DELETE_LABEL = {
|
449
|
|
- # 'dashboard': '',
|
450
|
|
- # 'workspace': l_('Delete this workspace'),
|
451
|
|
- # 'folder': l_('Delete this folder'),
|
452
|
|
- # 'file': l_('Delete this file'),
|
453
|
|
- # 'page': l_('Delete this page'),
|
454
|
|
- # 'thread': l_('Delete this thread'),
|
455
|
|
- # 'comment': l_('Delete this comment'),
|
456
|
|
- # 'event': l_('Delete this event'),
|
457
|
|
- # }
|
458
|
|
- #
|
459
|
|
- # @classmethod
|
460
|
|
- # def get_icon(cls, type: str):
|
461
|
|
- # assert(type in ContentType._ICONS) # DYN_REMOVE
|
462
|
|
- # return ContentType._ICONS[type]
|
463
|
|
-
|
464
|
|
- @classmethod
|
465
|
|
- def all(cls):
|
466
|
|
- return cls.allowed_types()
|
467
|
|
-
|
468
|
|
- @classmethod
|
469
|
|
- def allowed_types(cls):
|
470
|
|
- return [cls.Folder, cls.File, cls.Comment, cls.Thread, cls.Page,
|
471
|
|
- cls.Event]
|
472
|
|
-
|
473
|
|
- @classmethod
|
474
|
|
- def allowed_types_for_folding(cls):
|
475
|
|
- # This method is used for showing only "main"
|
476
|
|
- # types in the left-side treeview
|
477
|
|
- return [cls.Folder, cls.File, cls.Thread, cls.Page]
|
478
|
|
-
|
479
|
|
- # TODO - G.M - 10-04-2018 - [Cleanup] Drop this
|
480
|
|
- # @classmethod
|
481
|
|
- # def allowed_types_from_str(cls, allowed_types_as_string: str):
|
482
|
|
- # allowed_types = []
|
483
|
|
- # # HACK - THIS
|
484
|
|
- # for item in allowed_types_as_string.split(ContentType._STRING_LIST_SEPARATOR):
|
485
|
|
- # if item and item in ContentType.allowed_types_for_folding():
|
486
|
|
- # allowed_types.append(item)
|
487
|
|
- # return allowed_types
|
488
|
|
- #
|
489
|
|
- # @classmethod
|
490
|
|
- # def fill_url(cls, content: 'Content'):
|
491
|
|
- # # TODO - DYNDATATYPE - D.A. - 2014-12-02
|
492
|
|
- # # Make this code dynamic loading data types
|
493
|
|
- #
|
494
|
|
- # if content.type==ContentType.Folder:
|
495
|
|
- # return '/workspaces/{}/folders/{}'.format(content.workspace_id, content.content_id)
|
496
|
|
- # elif content.type==ContentType.File:
|
497
|
|
- # return '/workspaces/{}/folders/{}/files/{}'.format(content.workspace_id, content.parent_id, content.content_id)
|
498
|
|
- # elif content.type==ContentType.Thread:
|
499
|
|
- # return '/workspaces/{}/folders/{}/threads/{}'.format(content.workspace_id, content.parent_id, content.content_id)
|
500
|
|
- # elif content.type==ContentType.Page:
|
501
|
|
- # return '/workspaces/{}/folders/{}/pages/{}'.format(content.workspace_id, content.parent_id, content.content_id)
|
502
|
|
- #
|
503
|
|
- # @classmethod
|
504
|
|
- # def fill_url_for_workspace(cls, workspace: Workspace):
|
505
|
|
- # # TODO - DYNDATATYPE - D.A. - 2014-12-02
|
506
|
|
- # # Make this code dynamic loading data types
|
507
|
|
- # return '/workspaces/{}'.format(workspace.workspace_id)
|
508
|
|
-
|
509
|
|
- @classmethod
|
510
|
|
- def sorted(cls, types: ['ContentType']) -> ['ContentType']:
|
511
|
|
- return sorted(types, key=lambda content_type: content_type.priority)
|
512
|
|
-
|
513
|
|
- @property
|
514
|
|
- def type(self):
|
515
|
|
- return self.id
|
516
|
|
-
|
517
|
|
- def __init__(self, type):
|
518
|
|
- self.id = type
|
519
|
|
- # TODO - G.M - 10-04-2018 - [Cleanup] Drop this
|
520
|
|
- # self.icon = ContentType._CSS_ICONS[type]
|
521
|
|
- # self.color = ContentType._CSS_COLORS[type] # deprecated
|
522
|
|
- # self.css = ContentType._CSS_COLORS[type]
|
523
|
|
- # self.label = ContentType._LABEL[type]
|
524
|
|
- self.priority = ContentType._ORDER_WEIGHT[type]
|
525
|
|
-
|
526
|
|
- def toDict(self):
|
527
|
|
- return dict(id=self.type,
|
528
|
|
- type=self.type,
|
529
|
|
- # TODO - G.M - 10-04-2018 - [Cleanup] Drop this
|
530
|
|
- # icon=self.icon,
|
531
|
|
- # color=self.color,
|
532
|
|
- # label=self.label,
|
533
|
|
- priority=self.priority)
|
534
|
|
-
|
|
292
|
+from .contents import ContentStatusLegacy as ContentStatus
|
|
293
|
+from .contents import ContentTypeLegacy as ContentType
|
|
294
|
+# TODO - G.M - 30-05-2018 - Drop this old code when whe are sure nothing
|
|
295
|
+# is lost .
|
|
296
|
+
|
|
297
|
+
|
|
298
|
+# class ContentStatus(object):
|
|
299
|
+# """
|
|
300
|
+# Allowed status are:
|
|
301
|
+# - open
|
|
302
|
+# - closed-validated
|
|
303
|
+# - closed-invalidated
|
|
304
|
+# - closed-deprecated
|
|
305
|
+# """
|
|
306
|
+#
|
|
307
|
+# OPEN = 'open'
|
|
308
|
+# CLOSED_VALIDATED = 'closed-validated'
|
|
309
|
+# CLOSED_UNVALIDATED = 'closed-unvalidated'
|
|
310
|
+# CLOSED_DEPRECATED = 'closed-deprecated'
|
|
311
|
+#
|
|
312
|
+# # TODO - G.M - 10-04-2018 - [Cleanup] Drop this
|
|
313
|
+# # _LABELS = {'open': l_('work in progress'),
|
|
314
|
+# # 'closed-validated': l_('closed — validated'),
|
|
315
|
+# # 'closed-unvalidated': l_('closed — cancelled'),
|
|
316
|
+# # 'closed-deprecated': l_('deprecated')}
|
|
317
|
+# #
|
|
318
|
+# # _LABELS_THREAD = {'open': l_('subject in progress'),
|
|
319
|
+# # 'closed-validated': l_('subject closed — resolved'),
|
|
320
|
+# # 'closed-unvalidated': l_('subject closed — cancelled'),
|
|
321
|
+# # 'closed-deprecated': l_('deprecated')}
|
|
322
|
+# #
|
|
323
|
+# # _LABELS_FILE = {'open': l_('work in progress'),
|
|
324
|
+# # 'closed-validated': l_('closed — validated'),
|
|
325
|
+# # 'closed-unvalidated': l_('closed — cancelled'),
|
|
326
|
+# # 'closed-deprecated': l_('deprecated')}
|
|
327
|
+# #
|
|
328
|
+# # _ICONS = {
|
|
329
|
+# # 'open': 'fa fa-square-o',
|
|
330
|
+# # 'closed-validated': 'fa fa-check-square-o',
|
|
331
|
+# # 'closed-unvalidated': 'fa fa-close',
|
|
332
|
+# # 'closed-deprecated': 'fa fa-warning',
|
|
333
|
+# # }
|
|
334
|
+# #
|
|
335
|
+# # _CSS = {
|
|
336
|
+# # 'open': 'tracim-status-open',
|
|
337
|
+# # 'closed-validated': 'tracim-status-closed-validated',
|
|
338
|
+# # 'closed-unvalidated': 'tracim-status-closed-unvalidated',
|
|
339
|
+# # 'closed-deprecated': 'tracim-status-closed-deprecated',
|
|
340
|
+# # }
|
|
341
|
+#
|
|
342
|
+# def __init__(self,
|
|
343
|
+# id,
|
|
344
|
+# # TODO - G.M - 10-04-2018 - [Cleanup] Drop this
|
|
345
|
+# # type=''
|
|
346
|
+# ):
|
|
347
|
+# self.id = id
|
|
348
|
+# # TODO - G.M - 10-04-2018 - [Cleanup] Drop this
|
|
349
|
+# # self.icon = ContentStatus._ICONS[id]
|
|
350
|
+# # self.css = ContentStatus._CSS[id]
|
|
351
|
+# #
|
|
352
|
+# # if type==ContentType.Thread:
|
|
353
|
+# # self.label = ContentStatus._LABELS_THREAD[id]
|
|
354
|
+# # elif type==ContentType.File:
|
|
355
|
+# # self.label = ContentStatus._LABELS_FILE[id]
|
|
356
|
+# # else:
|
|
357
|
+# # self.label = ContentStatus._LABELS[id]
|
|
358
|
+#
|
|
359
|
+#
|
|
360
|
+# @classmethod
|
|
361
|
+# def all(cls, type='') -> ['ContentStatus']:
|
|
362
|
+# # TODO - G.M - 10-04-2018 - [Cleanup] Drop this
|
|
363
|
+# # all = []
|
|
364
|
+# # all.append(ContentStatus('open', type))
|
|
365
|
+# # all.append(ContentStatus('closed-validated', type))
|
|
366
|
+# # all.append(ContentStatus('closed-unvalidated', type))
|
|
367
|
+# # all.append(ContentStatus('closed-deprecated', type))
|
|
368
|
+# # return all
|
|
369
|
+# status_list = list()
|
|
370
|
+# for elem in cls.allowed_values():
|
|
371
|
+# status_list.append(ContentStatus(elem))
|
|
372
|
+# return status_list
|
|
373
|
+#
|
|
374
|
+# @classmethod
|
|
375
|
+# def allowed_values(cls):
|
|
376
|
+# # TODO - G.M - 10-04-2018 - [Cleanup] Drop this
|
|
377
|
+# # return ContentStatus._LABELS.keys()
|
|
378
|
+# return [
|
|
379
|
+# ContentStatus.OPEN,
|
|
380
|
+# ContentStatus.CLOSED_UNVALIDATED,
|
|
381
|
+# ContentStatus.CLOSED_VALIDATED,
|
|
382
|
+# ContentStatus.CLOSED_DEPRECATED
|
|
383
|
+# ]
|
|
384
|
+
|
|
385
|
+
|
|
386
|
+# class ContentType(object):
|
|
387
|
+# Any = 'any'
|
|
388
|
+#
|
|
389
|
+# Folder = 'folder'
|
|
390
|
+# File = 'file'
|
|
391
|
+# Comment = 'comment'
|
|
392
|
+# Thread = 'thread'
|
|
393
|
+# Page = 'page'
|
|
394
|
+# Event = 'event'
|
|
395
|
+#
|
|
396
|
+# # TODO - G.M - 10-04-2018 - [Cleanup] Do we really need this ?
|
|
397
|
+# # _STRING_LIST_SEPARATOR = ','
|
|
398
|
+#
|
|
399
|
+# # TODO - G.M - 10-04-2018 - [Cleanup] Drop this
|
|
400
|
+# # _ICONS = { # Deprecated
|
|
401
|
+# # 'dashboard': 'fa-home',
|
|
402
|
+# # 'workspace': 'fa-bank',
|
|
403
|
+# # 'folder': 'fa fa-folder-open-o',
|
|
404
|
+# # 'file': 'fa fa-paperclip',
|
|
405
|
+# # 'page': 'fa fa-file-text-o',
|
|
406
|
+# # 'thread': 'fa fa-comments-o',
|
|
407
|
+# # 'comment': 'fa fa-comment-o',
|
|
408
|
+# # 'event': 'fa fa-calendar-o',
|
|
409
|
+# # }
|
|
410
|
+# #
|
|
411
|
+# # _CSS_ICONS = {
|
|
412
|
+# # 'dashboard': 'fa fa-home',
|
|
413
|
+# # 'workspace': 'fa fa-bank',
|
|
414
|
+# # 'folder': 'fa fa-folder-open-o',
|
|
415
|
+# # 'file': 'fa fa-paperclip',
|
|
416
|
+# # 'page': 'fa fa-file-text-o',
|
|
417
|
+# # 'thread': 'fa fa-comments-o',
|
|
418
|
+# # 'comment': 'fa fa-comment-o',
|
|
419
|
+# # 'event': 'fa fa-calendar-o',
|
|
420
|
+# # }
|
|
421
|
+# #
|
|
422
|
+# # _CSS_COLORS = {
|
|
423
|
+# # 'dashboard': 't-dashboard-color',
|
|
424
|
+# # 'workspace': 't-less-visible',
|
|
425
|
+# # 'folder': 't-folder-color',
|
|
426
|
+# # 'file': 't-file-color',
|
|
427
|
+# # 'page': 't-page-color',
|
|
428
|
+# # 'thread': 't-thread-color',
|
|
429
|
+# # 'comment': 't-thread-color',
|
|
430
|
+# # 'event': 't-event-color',
|
|
431
|
+# # }
|
|
432
|
+#
|
|
433
|
+# _ORDER_WEIGHT = {
|
|
434
|
+# 'folder': 0,
|
|
435
|
+# 'page': 1,
|
|
436
|
+# 'thread': 2,
|
|
437
|
+# 'file': 3,
|
|
438
|
+# 'comment': 4,
|
|
439
|
+# 'event': 5,
|
|
440
|
+# }
|
|
441
|
+#
|
|
442
|
+# # TODO - G.M - 10-04-2018 - [Cleanup] Drop this
|
|
443
|
+# # _LABEL = {
|
|
444
|
+# # 'dashboard': '',
|
|
445
|
+# # 'workspace': l_('workspace'),
|
|
446
|
+# # 'folder': l_('folder'),
|
|
447
|
+# # 'file': l_('file'),
|
|
448
|
+# # 'page': l_('page'),
|
|
449
|
+# # 'thread': l_('thread'),
|
|
450
|
+# # 'comment': l_('comment'),
|
|
451
|
+# # 'event': l_('event'),
|
|
452
|
+# # }
|
|
453
|
+# #
|
|
454
|
+# # _DELETE_LABEL = {
|
|
455
|
+# # 'dashboard': '',
|
|
456
|
+# # 'workspace': l_('Delete this workspace'),
|
|
457
|
+# # 'folder': l_('Delete this folder'),
|
|
458
|
+# # 'file': l_('Delete this file'),
|
|
459
|
+# # 'page': l_('Delete this page'),
|
|
460
|
+# # 'thread': l_('Delete this thread'),
|
|
461
|
+# # 'comment': l_('Delete this comment'),
|
|
462
|
+# # 'event': l_('Delete this event'),
|
|
463
|
+# # }
|
|
464
|
+# #
|
|
465
|
+# # @classmethod
|
|
466
|
+# # def get_icon(cls, type: str):
|
|
467
|
+# # assert(type in ContentType._ICONS) # DYN_REMOVE
|
|
468
|
+# # return ContentType._ICONS[type]
|
|
469
|
+#
|
|
470
|
+# @classmethod
|
|
471
|
+# def all(cls):
|
|
472
|
+# return cls.allowed_types()
|
|
473
|
+#
|
|
474
|
+# @classmethod
|
|
475
|
+# def allowed_types(cls):
|
|
476
|
+# return [cls.Folder, cls.File, cls.Comment, cls.Thread, cls.Page,
|
|
477
|
+# cls.Event]
|
|
478
|
+#
|
|
479
|
+# @classmethod
|
|
480
|
+# def allowed_types_for_folding(cls):
|
|
481
|
+# # This method is used for showing only "main"
|
|
482
|
+# # types in the left-side treeview
|
|
483
|
+# return [cls.Folder, cls.File, cls.Thread, cls.Page]
|
|
484
|
+#
|
|
485
|
+# # TODO - G.M - 10-04-2018 - [Cleanup] Drop this
|
|
486
|
+# # @classmethod
|
|
487
|
+# # def allowed_types_from_str(cls, allowed_types_as_string: str):
|
|
488
|
+# # allowed_types = []
|
|
489
|
+# # # HACK - THIS
|
|
490
|
+# # for item in allowed_types_as_string.split(ContentType._STRING_LIST_SEPARATOR):
|
|
491
|
+# # if item and item in ContentType.allowed_types_for_folding():
|
|
492
|
+# # allowed_types.append(item)
|
|
493
|
+# # return allowed_types
|
|
494
|
+# #
|
|
495
|
+# # @classmethod
|
|
496
|
+# # def fill_url(cls, content: 'Content'):
|
|
497
|
+# # # TODO - DYNDATATYPE - D.A. - 2014-12-02
|
|
498
|
+# # # Make this code dynamic loading data types
|
|
499
|
+# #
|
|
500
|
+# # if content.type==ContentType.Folder:
|
|
501
|
+# # return '/workspaces/{}/folders/{}'.format(content.workspace_id, content.content_id)
|
|
502
|
+# # elif content.type==ContentType.File:
|
|
503
|
+# # return '/workspaces/{}/folders/{}/files/{}'.format(content.workspace_id, content.parent_id, content.content_id)
|
|
504
|
+# # elif content.type==ContentType.Thread:
|
|
505
|
+# # return '/workspaces/{}/folders/{}/threads/{}'.format(content.workspace_id, content.parent_id, content.content_id)
|
|
506
|
+# # elif content.type==ContentType.Page:
|
|
507
|
+# # return '/workspaces/{}/folders/{}/pages/{}'.format(content.workspace_id, content.parent_id, content.content_id)
|
|
508
|
+# #
|
|
509
|
+# # @classmethod
|
|
510
|
+# # def fill_url_for_workspace(cls, workspace: Workspace):
|
|
511
|
+# # # TODO - DYNDATATYPE - D.A. - 2014-12-02
|
|
512
|
+# # # Make this code dynamic loading data types
|
|
513
|
+# # return '/workspaces/{}'.format(workspace.workspace_id)
|
|
514
|
+#
|
|
515
|
+# @classmethod
|
|
516
|
+# def sorted(cls, types: ['ContentType']) -> ['ContentType']:
|
|
517
|
+# return sorted(types, key=lambda content_type: content_type.priority)
|
|
518
|
+#
|
|
519
|
+# @property
|
|
520
|
+# def type(self):
|
|
521
|
+# return self.id
|
|
522
|
+#
|
|
523
|
+# def __init__(self, type):
|
|
524
|
+# self.id = type
|
|
525
|
+# # TODO - G.M - 10-04-2018 - [Cleanup] Drop this
|
|
526
|
+# # self.icon = ContentType._CSS_ICONS[type]
|
|
527
|
+# # self.color = ContentType._CSS_COLORS[type] # deprecated
|
|
528
|
+# # self.css = ContentType._CSS_COLORS[type]
|
|
529
|
+# # self.label = ContentType._LABEL[type]
|
|
530
|
+# self.priority = ContentType._ORDER_WEIGHT[type]
|
|
531
|
+#
|
|
532
|
+# def toDict(self):
|
|
533
|
+# return dict(id=self.type,
|
|
534
|
+# type=self.type,
|
|
535
|
+# # TODO - G.M - 10-04-2018 - [Cleanup] Drop this
|
|
536
|
+# # icon=self.icon,
|
|
537
|
+# # color=self.color,
|
|
538
|
+# # label=self.label,
|
|
539
|
+# priority=self.priority)
|
535
|
540
|
|
536
|
541
|
class ContentChecker(object):
|
537
|
542
|
|