How to exclude the drafts folder when creating a search folder? - exchangewebservices

Using the query below, I created a search folder under the root folder. It works, but it also includes emails from the drafts folder.
Is there a straightforward way to exclude the drafts folder when creating this search folder?
<?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="Exchange2010" />
</soap:Header>
<soap:Body>
<m:CreateFolder>
<m:ParentFolderId>
<t:DistinguishedFolderId Id="searchfolders" />
</m:ParentFolderId>
<m:Folders>
<t:SearchFolder>
<t:DisplayName> My_Search_Folder </t:DisplayName>
<t:PermissionSet>
<t:Permissions />
</t:PermissionSet>
<t:SearchParameters Traversal="Deep">
<t:Restriction>
<t:Contains ContainmentMode="FullString" ContainmentComparison="IgnoreCase">
<t:FieldURI FieldURI="item:Categories" />
<t:Constant Value="My_CATEGORY" />
</t:Contains>
</t:Restriction>
<t:BaseFolderIds>
<t:DistinguishedFolderId Id="root" />
</t:BaseFolderIds>
</t:SearchParameters>
</t:SearchFolder>
</m:Folders>
</m:CreateFolder>
</soap:Body>
</soap:Envelope>

You can't have a Folder Exception with a Search filter in EWS as all restrictions are Item based. So instead of Starting the Search at the root add each Subfolder into you SearchFolder defination Eg Inbox,SentItems etc instead.
The other option is add a Restriction that will exclude any messages that is currently Unsent by using a BitMask exclude https://msdn.microsoft.com/en-us/library/office/dd633708(v=exchg.80).aspx on the PR_MessageFlags property https://msdn.microsoft.com/en-us/library/cc839733(v=office.12).aspx eg
<m:Restriction>
<t:Excludes>
<t:ExtendedFieldURI PropertyTag="3591" PropertyType="Integer" />
<t:Bitmask Value="8" />
</t:Excludes>
</m:Restriction>
This won't exclude messages in the Drafts folder but will exclude any message in any folder that has the Bitwise MSGFLAG_UNSENT set in the PR_MessageFlags property.

Related

Can't use EWS UpdateItem operation from Outlook add-in

