[Mayan EDMS: 1223] Re: Document renaming app

2016-01-12 Thread Roberto Rosario
The bug in the app was fixed, if no new bugs are discovered release 2 will 
happen in a few days.

On Tuesday, January 12, 2016 at 4:45:58 AM UTC-4, Roberto Rosario wrote:
>
> Document stubs are just a blank entry in the database until the upload 
> finishes. This gives you at least an ID that you can use via the API to 
> assign tab, metadata, etc until the backend finishes. By the behavior you 
> mention this appears to be a bug in the app. Thanks for reporting this.
>
> Issue link: https://gitlab.com/mayan-edms/document_renaming/issues/5
>
> On Friday, January 8, 2016 at 12:11:44 PM UTC-4, LeVon Smoker wrote:
>>
>> I added this app to my installation, but then I realized that all 
>> documents I uploaded had names like 'Document stub, id: 9' instead of the 
>> uploaded file name (even with no renaming templates defined). Disabling the 
>> app in settings/local.py fixed the problem.
>>
>> Is this a bug or is there something that I need to configure after 
>> installing the document_renaming app?
>>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Mayan EDMS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mayan-edms+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Mayan EDMS: 1222] Automatically Calculate Document Number

2016-01-12 Thread Roberto Rosario
Sorry about that. The code was just a test using the Python shell. I've 
updated the app code 
(https://gitlab.com/mayan-edms/document_renaming/commit/b09bf4a8dadf381cd8b54cb5f452119db8173a4f)
 
and now sequences can be created automatically with a rename template like 
this:

{% set username = document.target_actions.first().actor.username %}{{ username 
}}-{{ 
"%05d"|format(Sequence.objects.get_or_create(slug=username,label=username)[0].next_value())
 }}



The first part extracts the document event log, gets the first entry and 
stores the actor's username string in a variable called username.
The second part renders the username wih a dash.
The final part tries to the sequence with the username and if it is not 
available creates it. Since get_or_created returns two values (a tuple), 
the actual sequence instance and a boolean if it was newly created, only 
the first value is retained using [0]. get_next() if called to get the 
value and advance the sequence. And everything is send as an argument to 
the 'format' template tag which behaves like Python's .format() and padded 
to 5 zeros.

Here are the tests for the new functionality: 
https://gitlab.com/mayan-edms/document_renaming/blob/master/document_renaming/tests/test_models.py#L104
If no new bugs are discovered release 2 can be done in the following days. 
Hope this helps.



On Tuesday, January 12, 2016 at 2:59:26 PM UTC-4, Rachael Sewell wrote:
>
> Hi Roberto,
>
> I’m still a little confused. Do I add the following to the 
> document_renaming model or the document model?
>
> from jinja2 import Template
> from document_renaming.models import Sequence
>
> document=Document.objects.first()
>
>
> Did you add the following code as the renaming template via the web 
> interface:
>
> Template('{% set user = document.target_actions.first().actor 
> %}{{user}}-{{ Sequence.objects.get(slug=user).next_value() 
> }}').render(document=document, Sequence=Sequence)
>
>
>
> Kind regards,
> Rachael
>
> On Jan 12, 2016, at 1:37 AM, Roberto Rosario <
> roberto.rosario.gonza...@gmail.com> wrote:
>
> Did a quick test and with Jinja2 it is possible:
>
> from jinja2 import Template
> from document_renaming.models import Sequence
>
> document=Document.objects.first()
>
> Template('{% set user = document.target_actions.first().actor 
> %}{{user}}-{{ Sequence.objects.get(slug=user).next_value() 
> }}').render(document=document, Sequence=Sequence)
>
>
> outputs:
>
> admin-1
>
> it is even possible to create the user sequences from the template (using 
> get_or_create):
>
> Template('{% set user = document.target_actions.first().actor 
> %}{{user}}-{{ Sequence.objects.get_or_create(slug=user)[0].next_value() 
> }}').render(document=document, Sequence=Sequence)
>
> On Tuesday, January 12, 2016 at 5:30:02 AM UTC-4, Roberto Rosario wrote:
>>
>> The UI, document upload and document renamer execute in different 
>> contexts, it is not possible for them to share the web session. The 
>> alternative would be to access the event log of the document and extract 
>> the first entry which would indicate the user who created the document and 
>> expose this to the context of the renaming template here: 
>> https://gitlab.com/mayan-edms/document_renaming/blob/master/document_renaming/models.py#L80
>>
>> The even log app uses Django activity stream (
>> https://github.com/justquick/django-activity-stream/blob/master/actstream/models.py)
>>  
>> and they provide a reverse reference. Something like 
>>
>> document.target_actions.first().actor 
>>
>> should give your the user instance.
>>
>> The second problem would be to get the user's sequence dynamically. 
>> Sequences are passed to the rename template's context as 'sequence_XXX' 
>> variables because Django's template engine doesn't allow parameter method 
>> calling.
>>
>> In my mind the easiest path would be to ditch Django's template engine 
>> and use something like Jinja2 (http://jinja.pocoo.org/) which allows 
>> method calls with parameters and the renaming template itself can contain 
>> all the required logic:
>>
>> {% set username = document.target_actions.first.actor.username %}  {{ 
>> username }}-{{ Sequence.objects.get(slug=%username%).next_value() }}
>>
>> Provided you have already the sequences created for each use. This is all 
>> from the top of my head without any actual test of course :)
>>
>>
>> On Friday, January 8, 2016 at 4:52:07 PM UTC-4, Rachael Sewell wrote:
>>>
>>> Roberto,
>>>
>>> I'm working with this app currently. I have two document types:
>>>
>>>1. Specs 
>>>2. Memos
>>>
>>> Memos will be renamed according to the logged in user. I would like to 
>>> create a number like this -. For example: 
>>> "rachael.sewell-00"
>>>
>>> I've tried a few things, but it seems the user is not accessible in the 
>>> view. Any pointers to where I should be updating code would be helpful to 
>>> add this. Thanks for the continued help.
>>>
>>> Rachael
>>>
>>> On Friday, December 18, 2015 at 10:34:13 AM UTC-8, R

[Mayan EDMS: 1221] Re: Gitlab code

2016-01-12 Thread Roberto Rosario
Hi,

Added you to the main repository at GitLab. The main branches: Master, 
Development, series/1.0 and series/2.0 are protected to avoid publishing 
errors, but can create new feature branches for specific features/work as 
needed. The branch layout follows a simplified model based on Git Flow: 
http://nvie.com/posts/a-successful-git-branching-model/ to help make them 
descriptive. 

Thanks for the help I appreciate it! 

On Monday, January 11, 2016 at 2:21:25 PM UTC-4, Rachael Sewell wrote:
>
> Roberto,
>
> I pulled the mayan code from the github page, but I know that you have 
> moved over to gitlab. Can you add me to the gitlab project so that I can 
> clone the repository. I'd also like to contribute back to the documentation 
> at http://mayan.readthedocs.org/. I've found a few issues where the old 
> documentation has more information that is still applicable to v2.0. 
> Additionally, I want to add instructions on how I integrated LDAP 
> authentication. 
>
> Thanks,
> Rachael
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Mayan EDMS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mayan-edms+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Mayan EDMS: 1220] Re: Attachment feature

2016-01-12 Thread Roberto Rosario
Hi,

Sadly there is nothing right now to automatically set a metadata value 
after the document is uploaded or renamed. A custom app would need to be 
created for this that would allow to define a macro or script.

On Friday, January 8, 2016 at 5:04:46 PM UTC-4, Rachael Sewell wrote:
>
> Hi Roberto,
>
> This works great. An additional requirement that I will need is to 
> automatically equate the DocNum metadata field to the document number 
> generated from the new document_renaming app. Is there a way to provide a 
> metadata field that is auto-populated?
>
> Rachael
>
> On Thursday, December 24, 2015 at 12:18:43 AM UTC-8, Roberto Rosario wrote:
>>
>> HI, I did a small lab and these are the steps (screen shots attached):
>>
>> - Create metadata types DocNum and CrossRef.
>> - Create the document types: Spec and Memo
>> - Add the metadata types (DocNum and CrossRef) to both document type (I 
>> added them as optional metadata for the demo, DocNum could be required in 
>> production).
>> - Create smart link as shown, add Dynamic Label: {{ 
>> document.metadata_value_of.CrossRef }} to display an easier to read title. 
>> If a static title is desired use a quoted string instead,
>> - Add the smart link to the document types.
>> - Create 2 conditions for the smart link, one to match the value of the 
>> source document's CrossRef metadata value to all other documents' metadata 
>> values. And another to match only the foreign documents' DocNum metadata 
>> type.
>>
>> Smart link results for each document will be available on the 'Smart 
>> Links' tab of the document. Some further tuning might be needed depending 
>> on your requirements such as assigning DocNum to Spec only and CrossRef to 
>> Memo, and assigning the smart link only to Memo doc type if you only need 
>> to reference Specs in Memos and not Memos in Specs.
>>
>> On Friday, December 18, 2015 at 3:08:40 PM UTC-4, Rachael Sewell wrote:
>>>
>>> Hi Roberto,
>>>
>>> Thanks for your answers. I'm having trouble configuring the smart links. 
>>> Here is what I want to do. 
>>>
>>> Document type: Spec
>>> MetaData Internal Name: DocNum; Value: 
>>> MetaData Internal Name: CrossRef; Value: 
>>>
>>> Document type: Memo
>>> MetaData Internal Name: DocNum; Value: 
>>> MetaData Internal Name: CrossRef; Value: 
>>>
>>> I want to create a smart link that will link a document of any type when 
>>> the CrossRef value matches the DocNum.
>>>
>>> Rachael
>>>
>>> On Wednesday, December 16, 2015 at 2:41:56 PM UTC-8, Roberto Rosario 
>>> wrote:

 Hi, thanks for considering Mayan EDMS for your project. 

 It is not possible to add attachments for document versions at the 
 moment. The closest feature already in place is smart links which allow 
 linking or referencing documents, but it is a document-centric link and 
 not 
 per version. Smart links work by creating rules based document properties 
 or metadata. There is no provision for manual creation of document links.

 Documents are not converted, they are stored in the document store 
 exactly as uploaded, only their filename is replace by an UUID to avoid 
 filename collisions. This is to avoid vendor lockin and preserve document 
 integrity (in documents used as evidence for legal cases for example). 
 Only 
 the document's visual representation is modified.

 There is a ticket to add subscription and notification for documents, 
 but it is still in an early stage. There is no roadmap yet for version 3.0 
 and this could be one of the features pushed for inclusion. 

 At one time there was an example in the FAQ how to integrate with LDAP, 
 it was remove as it became obsolete. Mayan uses Django (a Python web 
 framework) so any example on how to integrate Django with LDAP should work 
 with Mayan.

 Development work is always needed and appreciated, pull request and 
 tickets are welcomed for these or any other features, if they are not 
 integrated into the core implementation they can be developed as custom 
 app. Two examples started just a few days ago: 
 https://gitlab.com/mayan-edms/versionlifespan and 
 https://gitlab.com/mayan-edms/exif

 UI enhancements are much needed and now that we changed to a Bootstrap 
 based UI should be easier to implement, feel free to open another thread 
 to 
 discuss those.

 Thanks,

 --Roberto

 On Tuesday, December 15, 2015 at 2:36:02 PM UTC-4, Rachael Sewell wrote:
>
> Hello,
>
> I am evaluating SeedDMS, OpenDocMan, and Mayan-EDMS for an internal 
> company document management system. Many of the features that we need for 
> our basic requirements are included already. However, I'd like your 
> opinion 
> or roadmap for some additional features. 
>
> Our documents can contain any number of attachment documents. These 
> attachments are per version. Also, we c

[Mayan EDMS: 1219] Re: Django ORM

2016-01-12 Thread Roberto Rosario
Here is a snippet to get you started: 
https://gitlab.com/mayan-edms/mayan-edms/snippets/13221

   - On a production deployed install, create a folder named 'scripts' and 
   put this snippet inside it.
   - Add your access control list (role, document type, permissions) to the 
   line: https://gitlab.com/mayan-edms/mayan-edms/snippets/13221#L34
   - Make it executable with chmod +x.
   - Activate virtualenv if used.
   - Execute it.

The script uses `get_or_create` method so you can run it several time and 
it will only create the access lists once. I tested it with the install 
generated by the docker-compose method 
(https://gitlab.com/mayan-edms/mayan-edms-docker)


On Tuesday, January 12, 2016 at 4:47:16 PM UTC-4, LeVon Smoker wrote:
>
> I've had a few failed attempts at getting to the data through the Django 
> ORM. I'd like to get at the ACLs model so I can create a bunch of document 
> types (via a script) with varying roles and identical permissions lists.
>
> Is the ORM a reasonable way to do this?
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Mayan EDMS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mayan-edms+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Mayan EDMS: 1218] Django ORM

2016-01-12 Thread LeVon Smoker
I've had a few failed attempts at getting to the data through the Django 
ORM. I'd like to get at the ACLs model so I can create a bunch of document 
types (via a script) with varying roles and identical permissions lists.

Is the ORM a reasonable way to do this?

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Mayan EDMS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mayan-edms+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Mayan EDMS: 1216] Automatically Calculate Document Number

