View | Details | Raw Unified | Return to bug 43961
Collapse All | Expand All

(-)neutron.js (-2 / +19 lines)
Lines 205-210 Link Here
205
  var rights = cocoon.request.get("rights");
205
  var rights = cocoon.request.get("rights");
206
  var mimeType = cocoon.request.get("mimeType");
206
  var mimeType = cocoon.request.get("mimeType");
207
207
208
  var width = cocoon.request.get("width");
209
  var height = cocoon.request.get("height");  
210
211
  cocoon.log.error("Width, height: " + width + ", " + height);   
212
208
  if (!uploadFile) {
213
  if (!uploadFile) {
209
    cocoon.sendStatus(403);
214
    cocoon.sendStatus(403);
210
    return;
215
    return;
Lines 216-221 Link Here
216
  var document = flowHelper.getPageEnvelope(cocoon).getDocument();
221
  var document = flowHelper.getPageEnvelope(cocoon).getDocument();
217
  var file = uploadHelper.save(cocoon.request, "upload-file"); 
222
  var file = uploadHelper.save(cocoon.request, "upload-file"); 
218
  var fileName = file.getName();
223
  var fileName = file.getName();
224
  var extent = file.length(); 
219
225
220
  var resolver = cocoon.getComponent(Packages.org.apache.excalibur.source.SourceResolver.ROLE);
226
  var resolver = cocoon.getComponent(Packages.org.apache.excalibur.source.SourceResolver.ROLE);
221
  var resourcesManager = new ResourcesManager(document);
227
  var resourcesManager = new ResourcesManager(document);
Lines 240-254 Link Here
240
    os.close();
246
    os.close();
241
  }
247
  }
242
248
249
  // remove tmp file 
250
  try {
251
    file["delete"](); 
252
  } catch(e) {}
243
253
254
244
  var metaFilePath = resolver.resolveURI(assetPath + ".meta");
255
  var metaFilePath = resolver.resolveURI(assetPath + ".meta");
245
  var metaOs = metaFilePath.getOutputStream();
256
  var metaOs = metaFilePath.getOutputStream();
246
257
247
  cocoon.processPipelineTo("createmetadata", {"mimeType" : mimeType, "title" : title, "creator": creator}, metaOs);
258
  if (width && height) {
259
    var dimensions = new Object(); 
260
    dimensions.width = width; 
261
    dimensions.height = height; 
262
    cocoon.processPipelineTo("createmetadata", {"mimeType" : mimeType, "extent" : extent, "title" : title, "creator": creator, "dimensions": dimensions }, metaOs);
263
  } else {
264
    cocoon.processPipelineTo("createmetadata", {"mimeType" : mimeType, "extent" : extent, "title" : title, "creator": creator }, metaOs);
265
  }
248
266
249
  metaOs.close();
267
  metaOs.close();
250
268
251
252
  var assetFile = new File(assetPath);
269
  var assetFile = new File(assetPath);
253
270
254
  if (assetFile.exists()) {
271
  if (assetFile.exists()) {

Return to bug 43961