I'm am trying to update a dictionary element in the IPM.Configuration.OWA.UserOptions message using an UpdateItem via an EWS (SOAP) request from an Outlook web add-in with ReadWriteMailbox permissions. However it is failing with the following error in the response:
ErrorAccessDenied: Office extension is not allowed to update this type of item.
The UpdateItem request I'm using is a fairly straightforward example of updating a message by it's ID and setting the value of an extended property:
<?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:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
<soap:Header>
<RequestServerVersion Version="Exchange2013" xmlns="http://schemas.microsoft.com/exchange/services/2006/types" soap:mustUnderstand="0" />
</soap:Header>
<soap:Body>
<m:UpdateItem MessageDisposition="SaveOnly" ConflictResolution="AlwaysOverwrite">
<m:ItemChanges>
<t:ItemChange>
<t:ItemId Id="AAMkAGM0YTZmNjhiLTI0OWYtNGFlNC05ODAzLTNlZWQyODhmOTY2MABGAAAAAACxU7lpjO+oS5hB0UfA6muFBwDcAGmTk49MRrSCdR7rvVFPAAAAAAEBAADcAGmTk49MRrSCdR7rvVFPAAD2pXuVAAA=" ChangeKey="CQAAABYAAADcAGmTk49MRrSCdR7rvVFPAAD2uhNb" />
<t:Updates>
<t:SetItemField>
<t:ExtendedFieldURI PropertyTag="0x7c07" PropertyType="Binary" />
<t:Message>
<t:ExtendedProperty>
<t:ExtendedFieldURI PropertyTag="0x7c07" PropertyType="Binary" />
<t:Value>PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjxVc2VyQ29uZmlndXJhdGlvbj4NCgk8SW5mbyB2ZXJzaW9uPSJFeGNoYW5nZS4xMiIgLz4NCgk8RGF0YT4NCgkJPGUgaz0iMTgtSXNGb2N1c2VkSW5ib3hPbkxhc3RVcGRhdGV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KCQk8ZSBrPSIxOC1Jc09wdGltaXplZEZvckFjY2Vzc2liaWxpdHkiIHY9IjMtRmFsc2UiIC8+DQoJCTxlIGs9IjE4LUlzRm9jdXNlZEluYm94RW5hYmxlZCIgdj0iMy1UcnVlIiAvPg0KCQk8ZSBrPSIxOC1OZXdFbmFibGVkUG9udHMiIHY9IjktMjE0NzQwMTcyNyIgLz4NCgkJPGUgaz0iMTgtc2lnbmF0dXJlaHRtbCIgdj0iMTgtJmx0O2h0bWwmZ3Q7JiN4RDsmI3hBOyZsdDtoZWFkJmd0OyYjeEQ7JiN4QTsmbHQ7L2hlYWQmZ3Q7JiN4RDsmI3hBOyZsdDtib2R5Jmd0OyYjeEQ7JiN4QTsmbHQ7cCZndDsmYW1wO25ic3A7Jmx0Oy9wJmd0OyYjeEQ7JiN4QTsmbHQ7cCZndDstLSZsdDsvcCZndDsmI3hEOyYjeEE7Jmx0O3AmZ3Q7SXp6eiBhbSBKYW5pY2smbHQ7L3AmZ3Q7JiN4RDsmI3hBOyZsdDtwJmd0OyZhbXA7bmJzcDsmbHQ7L3AmZ3Q7JiN4RDsmI3hBOyZsdDsvYm9keSZndDsmI3hEOyYjeEE7Jmx0Oy9odG1sJmd0OyYjeEQ7JiN4QTsiIC8+DQoJPC9EYXRhPg0KPC9Vc2VyQ29uZmlndXJhdGlvbj4=</t:Value>
</t:ExtendedProperty>
</t:Message>
</t:SetItemField>
</t:Updates>
</t:ItemChange>
</m:ItemChanges>
</m:UpdateItem>
</soap:Body>
</soap:Envelope>
The 0x7c07 property I'm updating in the UserOptions message contains a base64 encoded value of various signature related dictionary properties that I've modified:
<?xml version="1.0" encoding="utf-8"?>
<UserConfiguration>
<Info version="Exchange.12" />
<Data>
<e k="18-IsFocusedInboxOnLastUpdateTime" v="18-01/01/0001 00:00:00" />
<e k="18-autoaddsignature" v="3-True" />
<e k="18-UserOptionsMigrationState" v="9-5" />
<e k="18-themeStorageId" v="18-" />
<e k="18-autoaddsignatureonreply" v="3-True" />
<e k="18-timezone" v="18-Central Standard Time" />
<e k="18-signaturetext" v="18-
--
Izzz am Janick
" />
<e k="18-FavoriteFolders" v="1-18-3-120-AAMkAGM0YTZmNjhiLTI0OWYtNGFlNC05ODAzLTNlZWQyODhmOTY2MAAuAAAAAACxU7lpjO+oS5hB0UfA6muFAQDcAGmTk49MRrSCdR7rvVFPAAAAAAEMAAA=-120-AAMkAGM0YTZmNjhiLTI0OWYtNGFlNC05ODAzLTNlZWQyODhmOTY2MAAuAAAAAACxU7lpjO+oS5hB0UfA6muFAQDcAGmTk49MRrSCdR7rvVFPAAAAAAEJAAA=-120-AAMkAGM0YTZmNjhiLTI0OWYtNGFlNC05ODAzLTNlZWQyODhmOTY2MAAuAAAAAACxU7lpjO+oS5hB0UfA6muFAQDcAGmTk49MRrSCdR7rvVFPAAAAAAEPAAA=" />
<e k="18-IsOptimizedForAccessibility" v="3-False" />
<e k="18-IsFocusedInboxEnabled" v="3-True" />
<e k="18-NewEnabledPonts" v="9-2147401727" />
<e k="18-signaturehtml" v="18-<html><head></head><body><p>&nbsp;</p><p>--</p><p>John Doe</p><p>&nbsp;</p></body></html>;" />
</Data>
</UserConfiguration>
I can't find any documentation that states what is allowed or not allowed with UpdateItem operations (the list should be here). Updating the Outlook Online signature is also not currently possible with Graph or the Mail API. If what I'm trying to do ultimately cannot work then I just wasted 40+ hours of effort and will lose a client. :-|
Does anybody have any clever workarounds or know of a way to enable this operation? Note that using the EWS Managed API in server-side code is not currently an option for this solution.
Outlook does not allow add-ins to create or update FAI messages by design. In general we don't allow modifications of OWA options (or any other “service-type”, internal, item/data) directly which is probably an internal data structure, subject to change and potentially break the add-in.
If your scenario specifically requires access to outlook's signature system, I would recommend making a request to UserVoice

Joomla Form Maker where to find html form template

I'm working on Joomla project which is using Form Maker. My task is to improve HTML template but I absolutely can't find it. I've searched everywhere I could in the extension's directory folder.
Structure:
|-models
|----formaker.php
|----index.html
|-uploads
|----index.html
|-views
|----formmaker
|--------tmpl
|------------default.php
|------------default.xml
|------------index.html
|------------main.js
|--------index.html
|--------view.html.php
|----index.html
|-controller.php
|-formmaker.php
|-index.html
|-wd_captcha.php
From my point of view main file is in views/formmaker/tmpl/default.php but I've didn't find the way how I can modify especially the HTML template to change the form params.
Update - Structure of default.xml:
<?xml version="1.0" encoding="utf-8"?>
<metadata>
<layout title="Form">
<message></message>
</layout>
<fields name="request">
<fieldset name="request" addfieldpath="/administrator/components/com_formmaker/models/forms" >
<field name="id" type="modal_contacts" label="Select a Form" required="true"/>
</fieldset>
</fields>
</metadata>
Thank you in advance
According to the Form Maker extension the only possible solution to change the HTML markup of the form elements, it's only to rewriting the whole script for your needs.
Wouldn't recommend to use this script, even Premium version.
Form parametars are in xml file. Try at this path views/formmaker/formmaker.xml

