Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request: Manage resource settings via API #24

Open
soerenbe opened this issue Mar 24, 2015 · 3 comments
Open

Request: Manage resource settings via API #24

soerenbe opened this issue Mar 24, 2015 · 3 comments

Comments

@soerenbe
Copy link

Hi all,
currently working on our automation. Since we are using a django-like framework for our first-level support, a method to get/set the resource related settings from python would be nice. I mean:

zarafa-admin | grep 'mr-'
    --mr-accept             (resource) auto-accept meeting requests. yes/no 
    --mr-decline-conflict           (resource) decline meeting requests for conflicting times. yes/no   
    --mr-decline-recurring          (resource) decline meeting requests for all recurring items. yes/no

I a not in the code. But something like a class ResourceConfig would be cool:

class ResourceConfig:
  @property
  def mr_accept():

  @property
  def mr_decline_conflicts():

  @property
  def mr_decline_recurring():

Depending on the effort, a read-only field alone would be very helpful.
Just a proposal, if you searching for new stuff to implement. :)

Best Regards
Sören

@jelly
Copy link
Collaborator

jelly commented Mar 24, 2015

After some digging I've figured out that the information is actually stored in the users store (in a special MAPI message ofcourse)

So it would be logical to add this information to the User class, read only is probably do-able

@soerenbe
Copy link
Author

That would be great. And read-only would solve my issue >60% and I work around something like 'os.system("ssh mynode zarafa-admin -details %s" % user)' :D

If you need some support give me a hint.

@jelly
Copy link
Collaborator

jelly commented Apr 2, 2015

The following proptags are needed and not yet provided by python-mapi yety, but you can define them in your program as following:

PR_PROCESS_MEETING_REQUESTS = PROP_TAG(PT_BOOLEAN, 0x686D)
PR_DECLINE_CONFLICTING_MEETING_REQUESTS = PROP_TAG(PT_BOOLEAN, 0x686F)
PR_DECLINE_RECURRING_MEETING_REQUESTS = PROP_TAG(PT_BOOLEAN, 0x686E)

The mr_accept data is stored in a LocalFreeBusy message in the associated folder of the calendar and the directory 'Freebusy Data' under the root (user.store.folder('Freebusy Data'). This is because different versions of outlook look in different directories :)
The to read the data is als simple as the example below:

for item in bob.store.calendar.associated.items():
if item.message_class == 'IPM.Microsoft.SheduleData.FreeBusy':
break

mr_accept = item.prop(PR_PROCESS_MEETING_REQUESTS).value
mr_decline_confict = item.prop(PR_DECLINE_CONFLICTING_MEETING_REQUESTS).value
mr_decline_recurring = item.prop(PR_DECLINE_RECURRING_MEETING_REQUESTS).value

We aren't sure yet how to incorperate this functionality in python-zarafa, but this code should be enough to read the data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants