1  



package
 hudsonfog.voc.media;

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.aspects.tags
.*;

22 



import

hudsonfog.voc.commerce.orders
.*;

23 



import

hudsonfog.voc.system.behavior
.*;

24 



import

hudsonfog.voc.model.recurrence
.*;

25 



import

hudsonfog.voc.model.portal
.*;

26 



import

hudsonfog.voc.system.parse
.*;

27 



import

hudsonfog.voc.aspects.commerce
.*;

28 



import

hudsonfog.voc.system.primitiveTypes
.*;

29 



import

hudsonfog.voc.system.security
.*;

30 



import

hudsonfog.voc.model.workflow
.*;

31 



import

hudsonfog.voc.system.XMLSchema
.*;

32 



33 



import

hudsonfog.voc.system.fog
.*;

34 



35 



36 



public

abstract

class
 gallery {

37 



38 



/**

39 


 * Picture - like photo, image, screenshot

40 


 */

41 


  @DavClass._avoidModificationTracking

42 


  @DavClass._viewCols(
"title, sender, dateTaken"
)

43 


  @DavClass._registerByEmail

44 


  @DavClass._hideControlPanelInView

45 


  @DavClass._gridCols(
"title"
)

46 


  @DavClass._hideControlPanelInEdit

47 


  @DavClass._horizontalNmbOfCols(
3
)

48 


  @DavClass._fileSystemAt(
"sender"
)

49 


  @DavClass._skipAccessControl

50 



public

static

class
 Pic 
extends

hudsonfog.voc.model.portal.Image

implements
 Submission, Trackable, Paging {

51 


         @_notSearchable

52 


         @_cloneOf(
"submittedBy"
)

53 


    @k@c 
public
 Contact                       sender;

54 


         @_avoidDisplaying

55 


      @s 
public
 String                        url;

56 


         @_resourceLink

57 


         @_displayNameElm

58 


         @_cloneOf(
"subject"
)

59 


      @c 
public
 String                        title;

60 


         @_showAsTab

61 


         @_displayTextInFull

62 


         @_option

63 


         @_displayInline

64 


      @s 
public
 String                        description;

65 


         @_notSearchable

66 


         @_cloneOf(
"dateSubmitted"
)

67 


    @k@c 
public
 dateTime                      dateTaken; 
//* when this message entered the system

68 



         @_imageWidth(
100
)

69 


      @s 
public
 Image                         thumbnail;

70 


         @_autoCreateFromOriginalImage(
false
)

71 


         @_imageFormat(
"jpeg"
)

72 


      @s 
public
 Image                         image;

73 


         @_readOnly(
false
)

74 


         @_immutable

75 


      @s 
public
 Image                         originalImage;

76 


         @_imageWidth(
150
)

77 


      @s 
public
 Image                         featured;

78 


      @s 
public

tags
                          tags; 
//* keywords describing this picture

79 



         @_backLink(
"forResource"
)

80 


         @_cloneOf(
"readHistory"
)

81 


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

82 



         @_notSearchable

83 


         @_oldName(
"viewCount"
)

84 


         @_allowRoles(
"admin"
)

85 


      @c 
public
 Integer                       readHistoryCount;

86 


         @_backLink(
"forResource"
)

87 


         @_cloneOf(
"myLastRead"
)

88 


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

89 



         @_avoidDisplayingInView

90 


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

91 



         @_readOnly

92 


         @_avoidDisplaying

93 


      @c 
public
 Pic                           next;

94 


         @_readOnly

95 


         @_avoidDisplaying

96 


      @c 
public
 Pic                           previous;

97 


         @_avoidDisplaying

98 


      @s 
public
 FileSystem                    forResource;

99 


         @_notSearchable

100


         @_backLink(
"forum"
)

101


      @s 
public
 Subscribed[]                  subscribers;

102


         @_notSearchable

103


      @s 
public
 Contact                       owner;

104


         @_notSearchable

105


      @s 
public
 String                        mimeType;

106


         @_notSearchable

107


      @s 
public
 dateTime                      touched;

108


         @_notSearchable

109


      @s 
public
 Modification                  lastModification;

110


         @_notSearchable

111


      @s 
public
 dateTime                      lastModified;

112


         @_notSearchable

113


      @s 
public
 ComplexDate                   lastCommentTime;

114


      @s 
public
 String                        name;

115


  }

116



117


  @DavClass._nmbResourcesInGridRow(
6
)

118


  @DavClass._viewCols(
"title, sender, dateTaken, area, description, readHistoryCount, size"
)

119


  @DavClass._gridCols(
"title"
)

120


  @DavClass._nmbResourcesInFeaturedGridRow(
5
)

121



public

static

class
 Photo 
extends
 Pic 
implements
 Exif, SoftBuyable {

122


    @k@s 
public
 Contact                       sender;

123


         @_resourceLink

124


         @_displayNameElm

125


         @_skipLabelInGrid

126


      @s 
public
 String                        title;

127


         @_sortAscending(
false
)

128


         @_skipLabelInGrid

129


    @k@s 
public
 dateTime                      dateTaken;

130


         @_maxSize(
200
)

131


         @_notSearchable

132



public
 String                        area; 
//* subject that is pictured on this screenshot, e.g area of the site, feature, component, etc.

133



         @_disableRightClick(
false
)

134


         @_autoCreateFromOriginalImage

135


         @_addWatermark

136


      @s 
public
 Image                         image = writeJS(
""
);

137


         @_disableRightClick

138


         @_autoCreateFromOriginalImage

139


         @_addWatermark(
false
)

140


      @s 
public
 Image                         thumbnail;

141


         @_disableRightClick

142


         @_autoCreateFromOriginalImage

143


         @_addWatermark(
false
)

144


      @s 
public
 Image                         featured;

145


         @_readOnly

146



public
 fixedColor                    dominantColor;

147


         @_readOnly

148


         @_avoidDisplaying

149



public
 Integer                       dominantColorWeight;

150


         @_readOnly

151


         @_avoidDisplaying

152


      @c 
public
 Money                         price = writeJS(
"getPrice()"
);

153


      @c 
public
 String                        exifDescription;

154


      @c 
public
 dateTime                      photoDateTaken;

155


      @c 
public
 String                        make;

156


      @c 
public
 String                        model;

157


      @c 
public
 Integer                       xResolution;

158


      @c 
public
 Integer                       yResolution;

159


      @c 
public
 Float                         latitude;

160


      @c 
public
 Float                         longitude;

161


         @_option

162



public
 String                        resolution = formulaJS(
"imageWidth + ' X ' + imageHeight"
);

163


         @_readOnly

164


         @_noLink

165


         @_notSearchable

166


         @_backLink(
"product"
)

167



public
 PhotoOrderItem[]              items;

168


         @_abstract

169


         @_option

170



public
 License                       license = formulaJS(
"makeUri('name=Extended')"
);

171


  }

172



173



public

static

class
 PhotoOrderItem 
extends

hudsonfog.voc.commerce.orders.OrderItem
 {

174


         @_autoCreate

175


    @k@s 
public
 Order                         order;

176


    @k@s 
public
 Integer                       seq;

177


         @_immutable

178


      @s 
public
 Integer                       quantity;

179


  }

180



181


  @DavClass._viewCols(
"name, dimension"
)

182


  @DavClass._skipAccessControl

183



public

static

class
 License {

184


         @_displayNameElm

185


      @k 
public
 String                        name;

186


         @_label(
"Dimension in Megapixel (about)"
)

187



public
 String                        dimension;

188


         @_displayNameElm

189



public
 Money                         price;

190


         @_label(
"Uses"
)

191


         @_propertyGroupList(
"screensaver, webSiteBlogIllustration, electronicDocumentReport, multimediaPresentation, digitalAdvertising, pressArticle, bookLeaflet, printAdvertising, printedDocument, posterResale, mugsTshirtResale, derivativeResaleObjects"
)

192


         @_abstract

193


         @_propertyGroup(
"true"
)

194



public
 Boolean                       group1;

195


         @_colorCoding(
"'True' icons/ok.gif; 'False' icons/notok.gif"
)

196



public
 Boolean                       screensaver;

197


         @_label(
"Web Site / Blog Illustration"
)

198


         @_colorCoding(
"'True' icons/ok.gif; 'False' icons/notok.gif"
)

199



public
 Boolean                       webSiteBlogIllustration;

200


         @_label(
"Electronic Document / Report"
)

201


         @_colorCoding(
"'True' icons/ok.gif; 'False' icons/notok.gif"
)

202



public
 Boolean                       electronicDocumentReport;

203


         @_colorCoding(
"'True' icons/ok.gif; 'False' icons/notok.gif"
)

204



public
 Boolean                       multimediaPresentation;

205


         @_colorCoding(
"'True' icons/ok.gif; 'False' icons/notok.gif"
)

206



public
 Boolean                       digitalAdvertising;

207


         @_colorCoding(
"'True' icons/ok.gif; 'False' icons/notok.gif"
)

208



public
 Boolean                       pressArticle;

209


         @_label(
"Book / Leaflet"
)

210


         @_colorCoding(
"'True' icons/ok.gif; 'False' icons/notok.gif"
)

211



public
 Boolean                       bookLeaflet;

212


         @_colorCoding(
"'True' icons/ok.gif; 'False' icons/notok.gif"
)

213



public
 Boolean                       printAdvertising;

214


         @_colorCoding(
"'True' icons/ok.gif; 'False' icons/notok.gif"
)

215



public
 Boolean                       printedDocument;

216


         @_colorCoding(
"'True' icons/ok.gif; 'False' icons/notok.gif"
)

217



public
 Boolean                       printedDecoration;

218


         @_colorCoding(
"'True' icons/ok.gif; 'False' icons/notok.gif"
)

219



public
 Boolean                       posterResale;

220


         @_label(
"Mugs / T-shirt Resale"
)

221


         @_colorCoding(
"'True' icons/ok.gif; 'False' icons/notok.gif"
)

222



public
 Boolean                       mugsTshirtResale;

223


         @_colorCoding(
"'True' icons/ok.gif; 'False' icons/notok.gif"
)

224



public
 Boolean                       derivativeResaleObjects;

225


         @_label(
"Options"
)

226


         @_propertyGroupList(
"exclusivity"
)

227


         @_abstract

228


         @_propertyGroup(
"true"
)

229



public
 Boolean                       group2;

230


         @_colorCoding(
"'True' icons/ok.gif; 'False' icons/notok.gif"
)

231



public
 Boolean                       exclusivity;

232


  }

233



234



/**

235


 * Postcard from SeconLife - see http://secondlife.com

236


 */

237


  @DavClass._label(
"Second Life Postcard"
)

238


  @DavClass._nmbResourcesInGridRow(
3
)

239


  @DavClass._viewCols(
"info"
)

240


  @DavClass._gridCols(
"place, dateTaken"
)

241


  @DavClass._nmbResourcesInRow(
2
)

242


  @DavClass._horizontalFilterOnly

243



public

static

class
 SL 
extends
 Pic {

244


    @k@s 
public
 Contact                       sender;

245


         @_propertyGroupList(
"title, place, dateTaken, teleport"
)

246


         @_abstract

247


         @_propertyGroup(
"true"
)

248



public
 Boolean                       info;

249


         @_displayNameElm

250


         @_skipLabelInGrid

251


      @s 
public
 String                        title;

252


         @_maxSize(
250
)

253



public
 String                        place; 
//* place in SeconLife where this postcard was taken

254



         @_sortAscending(
false
)

255


         @_skipLabelInGrid

256


    @k@s 
public
 dateTime                      dateTaken;

257



public
 href                          teleport; 
//* location in SecondLife - click to be teleported there

258



         @_removeFile

259


      @s 
public
 Image                         originalImage;

260


  }

261



262



public

static

interface
 Paging {

263



public
 DavResource                   previous = 
null
;

264



public
 DavResource                   next = 
null
;

265


  }

266


}

267