Magento, how to add static url link in Block

I am stuck at adding a url link in block programmatically, I need to add a URL to customized page which edited under CMS/page and I want to add it in .xml file by adding something like below.
<action method="addLink"
translate="label title"
module="catalog">
<label>My Account</label>
<url helper="customer/getAccountUrl" />
<title>My Account</title>
</action>
Above sample retrieve url from module, but no idea what are the parameters should be used for static CMS/page url. Please help me out.
Let me take an example of top.links block to explain this.
<block type="page/template_links" name="top.links" as="topLinks"/>
The “addLink” function is defined in Mage_Page_Block_Template_Links. The definition of the function is
public function addLink($label, $url='', $title='', $prepare=false, $urlParams=array(),
$position=null, $liParams=null, $aParams=null, $beforeText='', $afterText='')
Also the phtml file where the html code for this is written is ‘page/template/links.phtml’.
<reference name="top.links">
<block type="wishlist/links" name="wishlist_link">
<action method="addWishlistLink"></action>
</block>
</reference>
Answer to your question is pretty simple.
Suppose we need to add a new link to top links, lets say a link for a CMS page called Terms and Conditions. To do this open a layout file, let say customer.xml and add the below code:
<default>
<reference name="top.links">
<action method="addLink" translate="label title">
<label>Terms and Condition</label>
<url>terms</url>
<title>Terms and Condition</title>
<prepare>true</prepare>
<position>2</position>
</action>
</reference>
</default>

Image Reference issue in MVC

I am creating a line chart in one view(myChartView) and saving it as _ChartFiles/chart01.jpg.
var filePathName = "_ChartFiles/chart01.jpg";
Which is saving at /views/myChartView/_ChartFiles/chart01.jpg . Now in the very next line making a reference it as
<img src="#filePathName" />
but this is not displaying the image. what would be correct way to refer it?
If you want some static files to be accessed directly by the client, you cannot store them in the ~/Views folder because by default (for security reasons) the server would not serve content from this folder.
See ~/Views/Web.Config:
<handlers>
<remove name="BlockViewHandler"/>
<add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler" />
</handlers>
Try to save the files in other directory like ~/Static.
You should save it in another folder than "Views" because in MVC this is a folder conventionned for HTML view and no other content, try to save it in "fonts" or whatever else,
and it would be :
<img src="fonts/yourimage.jpg" />
Try giving the image path as
filePathName = "../views/myChartView/_ChartFiles/chart01.jpg";
or
filePathName = "~/views/myChartView/_ChartFiles/chart01.jpg";
//try this one
filePathName = "myChartView/_ChartFiles/chart01.jpg";
<img src="#filePathName" />

How do I get autocompletion for Flex Metadata?

I took a look at flex metadata and it seems to be quiet straight forward. Though I have a problem, I don't get autocompletion for the metadata.
I'll tell you what I did, maybe you find an error. I want to create my own Style metadata tag named e.g. MyStyle. I want to create my own because it's easier for me to determine at runtime if the metadata was added by me or by the flex framework (therefore I will not use the predefined Style metadata tag).
To add metadata is pretty simple, I just wrote this code to get it work:
<s:Group xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
width="1024" height="768">
<fx:Metadata>
[MyStyle(required="true")]
</fx:Metadata>
</s:Group>
On my WindowedApplication component I added an added to stage listener to the stage. So all elements that are added to the application will fire that Event.ADDED when they are added to the stage. In that eventHandler I scan added elements for my metadata tag.
protected function addedToStageListener(event:Event):void
{
var classInfo:XML = describeType(event.target);
for each (var x:XML in classInfo..metadata)
{
if (x.#name == "MyStyle")
trace(x);
}
}
I also added a flex-config.xml file (in the toplevel of my src folder) to add the compiler options, so that I can read my custom metadata tag on runtime. The file looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<flex-config>
<compiler>
<keep-as3-metadata>
<name>MyStyle</name>
</keep-as3-metadata>
</compiler>
</flex-config>
When I run this, I get the result I expect
<metadata name="MyStyle">
<arg key="required" value="true"/>
</metadata>
So this works. My next step was to add autocompletion when adding the metadata tag to the code. To do this you should create a metadata.xml which specifies the metadata tags right?
So I did this and I ended up with this simple metadata.xml
<?xml version="1.0" encoding="UTF-8"?>
<annotations version="2.1.1">
<metadata name="MyStyle" description="Adds style.">
<context name="class" />
<attribute name="required" type="Boolean" required="true" />
</metadata>
</annotations>
To add the metadata.xml correctly to the project I followed that tutorial by Adobe, but it doesn't work. I don't get autocompletion. Do you have any suggestions?
Update: I use Flash Builder 4.6 Professional and I created a Flex Library Project.