2016-01-12 Thread Rachael Sewell
Hi Roberto,

I’m still a little confused. Do I add the following to the document_renaming 
model or the document model?

> from jinja2 import Template
> from document_renaming.models import Sequence
> 
> document=Document.objects.first()

Did you add the following code as the renaming template via the web interface:

> Template('{% set user = document.target_actions.first().actor %}{{user}}-{{ 
> Sequence.objects.get(slug=user).next_value() }}').render(document=document, 
> Sequence=Sequence)


Kind regards,
Rachael

> On Jan 12, 2016, at 1:37 AM, Roberto Rosario 
>  wrote:
> 
> Did a quick test and with Jinja2 it is possible:
> 
> from jinja2 import Template
> from document_renaming.models import Sequence
> 
> document=Document.objects.first()
> 
> Template('{% set user = document.target_actions.first().actor %}{{user}}-{{ 
> Sequence.objects.get(slug=user).next_value() }}').render(document=document, 
> Sequence=Sequence)
> 
> 
> outputs:
> 
> admin-1
> 
> it is even possible to create the user sequences from the template (using 
> get_or_create):
> 
> Template('{% set user = document.target_actions.first().actor %}{{user}}-{{ 
> Sequence.objects.get_or_create(slug=user)[0].next_value() 
> }}').render(document=document, Sequence=Sequence)
> 
> On Tuesday, January 12, 2016 at 5:30:02 AM UTC-4, Roberto Rosario wrote:
> The UI, document upload and document renamer execute in different contexts, 
> it is not possible for them to share the web session. The alternative would 
> be to access the event log of the document and extract the first entry which 
> would indicate the user who created the document and expose this to the 
> context of the renaming template here: 
> https://gitlab.com/mayan-edms/document_renaming/blob/master/document_renaming/models.py#L80
>  
> 
> 
> The even log app uses Django activity stream 
> (https://github.com/justquick/django-activity-stream/blob/master/actstream/models.py
>  
> )
>  and they provide a reverse reference. Something like 
> 
> document.target_actions.first().actor 
> 
> should give your the user instance.
> 
> The second problem would be to get the user's sequence dynamically. Sequences 
> are passed to the rename template's context as 'sequence_XXX' variables 
> because Django's template engine doesn't allow parameter method calling.
> 
> In my mind the easiest path would be to ditch Django's template engine and 
> use something like Jinja2 (http://jinja.pocoo.org/ ) 
> which allows method calls with parameters and the renaming template itself 
> can contain all the required logic:
> 
> {% set username = document.target_actions.first.actor.username %}  {{ 
> username }}-{{ Sequence.objects.get(slug=%username%).next_value() }}
> 
> Provided you have already the sequences created for each use. This is all 
> from the top of my head without any actual test of course :)
> 
> 
> On Friday, January 8, 2016 at 4:52:07 PM UTC-4, Rachael Sewell wrote:
> Roberto,
> 
> I'm working with this app currently. I have two document types:
> Specs 
> Memos
> Memos will be renamed according to the logged in user. I would like to create 
> a number like this -. For example: 
> "rachael.sewell-00"
> 
> I've tried a few things, but it seems the user is not accessible in the view. 
> Any pointers to where I should be updating code would be helpful to add this. 
> Thanks for the continued help.
> 
> Rachael
> 
> On Friday, December 18, 2015 at 10:34:13 AM UTC-8, Rachael Sewell wrote:
> Hello,
> 
> I'd like to know if there is already a way to add an automatically created 
> document number to a document. For example I would like to start with a 
> initial document number of AN1 and increment (AN2, AN3) for each 
> additional doc. Does this functionality already exist? If not could it be 
> added to the core or would it need to be a custom application? Any pointers 
> on how to get started on this would be helpful as well. 
> 
> Thanks,
> Rachael
> 
> -- 
> 
> --- 
> You received this message because you are subscribed to a topic in the Google 
> Groups "Mayan EDMS" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/mayan-edms/HRy_us-jp10/unsubscribe 
> .
> To unsubscribe from this group and all its topics, send an email to 
> mayan-edms+unsubscr...@googlegroups.com 
> .
> For more options, visit https://groups.google.com/d/optout 
> .

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Mayan EDMS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mayan-edms+unsubscr...@googlegroups.com.
For more options, visit https://gr

