1  



package
 hudsonfog.voc.model;

2  



3  



import
 com.fogx.webdav.DavResource;

4  



import
 com.fogx.webdav.DavClass;

5  



import
 com.fogx.webdav.DavBean;

6  



import
 com.fogx.webdav.DavProperty;

7  



import

static
 com.fogx.webdav.DavProperty.*;

8  



import
 com.fogx.webdav.packages.DavBeanPackage;

9  



import
 com.fogx.webdav.util.DavResourceSupport;

10 



import
 com.fogx.webdav.util.UrlUtil;

11 



import
 java.util.Date;

12 



import
 java.util.Map;

13 



import
 java.util.HashMap;

14 



import
 java.util.List;

15 



import
 java.util.Collections;

16 



import
 java.util.Arrays;

17 



18 



import

hudsonfog.voc.system.changeHistory
.*;

19 



import

hudsonfog.voc.model.company
.*;

20 



import

hudsonfog.voc.system.readHistory
.*;

21 



import

hudsonfog.voc.model.products
.*;

22 



import

hudsonfog.voc.aspects.tags
.*;

23 



import

hudsonfog.voc.model.recurrence
.*;

24 



import

hudsonfog.voc.model.portal
.*;

25 



import

hudsonfog.voc.system.parse
.*;

26 



import

hudsonfog.voc.model.crm
.*;

27 



import

hudsonfog.voc.system.primitiveTypes
.*;

28 



import

hudsonfog.voc.system.security
.*;

29 



import

hudsonfog.voc.model.workflow
.*;

30 



import

hudsonfog.voc.model.top
.*;

31 



import

hudsonfog.voc.system.XMLSchema
.*;

32 



33 



import

hudsonfog.voc.system.fog
.*;

34 



35 



36 



public

abstract

class
 crm {

37 



38 



/**

39 


 * A sales lead

40 


 */

41 


  @DavClass._showTreeControlInView

42 



public

static

class
 Lead 
extends

hudsonfog.voc.model.top.Demand

implements
 Trackable {

43 


         @_subPropertyOf(
"synopsis"
)

44 


    @k@s 
public
 String                        title;

45 


    @k@s 
public
 ComplexDate                   dateSubmitted;

46 



public
 Contact                       referer;

47 



public
 Contact                       client;

48 



public
 LeadStatus                    status;

49 



public
 Duplicate                     duplicatesThis; 
//* Lead that was already recorded, so this one is a duplicate

50 



         @_backLink(
"forResource"
)

51 


         @_cloneOf(
"readHistory"
)

52 


      @c 
public
 TrackedRead[]                 views; 
//* who looked at this resource

53 



         @_backLink(
"forResource"
)

54 


         @_cloneOf(
"myLastRead"
)

55 


      @c 
public
 TrackedRead[]                 myView; 
//* my last look at this resource

56 



      @c 
public
 Integer                       alreadyViewedByMe; 
//* marked if I opened to view this resource at least once

57 



  }

58 



59 



public

static
 enum LeadStatus {

60 


    New, Approved, Bad, Duplicate, Closed;

61 


  }

62 



63 



/**

64 


 * An issue corresponding to some product or activity

65 


 */

66 


  @DavClass._largeIcon(
"icons/classes/Issue-large.gif"
)

67 


  @DavClass._viewCols(
"synopsis, priority, description, assignedTo, submittedBy, dateSubmitted, touched, myUnreadMessages, myFlaggedMessages, status, sizeOfAttachments, attachments, alreadyViewedByMe"
)

68 


  @DavClass._editCols(
"synopsis, priority, description, assignedTo, client, status"
)

69 


  @DavClass._showTreeControlInView

70 


  @DavClass._icon(
"icons/classes/Issue.gif"
)

71 



public

static

class
 Issue 
extends

hudsonfog.voc.model.top.Need

implements
 WorkItem, AccessControl, Trackable, Taggable {

72 


         @_displayNameElm

73 


    @k@s 
public
 String                        synopsis; 
//* brief description on an issue

74 



    @k@s 
public
 ComplexDate                   dateSubmitted;

75 


         @_colorCoding(
"'Open' icons/status_open.gif; 'Closed' icons/status_resolved.gif; 'Pending' icons/status_inprogress.gif; 'Postponed' icons/status_postponed.gif; 'Cancelled' icons/status_cancelled.gif"
)

76 


         @_onCreate

77 


      @c 
public
 IssueStatus                   status = writeJS(
"(status == null) ? 'Open' : status"
);

78 


         @_onCreate 
// company of the submitter (if not site owner or set explicitely)

79 




public
 ExternalOrganization          client = writeJS(
"getClient()"
); 
//* client that is affected by this issue

80 



      @c 
public
 Contact                       assignedTo;

81 


         @_onCreate

82 


      @c 
public
 AccessLevel                   accessLevel = writeJS(
"accessLevel ? accessLevel : isSiteOwner() ? 'Site owner' : null"
); 
//* if 'site owner' - will be shown only to internal people.

83 



         @_backLink(
"associatedWith"
)

84 


      @s 
public
 Message[]                     myUnreadMessages;

85 


         @_backLink(
"associatedWith"
)

86 


      @s 
public
 Message[]                     myFlaggedMessages;

87 


         @_maxDisplayInplace(
5
)

88 


         @_backLink(
"duplicate"
)

89 



public
 Duplicate[]                   duplicatesThese; 
//* this issue was already recorded in the past, so this one is a duplicate

90 



         @_maxDisplayInplace(
5
)

91 


         @_backLink(
"duplicateOf"
)

92 



public
 DuplicateOfMe[]               theyDuplicateMe; 
//* issues that were recorded after this one and are duplicates of it

93 



         @_backLink(
"forResource"
)

94 


         @_cloneOf(
"readHistory"
)

95 


      @c 
public
 TrackedRead[]                 views; 
//* who looked at this resource

96 



         @_backLink(
"forResource"
)

97 


         @_cloneOf(
"myLastRead"
)

98 


      @c 
public
 TrackedRead[]                 myView; 
//* my last look at this resource

99 



      @c 
public
 Integer                       alreadyViewedByMe; 
//* marked if I opened to view this resource at least once

100



      @c 
public

tags
                          tags;

101


         @_backLink(
"taggable"
)

102


      @c 
public
 TagUse[]                      tagUse;

103


  }

104



105



public

static
 enum IssueStatus {

106


    Open, Pending, Postponed, Cancelled, Closed;

107


  }

108



109



/**

110


 * Trouble ticket

111


 */

112


  @DavClass._largeIcon(
"icons/classes/SupportIssue-large.gif"
)

113


  @DavClass._icon(
"icons/classes/SupportIssue.gif"
)

114



public

static

class
 SupportIssue 
extends
 Issue {

115


         @_displayNameElm

116


    @k@s 
public
 String                        synopsis;

117


    @k@s 
public
 ComplexDate                   dateSubmitted;

118


         @_allowRoles(
"owner"
) 
// users that open issues should not see internal workflow

119



      @s 
public
 Contact                       assignedTo;

120



public
 String                        area; 
//* problem area (zone of the site, component, application)

121



         @_allowRoles(
"owner"
) 
// users need not see this flag

122




public
 Boolean                       partOfknowledgeBase; 
//* some issues are important to set aside as part of knowledge base

123



         @_avoidDisplayingInControlPanel

124


         @_backLink(
"forResource"
)

125


         @_displayInline

126



public
 Image[]                       photos;

127


  }

128


}

129