+architecture
Hi Vivekananthan,

What is the parameter required to pass to support this?

---------- Forwarded message ----------
From: Vivekananthan Sivanayagam <[email protected]>
Date: Sat, Jul 2, 2016 at 12:43 AM
Subject: Support for dynamic custom list items and blocking mode in
Sharepoint connector
To: Malaka Silva <[email protected]>


Hi Malaka,

I have added template and request here, using that I was able to create
custom list items If it is correct , I will send the PR.

[1] createCustomListItem Template

<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
  ~
  ~ WSO2 Inc. licenses this file to you under the Apache License,
  ~ Version 2.0 (the "License"); you may not use this file except
  ~ in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~    http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing,
  ~ software distributed under the License is distributed on an
  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  ~ KIND, either express or implied.  See the License for the
  ~ specific language governing permissions and limitations
  ~ under the License.
  -->
<template name="createCustomListItem" xmlns="http://ws.apache.org/ns/synapse";>
    <parameter name="customListItems" description="The list of items
to be created."/>
    <parameter name="type" description="Type use when constructing the
metadata variable."/>
    <parameter name="listTitle" description="The title of the list to
create list item."/>
    <sequence>
        <property name="uri.var.customListItems"
expression="$func:customListItems"/>
        <property name="uri.var.listTitle" expression="$func:listTitle"/>
        <property name="uri.var.type" expression="$func:type"/>
        <payloadFactory media-type="json">
            <format>
                {
                "__metadata": { "type":"$1" },
                $2
                }
            </format>
            <args>
                <arg expression="$ctx:uri.var.type"/>
                <arg expression="$ctx:uri.var.customListItems"/>
            </args>
        </payloadFactory>
        <property name="messageType"
value="application/json;odata=verbose" scope="axis2"/>
        <property action="remove" name="Accept-Encoding" scope="transport"/>
        <filter source="$ctx:sharepointBlocking" regex="true">
            <then>
                <call blocking="true">
                    <endpoint>
                        <http method="post"

uri-template="{uri.var.apiUrl}/_api/web/lists/GetByTitle('{uri.var.listTitle}')/items"/>
                    </endpoint>
                </call>
            </then>
            <else>
                <call>
                    <endpoint>
                        <http method="post"

uri-template="{uri.var.apiUrl}/_api/web/lists/GetByTitle('{uri.var.listTitle}')/items"/>
                    </endpoint>
                </call>
            </else>
        </filter>
        <!-- Remove custom Headers from the API Response -->
        <header name="X-Frame-Options" action="remove" scope="transport"/>
        <header name="Strict-Transport-Security" action="remove"
scope="transport"/>
        <header name="RequestId" action="remove" scope="transport"/>
        <header name="X-Content-Type-Options" action="remove"
scope="transport"/>
        <header name="OData-Version" action="remove" scope="transport"/>
        <header name="Cache-Control" action="remove" scope="transport"/>
    </sequence>
</template>

[2] Request:

{
  "apiUrl":"https://vivesl.sharepoint.com";,
  "type":"SP.Data.Custom002ListItem",
  "customListItems": " 'Title': 'ListItem0010', 'Add_Col':'siva',
'mobile_No':'075 <0752676123>
​00000​
', 'FirstName':'vivekananthan', 'LastName':'Sivanayagam' ",
  "listTitle":"Custom002",
  "accessToken":"
​tttttttttt​
xxxxxxxxxxx"
}







-- 

Best Regards,

Malaka Silva
Senior Technical Lead
M: +94 777 219 791
Tel : 94 11 214 5345
Fax :94 11 2145300
Skype : malaka.sampath.silva
LinkedIn : http://www.linkedin.com/pub/malaka-silva/6/33/77
Blog : http://mrmalakasilva.blogspot.com/

WSO2, Inc.
lean . enterprise . middleware
http://www.wso2.com/
http://www.wso2.com/about/team/malaka-silva/
<http://wso2.com/about/team/malaka-silva/>
https://store.wso2.com/store/

Save a tree -Conserve nature & Save the world for your future. Print this
email only if it is absolutely necessary.
_______________________________________________
Architecture mailing list
[email protected]
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture

Reply via email to