[Mayan EDMS: 1216] Re: Suggestions for handling security

2016-01-12 Thread LeVon Smoker
Thanks very much. That's the direction I was going.

On Tuesday, January 12, 2016 at 3:20:04 AM UTC-5, Roberto Rosario wrote:
>
> Hi, thanks for trying out Mayan EDMS.
>
> Because any given document can be of only 1 document type, you would need 
> to add the department name as part of the document type label. 
> Also because these  permissions are for specific document types, grant the 
> permission to the role in the *document type ACL* not in the role 
> creation view (as there the permissions are global).
>
> Document type   Role
>
> --
> Global document   all roles -> document view, editors role -> upload, 
> checkin
> Department_1_docs dept_1_view -> document view, dept_1_editors -> 
> upload, checkin
> Department_2_docs dept_1_view -> document view, dept_1_editors -> 
> upload, checkin
>
> Example:
> Document types 
> --
> "Accounting - Invoices"   
> "Human resources - complaint" 
>
> Roles
> 
> "Accounting read only"
> "Accounting editors"
> "Human resources read only"
> "Human resources editors"
>
> Document type ACLs (document type vs. role + permissions)
> --
> "Accounting - Invoices" -> "Accounting read only" -> [document view]
> "Accounting - Invoices" -> "Accounting editor" -> [extra permissions]
> "Human resources - complaint" -> "Human resources read only" -> [document 
> view]
> "Human resources - complaint" -> "Human resources editors" -> [extra 
> permissions]
>
> Hope this setup works for you.
>
> On Thursday, January 7, 2016 at 1:32:34 PM UTC-4, LeVon Smoker wrote:
>>
>> We are deploying Mayan-EDMS. It seems to be very well-designed and 
>> flexible. Thanks Roberto (and others) for this excellent app!
>>
>> I am having trouble, though, in figuring out how to optimally set up 
>> roles/ACLs/groups/doctypes for the security setup that the management would 
>> like.
>>
>> I have our Active Directory groups mirrored so we can have some control 
>> within the AD management software. On a "permissions" level we envision 
>> Readers (view-only) and Editors (view/upload/checkin/out). We would like 
>> agency-wide documents to be viewable by all staff (Readers) and manageable 
>> (Editors) by a management group. We would also like for department-specific 
>> documents to be limited to that department (for viewing, ie, Readers) and 
>> then within that department have a team that can manage the documents 
>> (Editors).
>>
>> Is this way of doing security possible or do we need to simplify what we 
>> want?
>>
>> LeVon Smoker
>>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Mayan EDMS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mayan-edms+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Mayan EDMS: 1215] Re: Automatically Calculate Document Number

