Ticket #62 (closed enhancement: fixed)

Opened 7 years ago

Last modified 6 years ago

Document creation - Suggest a name based on uploaded file

Reported by: pjoulaud Owned by:
Priority: major Milestone:
Component: models & controllers Version:
Keywords: Cc:

Description

When we create a document, first ask user to designate a file to check-in.
If a file is designated, suggest the file name (without extension) as document name.

Change History

comment:1 Changed 7 years ago by pjoulaud

  • Milestone set to openPLM-1.0 Official release

comment:2 Changed 7 years ago by pjoulaud

  • Milestone changed from openPLM-1.0 Official release to openPLM-1.1

comment:3 Changed 7 years ago by pjoulaud

Up !

comment:4 follow-up: ↓ 6 Changed 7 years ago by pcosquer

Hi,

I think it's a bad idea since there are several corner cases difficult to handle:

  • Some documents can not have files (GoogleDoc?, Subversion...), but a user can change the type of document between a "classic" document and a "no files" document.
  • A user can switch between a document and a part (or a group), in that case, the upload form must appear/disappear and it will be disturbing
  • A document type may hide the name field and auto fill it according to a special rule (like the googledoc)
  • A user may select several files, which one should be chosen to update the name field?
  • What happens in case of an error:
    • if the creation form is not valid
    • if the file upload fails (broken connection, cancellation)
    • if the file is larger than the maximum file size
    • if the upload file form is empty (is it an error?)
    • if several files can be uploaded, a combination of these errors is possible...
  • "Create and attach":
    • should the file be uploaded, then the document attached or the other order?
    • currently, we redirect to the "doc-cad" page, how should we inform the user that its upload is successful?
  • What to do when the user delete the file or select another file:
    • Should we update the name field, even if the user has changed it

It also implies some design decisions:

  • Should we first upload the file, then create the document or first create the document, then upload the file
  • Should we upload and create in parallels (in that case, errors handling may be really hard to implement)
  • Currently, it is possible to create a document and then upload a file using a text browser, should we drop this support (think about accessibility)
  • Should we allow a user to upload several files (to be consistent with the current upload form)?

To implement this change, some technical details are relevant:

  • currently a file (documentfile) belongs to a document and the upload process refers to the document
  • DocumentController?.add_file requires a created document
  • the API implementation calls get_creation_form and it should not change as plugins do not need this feature


I'm not totally against this idea, but I'd like to have more details on how to implement it, and how to handle errors (which is always the most difficult part).


comment:5 Changed 7 years ago by pcosquer

Another important point: the user interface:

  • which form is first displayed
  • how errors are displayed
  • how the progress bar is displayed
  • javascript ???
  • ...

comment:6 in reply to: ↑ 4 ; follow-up: ↓ 7 Changed 7 years ago by pjoulaud

Replying to pcosquer:
Thank you for your deep and detailed analysis. Good job.
For your information, I saw this process in Youtube, when I uploaded a video.

  • Some documents can not have files (GoogleDoc?, Subversion...), but a user can change the type of document between a "classic" document and a "no files" document.
  • A user can switch between a document and a part (or a group), in that case, the upload form must appear/disappear and it will be disturbing

Some attributes appear and disappear depending on the type of object. The upload form can also appear/disappear. I don't see why it would be more disturbing.

  • A document type may hide the name field and auto fill it according to a special rule (like the googledoc)

Correct but googledoc is a "no file" document and I don't find any case with "with file" document and hidden name field.

  • A user may select several files, which one should be chosen to update the name field?

What do you think about restricting to only one file ? If user want more files he could upload them in a 2nd time.

  • What happens in case of an error:
    • if the creation form is not valid

Same behavure as today.

  • if the file upload fails (broken connection, cancellation)

No error message. Just no file in the document.

  • if the file is larger than the maximum file size

No error message. Just no file in the document.

  • if the upload file form is empty (is it an error?)

No, it isn't an error. The user should be free to upload or not a file during creation.

  • if several files can be uploaded, a combination of these errors is possible...

What do you think about restricting to only one file ?

  • "Create and attach":
    • should the file be uploaded, then the document attached or the other order?

I don't have any opinion.

  • currently, we redirect to the "doc-cad" page, how should we inform the user that its upload is successful?

I know you don't like that but must we inform the user ?

  • What to do when the user delete the file or select another file:
    • Should we update the name field, even if the user has changed it

My suggestion is for initial document creation. To make this process easier.

It also implies some design decisions:

  • Should we first upload the file, then create the document or first create the document, then upload the file
  • Should we upload and create in parallels (in that case, errors handling may be really hard to implement)

