I am sending the following XML query to EWS using the Office.context.mailbox.makeEwsRequestAsync method.
The query string value needs to either match the subject or the from field; and the emails must belong the "MY_CATEGORY" category. I am unable to enforce the last requirement. What am I doing wrong?
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
<t:RequestServerVersion Version="Exchange2013_SP1" />
</soap:Header>
<soap:Body>
<m:FindItem Traversal="Shallow">
<m:ItemShape>
<t:BaseShape>AllProperties</t:BaseShape>
</m:ItemShape>
<m:IndexedPageItemView MaxEntriesReturned="10" Offset="0" BasePoint="Beginning" />
<m:Restriction>
<t:Or>
<t:Contains ContainmentMode="Substring" ContainmentComparison="IgnoreCase">
<t:FieldURI FieldURI="item:Subject" />
<t:Constant Value="query string" />
</t:Contains>
<t:Contains ContainmentMode="Substring" ContainmentComparison="IgnoreCase">
<t:FieldURI FieldURI="message:From" />
<t:Constant Value="query string" />
</t:Contains>
</t:Or>
<t:And>
<t:Contains ContainmentMode="FullString" ContainmentComparison="IgnoreCase">
<t:FieldURI FieldURI="item:Categories" />
<t:Constant Value="MY_CATEGORY" />
</t:Contains>
</t:And>
</m:Restriction>
<m:ParentFolderIds>
<t:DistinguishedFolderId Id="inbox" />
<t:DistinguishedFolderId Id="sentitems" />
</m:ParentFolderIds>
</m:FindItem>
</soap:Body>
</soap:Envelope>
Categories are Multivalued strings so the searchfilters your using won't work on these types of values. You can AQS on Exchange 2010 and above to search the Categories as well as the other fields your search on. eg
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
<t:RequestServerVersion Version="Exchange2013_SP1" />
</soap:Header>
<soap:Body>
<m:FindItem Traversal="Shallow">
<m:ItemShape>
<t:BaseShape>IdOnly</t:BaseShape>
<t:AdditionalProperties>
<t:FieldURI FieldURI="item:Subject" />
<t:FieldURI FieldURI="item:DisplayTo" />
<t:FieldURI FieldURI="item:DisplayCc" />
<t:FieldURI FieldURI="item:DateTimeReceived" />
<t:FieldURI FieldURI="item:HasAttachments" />
<t:FieldURI FieldURI="item:ItemClass" />
</t:AdditionalProperties>
</m:ItemShape>
<m:IndexedPageItemView MaxEntriesReturned="250" Offset="0" BasePoint="Beginning" />
<m:SortOrder>
<t:FieldOrder Order="Ascending">
<t:FieldURI FieldURI="contacts:DisplayName" />
</t:FieldOrder>
</m:SortOrder>
<m:ParentFolderIds>
<t:FolderId Id="AQ..." />
</m:ParentFolderIds>
<m:QueryString>System.Category:Green AND (From:'Glen Scales' OR Subject:test) </m:QueryString>
</m:FindItem>
</soap:Body>
</soap:Envelope>
Related
Version 5.0.21.6 introduced a breaking change to the rule XML content.
In version 5.0.20.6 methods are referenced by their names in the XML file as shown below:
<method name="AddReason"><value type="System.Int32">1</value></method>
But in version 5.0.21.6 methods are referenced by a "token" as shown below:
<method name="1064B76D73CE9F304CA588DF55C65438"><value type="System.Int32">1</value></method>
We do use the XML document to further validate rules provided by the user and v5.0.21.6 breaks our functionality due to this issue.
Complete v5.0.21.6 Rule XML:
<?xml version="1.0" encoding="utf-8"?>
<codeeffects xmlns="https://codeeffects.com/schemas/rule/41"
xmlns:ui="https://codeeffects.com/schemas/ui/4">
<rule id="c11fc9b9-f60b-4b50-ac65-f46fb5c21471" webrule="5.0.21.2" utc="2020-08-11T18:42:06.3444" type="RuleModel.PermissibilityRuleModel, Rules.CodeEffects, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" eval="false">
<name>__rule_name__</name>
<definition>
<if>
<clause>
<or>
<and ui:block="true">
<condition type="equal">
<property name="PortfolioType" />
<value type="numeric">1</value>
</condition>
<condition type="equal">
<property name="IndependenceRestrictionStandard" />
<value type="numeric">1</value>
</condition>
</and>
<condition type="equal">
<property name="IndependenceRestrictionStandard" />
<value type="numeric">1</value>
</condition>
</or>
</clause>
<then>
<set>
<property name="PermissibilityStatus" />
<value type="numeric">1</value>
</set>
<method name="1064B76D73CE9F304CA588DF55C65438">
<value type="System.Int32">1</value>
</method>
</then>
<else>
<if>
<clause>
<condition type="equal">
<property name="IndependenceRestrictionStandard" />
<value type="numeric">1</value>
</condition>
</clause>
<then>
<method name="23434FBDF0B4243BC14729C5D1539E7D">
<value type="System.Int32">1</value>
</method>
</then>
<else>
<set>
<property name="PermissibilityStatus" />
<value type="numeric">1</value>
</set>
<method name="1064B76D73CE9F304CA588DF55C65438">
<value type="System.Int32">1</value>
</method>
</else>
</if>
</else>
</if>
</definition>
<format>
<lines>
<line index="0" tabs="1" />
<line index="3" tabs="2" />
<line index="9" tabs="2" />
<line index="16" tabs="1" />
<line index="19" tabs="1" />
<line index="25" tabs="1" />
<line index="28" tabs="2" />
<line index="35" tabs="2" />
<line index="42" tabs="0" />
<line index="44" tabs="1" />
<line index="49" tabs="1" />
<line index="52" tabs="2" />
<line index="58" tabs="0" />
<line index="60" tabs="1" />
<line index="66" tabs="1" />
</lines>
</format>
</rule>
</codeeffects>
Writing a sample app where I have a list of items, and then when the user clicks on a item - it uses ShowViewModel to display a detail page about the item. However, when call the method that calls ShowViewModel it crashes with the following error:
"Could not resolve type with token 01000037
(from typeref, class/assembly MvvmCross.Core.ViewModels.MvxRequestedBy..."
The code for the sample app is here:
https://github.com/gregmercer/FruitsAndVeggies
The full error message is here:
https://github.com/gregmercer/FruitsAndVeggies/blob/master/error.txt
And the line that cause the error (when uncommented) is found here:
https://github.com/gregmercer/FruitsAndVeggies/blob/master/FruitsAndVeggies.Core/ViewModels/FruitsViewModel.cs#L58
The problem is that you are mixing MvvmCross versions.
So if you look at your packages.config for your core:
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="MvvmCross" version="4.4.0" targetFramework="portable45-net45+win8+wpa81" />
<package id="MvvmCross.Binding" version="4.4.0" targetFramework="portable45-net45+win8+wpa81" />
<package id="MvvmCross.Core" version="4.4.0" targetFramework="portable45-net45+win8+wpa81" />
<package id="MvvmCross.Platform" version="4.4.0" targetFramework="portable45-net45+win8+wpa81" />
</packages>
These are version 4.4.0
Then if we look at the Droid project:
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="MvvmCross" version="5.0.2" targetFramework="monoandroid70" />
<package id="MvvmCross.Binding" version="5.0.2" targetFramework="monoandroid70" />
<package id="MvvmCross.Core" version="5.0.2" targetFramework="monoandroid70" />
<package id="MvvmCross.Droid.Shared" version="5.0.2" targetFramework="monoandroid70" />
<package id="MvvmCross.Droid.Support.Core.UI" version="5.0.2" targetFramework="monoandroid70" />
<package id="MvvmCross.Droid.Support.Fragment" version="5.0.2" targetFramework="monoandroid70" />
<package id="MvvmCross.Droid.Support.V7.AppCompat" version="5.0.2" targetFramework="monoandroid70" />
<package id="MvvmCross.Droid.Support.V7.RecyclerView" version="5.0.2" targetFramework="monoandroid70" />
<package id="MvvmCross.Platform" version="5.0.2" targetFramework="monoandroid70" />
<package id="Xamarin.Android.Support.Animated.Vector.Drawable" version="25.3.1" targetFramework="monoandroid70" />
<package id="Xamarin.Android.Support.Annotations" version="25.3.1" targetFramework="monoandroid70" />
<package id="Xamarin.Android.Support.Compat" version="25.3.1" targetFramework="monoandroid70" />
<package id="Xamarin.Android.Support.Core.UI" version="25.3.1" targetFramework="monoandroid70" />
<package id="Xamarin.Android.Support.Core.Utils" version="25.3.1" targetFramework="monoandroid70" />
<package id="Xamarin.Android.Support.Design" version="25.3.1" targetFramework="monoandroid70" />
<package id="Xamarin.Android.Support.Fragment" version="25.3.1" targetFramework="monoandroid70" />
<package id="Xamarin.Android.Support.Media.Compat" version="25.3.1" targetFramework="monoandroid70" />
<package id="Xamarin.Android.Support.Transition" version="25.3.1" targetFramework="monoandroid70" />
<package id="Xamarin.Android.Support.v7.AppCompat" version="25.3.1" targetFramework="monoandroid70" />
<package id="Xamarin.Android.Support.v7.RecyclerView" version="25.3.1" targetFramework="monoandroid70" />
<package id="Xamarin.Android.Support.Vector.Drawable" version="25.3.1" targetFramework="monoandroid70" />
<package id="Xamarin.Build.Download" version="0.4.3" targetFramework="monoandroid70" />
</packages>
These are version 5.0.2, which is newer than 4.4.0.
Consolidate your packages and use same versions across all your projects.
To pass parameters you either need to inherit from a generic MvxViewModel< Parameters> or update to MvvmCross 5.0 which has improved support for passing objects without trouble.
Look at this sample as a reference: https://github.com/MvvmCross/MvvmCross/tree/develop/TestProjects/Navigation
I have duplicate entry in my xml column in my sql table see material8 key.I remove one entry.I am trying below query its removing both.Is there any way i can remove only one entry.
Update mytable set xml = replace (xml, "<Book key=\"material8\" active=\"true\" displayOrder=\"5\" />", "") where id = 9 and type_key="mykey1";
<?xml version="1.0" encoding="UTF-8"?>
<Type key="test1" publicKey="test2" >
<UIProperties>
<label locale="en_US">My book</label>
</UIProperties>
<Books>
<Book key="material1" active="true" displayOrder="0" >
<UIProperties>
<label locale="en_US">My Books</label>
</UIProperties>
</Book>
<Book key="material2" />
<Book key="material3" active="true" displayOrder="3" >
<Pages>
<Page key="material4" active="true" displayOrder="0" />
<Page key="material5" active="true" displayOrder="1" />
</Pages>
</Book>
<Book key="material6" active="true" displayOrder="4" />
<Book key="material7" active="true" displayOrder="2" />
<Book key="material8" active="true" displayOrder="5" />
<Book key="material8" active="true" displayOrder="5" />
</Books>
<Attributes>
<Attribute key="desc" />
<Attribute key="date1" />
<Attribute key="date2" />
</Attributes>
</Type>
A simple solution is to replace 2 books to 1, instead of 1 to none:
UPDATE mytable
SET xml = REPLACE(xml, "<Book key=\"material8\" active=\"true\" displayOrder=\"5\" /><Book key=\"material8\" active=\"true\" displayOrder=\"5\" />", "<Book key=\"material8\" active=\"true\" displayOrder=\"5\" />")
WHERE id = 9
AND type_key="mykey1";
I have added four file type association in my package.appmanifest file
in which .pdf is one of them. Due to this when i am clicking on any
external pdf file, My app is also coming in the list along with Adobe
reader. What could be the reason.
Following is the code of my app.manifest file
<?xml version="1.0" encoding="utf-8"?>
<Package xmlns="http://schemas.microsoft.com/appx/2010/manifest" xmlns:m2="http://schemas.microsoft.com/appx/2013/manifest" xmlns:m3="http://schemas.microsoft.com/appx/2014/manifest" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest">
<Identity Name="195c0ec0-b933-4837-99c7-30250bbd0f9b" Publisher="CN=etu10" Version="1.0.0.0" />
<mp:PhoneIdentity PhoneProductId="195c0ec0-b933-4837-99c7-30250bbd0f9b" PhonePublisherId="00000000-0000-0000-0000-000000000000" />
<Properties>
<DisplayName>eBasta</DisplayName>
<PublisherDisplayName>etu10</PublisherDisplayName>
<Logo>Assets\StoreLogo.png</Logo>
</Properties>
<Prerequisites>
<OSMinVersion>6.3.1</OSMinVersion>
<OSMaxVersionTested>6.3.1</OSMaxVersionTested>
</Prerequisites>
<Resources>
<Resource Language="x-generate" />
</Resources>
<Applications>
<Application Id="App" Executable="$targetnametoken$.exe" EntryPoint="eBasta.App">
<m3:VisualElements DisplayName="eBasta" Square150x150Logo="Assets\Logo.png" Square44x44Logo="Assets\SmallLogo.png" Description="eBasta" ForegroundText="light" BackgroundColor="transparent">
<m3:DefaultTile Wide310x150Logo="Assets\WideLogo.png" Square71x71Logo="Assets\Square71x71Logo.png">
</m3:DefaultTile>
<m3:SplashScreen Image="Assets\SplashScreen.png" />
<m3:InitialRotationPreference>
<m3:Rotation Preference="portrait" />
<m3:Rotation Preference="landscape" />
<m3:Rotation Preference="landscapeFlipped" />
</m3:InitialRotationPreference>
</m3:VisualElements>
<Extensions>
<Extension Category="windows.fileTypeAssociation">
<FileTypeAssociation Name="text">
<DisplayName>text</DisplayName>
<SupportedFileTypes>
<FileType ContentType="text/xml">.xml</FileType>
<FileType ContentType="application/pdf">.pdf</FileType>
<FileType ContentType="application/zip">.zip</FileType>
<FileType ContentType="application/zip">.ebs</FileType>
</SupportedFileTypes>
</FileTypeAssociation>
</Extension>
<Extension Category="windows.fileTypeAssociation">
<FileTypeAssociation Name=".pdf">
<DisplayName>pdf</DisplayName>
<SupportedFileTypes>
<FileType ContentType="application/pdf">.pdf</FileType>
</SupportedFileTypes>
</FileTypeAssociation>
</Extension>
</Extensions>
</Application>
</Applications>
<Capabilities>
<Capability Name="internetClientServer" />
<Capability Name="removableStorage" />
<Capability Name="picturesLibrary" />
<Capability Name="musicLibrary" />
<Capability Name="enterpriseAuthentication" />
<m3:Capability Name="contacts" />
<m3:Capability Name="appointments" />
<Capability Name="sharedUserCertificates" />
<Capability Name="videosLibrary" />
<DeviceCapability Name="location" />
<DeviceCapability Name="proximity" />
<DeviceCapability Name="webcam" />
</Capabilities>
</Package>
Well it's normal that your app is listed there as you supported that file extension. If you expected that your app opens the file alone, that's not possible in Windows phone as defining default file opener is not supported
I am sending the following XML query to EWS using the Office.context.mailbox.makeEwsRequestAsync method. It works as long as Traversal is set to "Shallow". I get a "The request is invalid" error when I set Traversal to "Deep".
How do I recursively search subfolders if I can't do deep searches?
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
<t:RequestServerVersion Version="Exchange2013_SP1" />
</soap:Header>
<soap:Body>
<m:FindItem Traversal="Shallow">
<m:ItemShape>
<t:BaseShape>AllProperties</t:BaseShape>
</m:ItemShape>
<m:IndexedPageItemView MaxEntriesReturned="10" Offset="0" BasePoint="Beginning" />
<m:Restriction>
<t:Contains ContainmentMode="FullString" ContainmentComparison="IgnoreCase">
<t:FieldURI FieldURI="item:Categories" />
<t:Constant Value="MyCategory" />
</t:Contains>
</m:Restriction>
<m:ParentFolderIds>
<t:DistinguishedFolderId Id="inbox" />
<t:DistinguishedFolderId Id="sentitems" />
</m:ParentFolderIds>
</m:FindItem>
</soap:Body>
</soap:Envelope>
The FindItem EWS call does not support Traversal="Deep". See FindItem.
This is because the call will search for items in the folders specified in ParentFolderIds. In order to do a recursive search, you will need to get the list of folders to include in the search by using the FindFolder EWS Operation which supports Traversal="Deep" on non public folders. See FindFolder for additional documentation.