2016-01-12 Thread Roberto Rosario
Did a quick test and with Jinja2 it is possible:

from jinja2 import Template
from document_renaming.models import Sequence

document=Document.objects.first()

Template('{% set user = document.target_actions.first().actor %}{{user}}-{{ 
Sequence.objects.get(slug=user).next_value() }}').render(document=document, 
Sequence=Sequence)


outputs:

admin-1

it is even possible to create the user sequences from the template (using 
get_or_create):

Template('{% set user = document.target_actions.first().actor %}{{user}}-{{ 
Sequence.objects.get_or_create(slug=user)[0].next_value() 
}}').render(document=document, Sequence=Sequence)

On Tuesday, January 12, 2016 at 5:30:02 AM UTC-4, Roberto Rosario wrote:
>
> The UI, document upload and document renamer execute in different 
> contexts, it is not possible for them to share the web session. The 
> alternative would be to access the event log of the document and extract 
> the first entry which would indicate the user who created the document and 
> expose this to the context of the renaming template here: 
> https://gitlab.com/mayan-edms/document_renaming/blob/master/document_renaming/models.py#L80
>
> The even log app uses Django activity stream (
> https://github.com/justquick/django-activity-stream/blob/master/actstream/models.py)
>  
> and they provide a reverse reference. Something like 
>
> document.target_actions.first().actor 
>
> should give your the user instance.
>
> The second problem would be to get the user's sequence dynamically. 
> Sequences are passed to the rename template's context as 'sequence_XXX' 
> variables because Django's template engine doesn't allow parameter method 
> calling.
>
> In my mind the easiest path would be to ditch Django's template engine and 
> use something like Jinja2 (http://jinja.pocoo.org/) which allows method 
> calls with parameters and the renaming template itself can contain all the 
> required logic:
>
> {% set username = document.target_actions.first.actor.username %}  {{ 
> username }}-{{ Sequence.objects.get(slug=%username%).next_value() }}
>
> Provided you have already the sequences created for each use. This is all 
> from the top of my head without any actual test of course :)
>
>
> On Friday, January 8, 2016 at 4:52:07 PM UTC-4, Rachael Sewell wrote:
>>
>> Roberto,
>>
>> I'm working with this app currently. I have two document types:
>>
>>1. Specs 
>>2. Memos
>>
>> Memos will be renamed according to the logged in user. I would like to 
>> create a number like this -. For example: 
>> "rachael.sewell-00"
>>
>> I've tried a few things, but it seems the user is not accessible in the 
>> view. Any pointers to where I should be updating code would be helpful to 
>> add this. Thanks for the continued help.
>>
>> Rachael
>>
>> On Friday, December 18, 2015 at 10:34:13 AM UTC-8, Rachael Sewell wrote:
>>>
>>> Hello,
>>>
>>> I'd like to know if there is already a way to add an automatically 
>>> created document number to a document. For example I would like to start 
>>> with a initial document number of AN1 and increment (AN2, AN3) 
>>> for each additional doc. Does this functionality already exist? If not 
>>> could it be added to the core or would it need to be a custom application? 
>>> Any pointers on how to get started on this would be helpful as well. 
>>>
>>> Thanks,
>>> Rachael
>>>
>>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Mayan EDMS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mayan-edms+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Mayan EDMS: 1214] Re: Automatically Calculate Document Number