The answer is in your comments about technical details : first create the document, then upload the file.

  • Currently, it is possible to create a document and then upload a file using a text browser, should we drop this support (think about accessibility)

No, we should keep it.

  • Should we allow a user to upload several files (to be consistent with the current upload form)?

What do you think about restricting to only one file ?

I'm not totally against this idea, but I'd like to have more details on how to implement it, and how to handle errors (which is always the most difficult part).

I agree, we have to give more details, to discuss and decide. My concern is always to provide an easy and quick solution to the users. With this suggestion, the user could create a document just selecting one file and that's it. I saw it in Youtube and I think it would be an improvement even if we don't have all necessary error messages and if, sometimes, document is created without the requested file in it and without error message. If error happen, it would not be a regression, it would be at the same level as we have today.

I know it is difficult to implement. Thank you.

comment:7 in reply to: ↑ 6 Changed 7 years ago by pcosquer

Replying to pjoulaud:

Replying to pcosquer:
Thank you for your deep and detailed analysis. Good job.
For your information, I saw this process in Youtube, when I uploaded a video.

In youtube, you want to upload a video. In openPLM, you want to create a document to organize your data and work in team.

Some attributes appear and disappear depending on the type of object. The upload form can also appear/disappear. I don't see why it would be more disturbing.

It depends where the upload form is put, but a file field can not be so easily updated (without putting more javascript).

  • A document type may hide the name field and auto fill it according to a special rule (like the googledoc)

Correct but googledoc is a "no file" document and I don't find any case with "with file" document and hidden name field

  • A user may select several files, which one should be chosen to update the name field?

What do you think about restricting to only one file ? If user want more files he could upload them in a 2nd time.

In that case, it will be inconsistent with the other upload form (files tab).

  • What happens in case of an error:
    • if the creation form is not valid

Same behavure as today.

But should the upload continue ? What happens if the user aborts the creation ?

  • if the file upload fails (broken connection, cancellation)

No error message. Just no file in the document.

  • if the file is larger than the maximum file size

No error message. Just no file in the document.

Not possible. Why? this is just a non sense in terms of user experience.

  • currently, we redirect to the "doc-cad" page, how should we inform the user that its upload is successful?

I know you don't like that but must we inform the user ?

An upload can take several minutes or fail, so we must inform it. Do you want that youtube does not inform
you that your video was not uploaded ?

  • What to do when the user delete the file or select another file:
    • Should we update the name field, even if the user has changed it

My suggestion is for initial document creation. To make this process easier.

Yes, but the user can change the file before submitting the form.

It also implies some design decisions:

  • Should we first upload the file, then create the document or first create the document, then upload the file
  • Should we upload and create in parallels (in that case, errors handling may be really hard to implement)

The answer is in your comments about technical details : first create the document, then upload the file.

But the creation page redirects to the files tab. Should we wait for a complete upload before showing this page ?

I'm not totally against this idea, but I'd like to have more details on how to implement it, and how to handle errors (which is always the most difficult part).

I agree, we have to give more details, to discuss and decide. My concern is always to provide an easy and quick solution to the users. With this suggestion, the user could create a document just selecting one file and that's it. I saw it in Youtube and I think it would be an improvement even if we don't have all necessary error messages and if, sometimes, document is created without the requested file in it and without error message. If error happen, it would not be a regression, it would be at the same level as we have today.

My concern is to not create more problems. I think it still lack a lot of specifications. Errors handling is not an optional features, it is a must have (security, user experience, consistency of the PLM).

The current solution is not slow. It take the same number of clicks that your idea.

I know it is difficult to implement. Thank you.

And without any specifications it is really hard to implement. And "other web site does it" is not a specification.

comment:8 Changed 7 years ago by pcosquer

  • Status changed from new to infoneeded_new

comment:9 Changed 6 years ago by pcosquer

  • Status changed from infoneeded_new to new
  • Milestone changed from openPLM-1.1 Official Release to openPLM-1.2 Official Release

comment:10 Changed 6 years ago by pcosquer

In [1959/main]:

Add a small button: "upload" to upload a file and then create a document

New urls: /user/{username]/files/[_up/|add/|up/] to upload a file and handle progress

New view: upload_and_create: like add_file but redirects to document creation
Updated views:

  • create_object: handles files (restriction of document)
  • add_file: redirects to creation page if current object is a User
  • ajax.creation_form: handles files


New template: users/files.html
Updated templates:

  • base.html: adds upload button and cleans up navigation bar
  • supermenu.html: adds upload button

forms: refactor get_creation_form
controllers:

  • Document: adds private files after a creation

see #62 and see #174

comment:11 Changed 6 years ago by pcosquer

  • Status changed from new to closed
  • Resolution set to fixed
Note: See TracTickets for help on using tickets.