Comments (13)
I've looked into this as well via extended_field_uri, http://msdn.microsoft.com/en-us/library/aa564843%28v=exchg.80%29.aspx
I got as far as dumping the soap response and it does not contain the requested information at all, I am currently looking at way to dump the SOAP request to confirm the SOAP request actually contains the extendedfielduri request.
def get_custom_item(item_id, change_key = nil)
item_shape = {:base_shape => 'AllProperties',
:include_mime_content => TRUE,
:additional_properties => {:extended_field_uRI => ['PropertySetId:0x8462001F',
'PropertyName:ProjectCode',
'PropertyType:String'],
:value => TRUE}
}
resp = (Viewpoint::EWS::EWS.instance).ews.get_item([item_id], item_shape)
File.open('/tmp/soap_response.txt', 'w') {|f|f.write(resp.inspect)}
if(resp.status == 'Success')
item = resp.items.shift
type = item.keys.first
eval "#{type.to_s.camel_case}.new(item[type])"
else
raise EwsError, "Could not retrieve item. #{resp.code}: #{resp.message}"
end
end
from viewpoint.
right, been there before, but didn't connect the dots at the time
lib/soap/handsoap/builders/ews_build_helpers.rb filters out the provided arguments , this needs extending to support extendedfielduris
from viewpoint.
I've added this to into ews_build_helpers.rb
unless( item_shape[:additional_properties][:extended_field_uri].nil? )
is.add("#{NS_EWS_TYPES}:AdditionalProperties") do |addprops|
item_shape[:additional_properties][:extended_field_uri].each do |uri|
addprops.add("#{NS_EWS_TYPES}:ExtendedFieldURI") { |furi| furi.set_attr('ExtendedFieldURI', uri) }
end
end
end
Which gives me a request like below:
<m:GetItem xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages">
<m:ItemShape>
<t:BaseShape xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">AllProperties</t:BaseShape>
<t:IncludeMimeContent xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">true</t:IncludeMimeContent>
<t:AdditionalProperties xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
<t:ExtendedFieldURI ExtendedFieldURI="PropertySetId:0x8462001F" />
<t:ExtendedFieldURI ExtendedFieldURI="PropertyName:ProjectCode" />
<t:ExtendedFieldURI ExtendedFieldURI="PropertyType=String" />
</t:AdditionalProperties>
</m:ItemShape>
</m:GetItem>
Haven't succeeded in passing the validation yet, either I'm cross eyed or the documentation is off
from viewpoint.
I found examples here: http://blogs.msdn.com/b/brijs/archive/2009/11/06/how-to-get-extended-mapi-properties-in-the-getitem-exchange-web-service-call.aspx & http://blogs.msdn.com/b/brijs/archive/2009/11/12/how-to-do-finditem-using-extended-mapi-properties-in-a-exchange-web-service-call.aspx
But I just can't pass validation ...
from viewpoint.
Unfortunately even on Exchange 2013 the environments aren't sufficiently feature par yet. So, we're looking at both using X-Headers for an RFC compliant approach and for the Outlook client, employing custom outlook properties to store additional meta-data. Via EWS we'd like to monitor and manage integrity of both sets of meta data and also retain them, while exporting.
So, is it feasible to support the ExtendedFieldUri function from EWS in viewpoint ?
from viewpoint.
This is pushed up to master and will be part of 1.0.0.beta.2. You can use it like so:
item = cli.get_item(i.id) do |obj|
obj.opts[:item_shape][:additional_properties] = {
field_uRI: [
'item:ParentFolderId',
'item:Categories',
'item:ConversationId',
'conversation:FlagStatus',
'conversation:GlobalFlagStatus'
]
}
end
If defined, you can access the parameters on the object otherwise you have to dig into item.ews_item.
cheers,
Dan
from viewpoint.
Thanks for the effort, great to see, will give master another shot!
from viewpoint.
Hi,
So, just upgraded to the master branch in a dev branch on our end and it's a big step up from 0.1 , kudos.
Now I've been playing with the retrieval of those pesky custom mapi properties
full_item = @cli.get_item(item_id) do |obj|
obj.opts[:item_shape][:additional_properties] = {
extended_field_uRI: {:distinguished_property_set_id => 'PublicStrings',
:distinguished_property_set_id_specified => TRUE,
:property_name => 'Job Number',
:property_type => 'String'
}
}
I've added the line
nbuild.parent['DistinguishedPropertySetIdSpecified'] = val[:distinguished_property_set_id_specified] if val[:distinguished_property_set_id_specified]
into the ews_builder.rb
to be able to use the distinguished_property_set_id , as per
http://msdn.microsoft.com/en-us/library/exchange/exchangewebservices.pathtoextendedfieldtype.distinguishedpropertysetid%28v=exchg.150%29.aspx
I've uploaded some output, github markdown got in the way , good also to see the soap request & response ! Makes debugging so much easier.
Now I can clearly see that I've set the DistinguishedPropertySetIdSpecified to true as per SOAP request, yet the request fails claiming it's not. Who here in the SOAP world does know why?
from viewpoint.
from viewpoint.
Must have been a red herring somewhere, rebuilding the request, like so:
obj.opts[:item_shape] = {:base_shape => 'AllProperties',
:additional_properties => {
extended_field_uRI: {:distinguished_property_set_id => 'PublicStrings',
:property_name => 'Job Number',
:property_type => 'String'
}
}
<<< works, qed >>>
from viewpoint.
And a request for requesting a number of extended properties:
@extended_message_item = @cli.get_item(args['item_id']['id']) do |obj|
obj.opts[:item_shape] = {:base_shape => 'AllProperties',
:additional_properties => { extended_field_uRI: [{:distinguished_property_set_id => 'PublicStrings',
:property_name => 'Project',
:property_type => 'String'},
{:distinguished_property_set_id => 'PublicStrings',
:property_name => 'Phase',
:property_type => 'String'
},
{:distinguished_property_set_id => 'PublicStrings',
:property_name => 'Org',
:property_type => 'String'
}]}}
end
from viewpoint.
I'm also trying to test out this feature. But I don't think I'm doing it right.
This is my original code (with start_date and end_date declared above)
extended_field_URI = {:property_tag => '0x007D', :proptery_type => 'String'}
additional_properties = {:base_shape => 'Default', :additional_properties => {:extended_field_uRI => extended_field_URI}}
item_shape = {:item_shape => additional_properties}
messages = @inbox.between(start_date, end_date, item_shape)
Obviously this was not right because the SOAP request was wrong. So I copied Tobias code to test it out.
messages = @inbox.items_between(start_date, end_date) do |obj|
obj.opts[:item_shape] = {:base_shape => 'AllProperties',
:additional_properties => { extended_field_uRI: [{:distinguished_property_set_id => 'PublicStrings',
:property_name => 'Project',
:property_type => 'String'},
{:distinguished_property_set_id => 'PublicStrings',
:property_name => 'Phase',
:property_type => 'String'
},
{:distinguished_property_set_id => 'PublicStrings',
:property_name => 'Org',
:property_type => 'String'
}]}}
end
But I got
#<NoMethodError: undefined method `opts' for #<Viewpoint::EWS::Types::Message:0x007ffaf849f4a8>>
I left the properties as in just to test it out. The ItemShape is wrong. Did anyone get this to work?
from viewpoint.
Hi, I'll have a look later today to reproduce.
from viewpoint.
Related Issues (20)
- item_field_uri_map.rb: warning: key :categories is duplicated and overwritten HOT 2
- Sample of syncing calendar
- Debugging nil response from create_item
- Create a meeting with attendees
- Contact photo
- Send/receive as distribution list? HOT 1
- SYSCALL returned=5 when migrating from ruby 2.2.1 to 2.2.6 or 2.4.1 (Mac Os)
- can I get the mail's message_id when i send message successfuly
- How can admin account fetch a calendar entries with all properties of the meetings?
- Get search folders and count items
- Cannot get multiple free/busy responses
- Forward - Invalid child element 'IsRead'
- effective_rights accessor
- Find for recurring calendar items HOT 3
- How to get 'OnlineMeeting*" properties?
- [support] Get calendar info
- Does not work with Rails console (4.2.10)
- uninitialized constant Viewpoint::EWS::Connection::Logging
- using expand_dl error
- Basic authentication is deprecated HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from viewpoint.