2016-01-12 Thread Roberto Rosario
The UI, document upload and document renamer execute in different contexts, 
it is not possible for them to share the web session. The alternative would 
be to access the event log of the document and extract the first entry 
which would indicate the user who created the document and expose this to 
the context of the renaming template here: 
https://gitlab.com/mayan-edms/document_renaming/blob/master/document_renaming/models.py#L80

The even log app uses Django activity stream 
(https://github.com/justquick/django-activity-stream/blob/master/actstream/models.py)
 
and they provide a reverse reference. Something like 

document.target_actions.first().actor 

should give your the user instance.

The second problem would be to get the user's sequence dynamically. 
Sequences are passed to the rename template's context as 'sequence_XXX' 
variables because Django's template engine doesn't allow parameter method 
calling.

In my mind the easiest path would be to ditch Django's template engine and 
use something like Jinja2 (http://jinja.pocoo.org/) which allows method 
calls with parameters and the renaming template itself can contain all the 
required logic:

{% set username = document.target_actions.first.actor.username %}  {{ 
username }}-{{ Sequence.objects.get(slug=%username%).next_value() }}

Provided you have already the sequences created for each use. This is all 
from the top of my head without any actual test of course :)


On Friday, January 8, 2016 at 4:52:07 PM UTC-4, Rachael Sewell wrote:
>
> Roberto,
>
> I'm working with this app currently. I have two document types:
>
>1. Specs 
>2. Memos
>
> Memos will be renamed according to the logged in user. I would like to 
> create a number like this -. For example: 
> "rachael.sewell-00"
>
> I've tried a few things, but it seems the user is not accessible in the 
> view. Any pointers to where I should be updating code would be helpful to 
> add this. Thanks for the continued help.
>
> Rachael
>
> On Friday, December 18, 2015 at 10:34:13 AM UTC-8, Rachael Sewell wrote:
>>
>> Hello,
>>
>> I'd like to know if there is already a way to add an automatically 
>> created document number to a document. For example I would like to start 
>> with a initial document number of AN1 and increment (AN2, AN3) 
>> for each additional doc. Does this functionality already exist? If not 
>> could it be added to the core or would it need to be a custom application? 
>> Any pointers on how to get started on this would be helpful as well. 
>>
>> Thanks,
>> Rachael
>>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Mayan EDMS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mayan-edms+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Mayan EDMS: 1213] Re: Document renaming app

2016-01-12 Thread Roberto Rosario
Document stubs are just a blank entry in the database until the upload 
finishes. This gives you at least an ID that you can use via the API to 
assign tab, metadata, etc until the backend finishes. By the behavior you 
mention this appears to be a bug in the app. Thanks for reporting this.

Issue link: https://gitlab.com/mayan-edms/document_renaming/issues/5

On Friday, January 8, 2016 at 12:11:44 PM UTC-4, LeVon Smoker wrote:
>
> I added this app to my installation, but then I realized that all 
> documents I uploaded had names like 'Document stub, id: 9' instead of the 
> uploaded file name (even with no renaming templates defined). Disabling the 
> app in settings/local.py fixed the problem.
>
> Is this a bug or is there something that I need to configure after 
> installing the document_renaming app?
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Mayan EDMS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mayan-edms+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Mayan EDMS: 1212] Re: Question about Vagrant Installation

2016-01-12 Thread Roberto Rosario
Hi,

The reason is being able to "see" local git commits inside the VM. The 
provision script uses the synchronized git directory when deploying 
(https://gitlab.com/mayan-edms/mayan-edms/blob/master/contrib/scripts/install/development.sh#L24).
 
If you select a branch and do a commit on the host, you can then test that 
commit on the VM by doing a git pull inside the deployed install 
(/home/vagrant/mayan). The goal is quick experimentation but on an 
homogeneous/predictable environment.

No problem at all, this is what this mailing list is for!

On Thursday, January 7, 2016 at 3:57:07 PM UTC-4, Rachael Sewell wrote:
>
> Hello,
>
> I'm currently using Vagrant for my development environment. I will likely 
> also use a virtual machine for deployment as well. I had a few questions 
> regarding the VM. I see that there are two mayan installations:
>
> 1) /home/vagrant/mayan-edms - this one appears to have already had the 
> initialsetup and venv created.
> 2) /mayan-edms-repository - this one is the directory synchronized to the 
> host machine. 
>
> What is the reason for the two separate installations? Thanks for being 
> patient with my novice questions:)
>
> Rachael
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Mayan EDMS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mayan-edms+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Mayan EDMS: 1211] Re: Suggestions for handling security

2016-01-12 Thread Roberto Rosario
Hi, thanks for trying out Mayan EDMS.

Because any given document can be of only 1 document type, you would need 
to add the department name as part of the document type label. 
Also because these  permissions are for specific document types, grant the 
permission to the role in the *document type ACL* not in the role creation 
view (as there the permissions are global).

Document type   Role
--
Global document   all roles -> document view, editors role -> upload, 
checkin
Department_1_docs dept_1_view -> document view, dept_1_editors -> 
upload, checkin
Department_2_docs dept_1_view -> document view, dept_1_editors -> 
upload, checkin

Example:
Document types 
--
"Accounting - Invoices"   
"Human resources - complaint" 

Roles

"Accounting read only"
"Accounting editors"
"Human resources read only"
"Human resources editors"

Document type ACLs (document type vs. role + permissions)
--
"Accounting - Invoices" -> "Accounting read only" -> [document view]
"Accounting - Invoices" -> "Accounting editor" -> [extra permissions]
"Human resources - complaint" -> "Human resources read only" -> [document 
view]
"Human resources - complaint" -> "Human resources editors" -> [extra 
permissions]

Hope this setup works for you.

On Thursday, January 7, 2016 at 1:32:34 PM UTC-4, LeVon Smoker wrote:
>
> We are deploying Mayan-EDMS. It seems to be very well-designed and 
> flexible. Thanks Roberto (and others) for this excellent app!
>
> I am having trouble, though, in figuring out how to optimally set up 
> roles/ACLs/groups/doctypes for the security setup that the management would 
> like.
>
> I have our Active Directory groups mirrored so we can have some control 
> within the AD management software. On a "permissions" level we envision 
> Readers (view-only) and Editors (view/upload/checkin/out). We would like 
> agency-wide documents to be viewable by all staff (Readers) and manageable 
> (Editors) by a management group. We would also like for department-specific 
> documents to be limited to that department (for viewing, ie, Readers) and 
> then within that department have a team that can manage the documents 
> (Editors).
>
> Is this way of doing security possible or do we need to simplify what we 
> want?
>
> LeVon Smoker
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Mayan EDMS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mayan-edms+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.