struggling with XML namespace nodes query - sql-server

I'm struggling to get my head around XML namespace query when using XML nodes - I've read other similar questions here and an article here but cannot apply this to my specific query.
I have a larger version of this sample XML:
SELECT CAST('<Navigator clsid="{ABF8EB05-610D-11D3-A53E-684F745C}">
<Version>7</Version>
<NavigatorNodes clsid="{0484ACB1-78F5-48D7-A26B-3A0ACD3A5F91}">
<NavigatorNode clsid="{59AB61BD-7833-4954-94C2-B6D737E3DD6F}">
<Indent>0</Indent>
<Caption>Contact</Caption>
<Selected>0</Selected>
<ViewType>0</ViewType>
<ViewSubType>0</ViewSubType>
<ShowTotals>0</ShowTotals>
<RowHeight>0</RowHeight>
<Complement>0</Complement>
<FreezeFirst>0</FreezeFirst>
<a1:QueryFilter xmlns:a2="http://www.ascenttechnology.co.uk/schemas/entities" xmlns:xsi="http://www.w3.org/21/XMLSchema-instance" xmlns:a1="http://www.ascenttechnology.co.uk/schemas/services" Type="QueryFilter">
<entity_name>Contact</entity_name>
<relationship_name />
<relationship_from_entity_name />
<a1:ColumnInfoCollection Type="ColumnInfoCollection" AscentCollection="true">
<__vers>1</__vers>
<IgnoreMissingItem>0</IgnoreMissingItem>
<ReadOnly>0</ReadOnly>
<AllowNulls>0</AllowNulls>
<a1:ColumnInfo Type="ColumnInfo">
<attribute_name>state</attribute_name>
<width>0</width>
</a1:ColumnInfo>
<a1:ColumnInfo Type="ColumnInfo">
<attribute_name>current_address_suffix</attribute_name>
<width>0</width>
</a1:ColumnInfo>
</a1:ColumnInfoCollection>
<a1:SurveyColumnInfoCollection Type="AttributeInfoCollection" AscentCollection="true">
<__vers>1</__vers>
<IgnoreMissingItem>0</IgnoreMissingItem>
<ReadOnly>0</ReadOnly>
<AllowNulls>0</AllowNulls>
</a1:SurveyColumnInfoCollection>
<a1:WorkflowColumnInfoCollection Type="AttributeInfoCollection" AscentCollection="true">
<__vers>1</__vers>
<IgnoreMissingItem>0</IgnoreMissingItem>
<ReadOnly>0</ReadOnly>
<AllowNulls>0</AllowNulls>
</a1:WorkflowColumnInfoCollection>
<a1:ConditionCollection Type="ConditionCollection" AscentCollection="true">
<__vers>1</__vers>
<IgnoreMissingItem>0</IgnoreMissingItem>
<ReadOnly>0</ReadOnly>
<AllowNulls>0</AllowNulls>
<a1:Condition Type="Condition">
<attribute_name>class</attribute_name>
<description1 />
<description2 />
<attribute_id>0</attribute_id>
<not>0</not>
<operator>28</operator>
<value1>1</value1>
<value2 xsi:nil="true" />
<indent_level>0</indent_level>
<value1_is_reference>0</value1_is_reference>
<value2_is_reference>0</value2_is_reference>
</a1:Condition>
<a1:Condition Type="Condition">
<attribute_name>do_not_mail</attribute_name>
<description1 />
<description2 />
<attribute_id>0</attribute_id>
<not>0</not>
<operator>0</operator>
<value1>True</value1>
<value2 xsi:nil="true" />
<indent_level>0</indent_level>
<value1_is_reference>0</value1_is_reference>
<value2_is_reference>0</value2_is_reference>
</a1:Condition>
<a1:Condition Type="Condition">
<attribute_name>gone_away</attribute_name>
<description1 />
<description2 />
<attribute_id>0</attribute_id>
<not>0</not>
<operator>0</operator>
<value1>True</value1>
<value2 xsi:nil="true" />
<indent_level>0</indent_level>
<value1_is_reference>0</value1_is_reference>
<value2_is_reference>0</value2_is_reference>
</a1:Condition>
<a1:Condition Type="Condition">
<attribute_name>dp_opt_out</attribute_name>
<description1 />
<description2 />
<attribute_id>0</attribute_id>
<not>0</not>
<operator>0</operator>
<value1>True</value1>
<value2 xsi:nil="true" />
<indent_level>0</indent_level>
<value1_is_reference>0</value1_is_reference>
<value2_is_reference>0</value2_is_reference>
</a1:Condition>
<a1:Condition Type="Condition">
<attribute_name>deceased</attribute_name>
<description1 />
<description2 />
<attribute_id>0</attribute_id>
<not>0</not>
<operator>0</operator>
<value1>True</value1>
<value2 xsi:nil="true" />
<indent_level>0</indent_level>
<value1_is_reference>0</value1_is_reference>
<value2_is_reference>0</value2_is_reference>
</a1:Condition>
<a1:Condition Type="Condition">
<attribute_name>deleted</attribute_name>
<description1 />
<description2 />
<attribute_id>0</attribute_id>
<not>0</not>
<operator>0</operator>
<value1>True</value1>
<value2 xsi:nil="true" />
<indent_level>0</indent_level>
<value1_is_reference>0</value1_is_reference>
<value2_is_reference>0</value2_is_reference>
</a1:Condition>
<a1:Condition Type="Condition">
<attribute_name>Date_Of_Birth</attribute_name>
<description1 />
<description2 />
<attribute_id>0</attribute_id>
<not>0</not>
<operator>19</operator>
<value1>2010-06-23T::.+:</value1>
<value2 xsi:nil="true" />
<indent_level>0</indent_level>
<value1_is_reference>0</value1_is_reference>
<value2_is_reference>0</value2_is_reference>
</a1:Condition>
<a1:Condition Type="Condition">
<attribute_name>home_address1</attribute_name>
<description1 />
<description2 />
<attribute_id>0</attribute_id>
<not>0</not>
<operator>26</operator>
<value1 xsi:nil="true" />
<value2 xsi:nil="true" />
<indent_level>0</indent_level>
<value1_is_reference>0</value1_is_reference>
<value2_is_reference>0</value2_is_reference>
</a1:Condition>
<a1:Condition Type="Condition">
<attribute_name>home_postcode</attribute_name>
<description1 />
<description2 />
<attribute_id>0</attribute_id>
<not>0</not>
<operator>26</operator>
<value1 xsi:nil="true" />
<value2 xsi:nil="true" />
<indent_level>1</indent_level>
<value1_is_reference>0</value1_is_reference>
<value2_is_reference>0</value2_is_reference>
</a1:Condition>
<a1:Condition Type="Condition">
<attribute_name>home_address1</attribute_name>
<description1 />
<description2 />
<attribute_id>0</attribute_id>
<not>0</not>
<operator>0</operator>
<value1 />
<value2 xsi:nil="true" />
<indent_level>0</indent_level>
<value1_is_reference>0</value1_is_reference>
<value2_is_reference>0</value2_is_reference>
</a1:Condition>
<a1:Condition Type="Condition">
<attribute_name>home_postcode</attribute_name>
<description1 />
<description2 />
<attribute_id>0</attribute_id>
<not>0</not>
<operator>0</operator>
<value1 />
<value2 xsi:nil="true" />
<indent_level>1</indent_level>
<value1_is_reference>0</value1_is_reference>
<value2_is_reference>0</value2_is_reference>
</a1:Condition>
</a1:ConditionCollection>
<a1:OrderByCollection Type="OrderByCollection" AscentCollection="true">
<__vers>1</__vers>
<IgnoreMissingItem>0</IgnoreMissingItem>
<ReadOnly>0</ReadOnly>
<AllowNulls>0</AllowNulls>
</a1:OrderByCollection>
<SelectedArticles xsi:nil="true" />
<groupby_field_name />
<reporting_currency>52</reporting_currency>
<Negate_Filter>0</Negate_Filter>
<Survey_Id>----</Survey_Id>
<Survey_Name xsi:nil="true" />
<Workflow_Id>----</Workflow_Id>
<Workflow_Name xsi:nil="true" />
<XPath>0</XPath>
<locale>0</locale>
</a1:QueryFilter>
</NavigatorNode>
</NavigatorNodes>
</Navigator>' AS XML) as xmldata
And have been trying queries to get to the information contained within the a1:Condition Node. I've tried queries such as:
;WITH XMLNAMESPACES(
'http://www.ascenttechnology.co.uk/schemas/services' AS a1
,'http://www.ascenttechnology.co.uk/schemas/entities' AS a2
,DEFAULT 'http://www.w3.org/21/XMLSchema-instance'
)
SELECT
#xmldata.*
,ref.value('attribute_name[1]','NVARCHAR(50)') as attribute_name
FROM #xmldata
CROSS APPLY xmldata.nodes('/Navigator/NavigatorNodes/NavigatorNode/a1:QueryFilter/a1:ConditionCollection/a1:Condition') T(ref)
But they're always coming back blank when I get near the namespaced nodes - I'm able to pull data from the nodes all the way up to '/Navigator/NavigatorNodes/NavigatorNode' but then have no luck.
Thanks!

You declare DEFAULT 'http://www.w3.org/21/XMLSchema-instance' but your XML string does even not have a default namespace.
Try
WITH XMLNAMESPACES(
'http://www.ascenttechnology.co.uk/schemas/services' AS a1
, 'http://www.ascenttechnology.co.uk/schemas/entities' AS a2
)

Related

Excel custom function not working in Online Excel

I have created an excel custom function with a shared runtime environment. It's working fine in the desktop app, but when I run the same project on the server it's not working. My excel function is not working online. I don't know why its behavior change in an online environment.
Can anyone tell me why I am getting making mistakes?
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<OfficeApp xmlns="http://schemas.microsoft.com/office/appforoffice/1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bt="http://schemas.microsoft.com/office/officeappbasictypes/1.0" xmlns:ov="http://schemas.microsoft.com/office/taskpaneappversionoverrides" xsi:type="TaskPaneApp">
<Id>a1753eec-7c8b-4dbd-ab74-3b30d63d9b15</Id>
<Version>1.0.0.0</Version>
<ProviderName>Contoso</ProviderName>
<DefaultLocale>en-US</DefaultLocale>
<DisplayName DefaultValue="Contoso" />
<Description DefaultValue="Write your own Excel functions in JavaScript." />
<IconUrl DefaultValue="https://localhost:3000/assets/lock.png" />
<HighResolutionIconUrl DefaultValue="https://localhost:3000/assets/lock.png" />
<SupportUrl DefaultValue="https://www.contoso.com/help" />
<AppDomains>
<AppDomain>https://localhost:3000</AppDomain>
</AppDomains>
<Hosts>
<Host Name="Workbook" />
</Hosts>
<Requirements>
<Sets DefaultMinVersion="1.1">
<Set Name="SharedRuntime" MinVersion="1.1" />
</Sets>
</Requirements>
<DefaultSettings>
<SourceLocation DefaultValue="https://localhost:3000/taskpane.html" />
</DefaultSettings>
<Permissions>ReadWriteDocument</Permissions>
<VersionOverrides xmlns="http://schemas.microsoft.com/office/taskpaneappversionoverrides" xsi:type="VersionOverridesV1_0">
<Hosts>
<Host xsi:type="Workbook">
<Runtimes>
<Runtime resid="Taskpane.Url" lifetime="long" />
</Runtimes>
<AllFormFactors>
<ExtensionPoint xsi:type="CustomFunctions">
<Script>
<SourceLocation resid="Functions.Script.Url" />
</Script>
<Page>
<SourceLocation resid="Taskpane.Url" />
</Page>
<Metadata>
<SourceLocation resid="Functions.Metadata.Url" />
</Metadata>
<Namespace resid="Functions.Namespace" />
</ExtensionPoint>
</AllFormFactors>
<DesktopFormFactor>
<GetStarted>
<Title resid="GetStarted.Title" />
<Description resid="GetStarted.Description" />
<LearnMoreUrl resid="GetStarted.LearnMoreUrl" />
</GetStarted>
<FunctionFile resid="Taskpane.Url" />
<ExtensionPoint xsi:type="PrimaryCommandSurface">
<CustomTab id="TabAddIns">
<Group id="CommandsGroup">
<Label resid="CommandsGroup.Label" />
<Icon>
<bt:Image size="16" resid="Icon.16x16" />
<bt:Image size="32" resid="Icon.32x32" />
<bt:Image size="80" resid="Icon.80x80" />
</Icon>
<Control xsi:type="Button" id="TaskpaneButton">
<Label resid="TaskpaneButton.Label" />
<Supertip>
<Title resid="TaskpaneButton.Label" />
<Description resid="TaskpaneButton.Tooltip" />
</Supertip>
<Icon>
<bt:Image size="16" resid="Icon.16x16" />
<bt:Image size="32" resid="Icon.32x32" />
<bt:Image size="80" resid="Icon.80x80" />
</Icon>
<Action xsi:type="ShowTaskpane">
<TaskpaneId>ButtonId1</TaskpaneId>
<SourceLocation resid="Taskpane.Url" />
</Action>
</Control>
</Group>
<Label resid="TaskpaneButton.Label" />
</CustomTab>
</ExtensionPoint>
</DesktopFormFactor>
</Host>
</Hosts>
<Resources>
<bt:Images>
<bt:Image id="Icon.16x16" DefaultValue="https://localhost:3000/assets/lock.png" />
<bt:Image id="Icon.32x32" DefaultValue="https://localhost:3000/assets/lock.png" />
<bt:Image id="Icon.80x80" DefaultValue="https://localhost:3000/assets/lock.png" />
</bt:Images>
<bt:Urls>
<bt:Url id="Functions.Script.Url" DefaultValue="https://localhost:3000/dist/functions.js" />
<bt:Url id="Functions.Metadata.Url" DefaultValue="https://localhost:3000/dist/functions.json" />
<bt:Url id="Functions.Page.Url" DefaultValue="https://localhost:3000/dist/functions.html" />
<bt:Url id="GetStarted.LearnMoreUrl" DefaultValue="https://go.microsoft.com/fwlink/?LinkId=276812" />
<bt:Url id="Commands.Url" DefaultValue="https://localhost:3000/commands.html" />
<bt:Url id="Taskpane.Url" DefaultValue="https://localhost:3000/taskpane.html" />
</bt:Urls>
<bt:ShortStrings>
<bt:String id="Functions.Namespace" DefaultValue="contoso" />
<bt:String id="GetStarted.Title" DefaultValue="Get started with your sample add-in!" />
<bt:String id="CommandsGroup.Label" DefaultValue="Get help" />
<bt:String id="TaskpaneButton.Label" DefaultValue="Login" />
</bt:ShortStrings>
<bt:LongStrings>
<bt:String id="GetStarted.Description" DefaultValue="Your sample add-in loaded succesfully. Go to the HOME tab and click the 'Show Taskpane' button to get started." />
<bt:String id="TaskpaneButton.Tooltip" DefaultValue="Click to Show a Taskpane" />
</bt:LongStrings>
</Resources>
</VersionOverrides>
</OfficeApp>

Checkbox not showing at custom datalist in Alfresco

I've been trying to help one of my colleagues with an issue with Alfresco custom datalists. We are using Alfresco Community 5.0.d
We have a custom datalist in which there is a checkbox in one of the fields.
The code in both sides looks the same to us... The file checkbox.ftl is inside the same place in both places, and it is exactly the same file. We have also rebuilt the indices just in case which as far as I have understood it won't be necessary in this case. All the datalist works correctly except the checkbox. We have seen that the 'input type="checkbox"' is not in the view generated at the production side. We have no clue where to look. I'm about to copy all the modified/added file for this matter. If you need any extra information just tell me and I will gladly provide it.
In the test environment, we have managed to make it work using the following code:
<model name="datos:datosModel"
xmlns="http://www.alfresco.org/model/dictionary/1.0">
<!-- Optional meta-data about the model -->
<description>Custom Datalist</description>
<author>Maria Royo</author>
<version>1.0</version>
<imports>
<!-- Import Alfresco Dictionary Definitions -->
<import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d"/>
<!-- Import Alfresco Content Domain Model Definitions -->
<import uri="http://www.alfresco.org/model/content/1.0" prefix="cm"/>
<!--Import Alfresco Data List Model Definitions -->
<import uri="http://www.alfresco.org/model/datalist/1.0" prefix="dl"/>
</imports>
<!-- Introduction of new namespaces defined by this model -->
<!-- NOTE: The following namespace custom.model should be changed to reflect your own namespace -->
<namespaces>
<namespace uri="datos.datosModel" prefix="datos"/>
</namespaces>
<!-- Tipo de dato combobox -->
<!-- Scope-->
<constraints>
<constraint name="datos:Scope" type="LIST">
<parameter name="allowedValues">
<list>
<value>ESA</value>
<value>IOT</value>
<value>Internal</value>
</list>
</parameter>
</constraint>
</constraints>
<types>
<!-- Data list defintions For this model go here -->
<type name="datos:datosTabla">
<title>Document Library</title>
<description>Document Library del EMIS</description>
<parent>dl:dataListItem</parent>
<properties>
<property name="datos:datosID">
<title>Reference</title>
<type>d:text</type>
<mandatory>false</mandatory>
</property>
<property name="datos:datosTitle">
<title>Title</title>
<type>d:text</type>
<mandatory>false</mandatory>
</property>
<property name="datos:datosVersions">
<title>Versions</title>
<type>d:text</type>
<mandatory>false</mandatory>
</property>
<property name="datos:datosIncr">
<title>Increment</title>
<type>d:text</type>
<mandatory>false</mandatory>
</property>
<property name="datos:datosUpdate">
<title>Last Update</title>
<type>d:date</type>
<mandatory>false</mandatory>
</property>
<property name="datos:datosDRD">
<title>DRD Reference</title>
<type>d:text</type>
<mandatory>false</mandatory>
</property>
<property name="datos:datosScope">
<title>Scope</title>
<type>d:text</type>
<mandatory>false</mandatory>
<constraints>
<constraint ref="datos:Scope" />
</constraints>
</property>
<property name="datos:datosRemarks">
<title>Remarks</title>
<type>d:text</type>
<mandatory>false</mandatory>
</property>
<!-- Type Checkbox -->
<property name="datos:datosDel">
<title>Delivered</title>
<description>Active</description>
<type>d:boolean</type>
</property>
</properties>
<associations>
<association name="datos:datosAttachments">
<title>Link</title>
<source>
<mandatory>false</mandatory>
<many>true</many>
</source>
<target>
<class>cm:cmobject</class>
<mandatory>false</mandatory>
<many>true</many>
</target>
</association>
</associations>
</type>
</types>
This is the code we have at the production environment:
<model name="datos:datosModel"
xmlns="http://www.alfresco.org/model/dictionary/1.0">
<!-- Optional meta-data about the model -->
<description>Custom Datalist</description>
<author>Maria Royo</author>
<version>1.0</version>
<imports>
<!-- Import Alfresco Dictionary Definitions -->
<import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d"/>
<!-- Import Alfresco Content Domain Model Definitions -->
<import uri="http://www.alfresco.org/model/content/1.0" prefix="cm"/>
<!--Import Alfresco Data List Model Definitions -->
<import uri="http://www.alfresco.org/model/datalist/1.0" prefix="dl"/>
</imports>
<!-- Introduction of new namespaces defined by this model -->
<!-- NOTE: The following namespace custom.model should be changed to reflect your own namespace -->
<namespaces>
<namespace uri="datos.datosModel" prefix="datos"/>
</namespaces>
<!-- Tipo de dato combobox -->
<!-- Scope-->
<constraints>
<constraint name="datos:Scope" type="LIST">
<parameter name="allowedValues">
<list>
<value>ESA</value>
<value>IOT</value>
<value>Internal</value>
</list>
</parameter>
</constraint>
</constraints>
<types>
<!-- Data list defintions For this model go here -->
<type name="datos:datosTabla">
<title>E-USOC Document Library</title>
<description>E-USOC Document Library</description>
<parent>dl:dataListItem</parent>
<properties>
<property name="datos:datosID">
<title>Reference</title>
<type>d:text</type>
<mandatory>false</mandatory>
</property>
<property name="datos:datosTitle">
<title>Title</title>
<type>d:text</type>
<mandatory>false</mandatory>
</property>
<property name="datos:datosVersions">
<title>Versions</title>
<type>d:text</type>
<mandatory>false</mandatory>
</property>
<property name="datos:datosIncr">
<title>Increment</title>
<type>d:text</type>
<mandatory>false</mandatory>
</property>
<property name="datos:datosUpdate">
<title>Last Update</title>
<type>d:date</type>
<mandatory>false</mandatory>
</property>
<property name="datos:datosDRD">
<title>DRD Reference</title>
<type>d:text</type>
<mandatory>false</mandatory>
</property>
<property name="datos:datosScope">
<title>Scope</title>
<type>d:text</type>
<mandatory>false</mandatory>
<constraints>
<constraint ref="datos:Scope" />
</constraints>
</property>
<property name="datos:datosRemarks">
<title>Remarks</title>
<type>d:text</type>
<mandatory>false</mandatory>
</property>
<!-- Type Checkbox -->
<property name="datos:datosDel">
<title>Delivered</title>
<description>Delivered</description>
<type>d:boolean</type>
</property>
</properties>
<associations>
<association name="datos:datosAttachments">
<title>Link</title>
<source>
<mandatory>false</mandatory>
<many>true</many>
</source>
<target>
<class>cm:cmobject</class>
<mandatory>false</mandatory>
<many>true</many>
</target>
</association>
</associations>
</type>
</types>
Both files are inside the same directory which is:
/alfresco-5.0.d/tomcat/shared/classes/alfresco/extension
Also, we have this code inside the:
/alfresco-5.0.d/tomcat/shared/classes/alfresco/web-extension/share_config_custom.xml
At test environment the code is as follow:
<config evaluator="model-type" condition="datos:datosTabla">
<forms>
<!-- Create item form -->
<form>
<field-visibility>
<show id="datos:datosID" />
<show id="datos:datosTitle" />
<show id="datos:datosAttachments" />
<show id="datos:datosVersions" />
<show id="datos:datosIncr" />
<show id="datos:datosUpdate" />
<show id="datos:datosDRD" />
<show id="datos:datosScope" />
<show id="datos:datosDel" />
<show id="datos:datosRemarks" />
</field-visibility>
<create-form template="/org/alfresco/components/data-lists/forms/dataitem.ftl" />
<appearance>
<field id="datos:datosID">
<control template="/org/alfresco/components/form/controls/textarea.ftl" />
</field>
<field id="datos:datosTitle">
<control template="/org/alfresco/components/form/controls/textarea.ftl" />
</field>
<field id="datos:datosAttachments">
<control>
<control-param name="startLocation">{doclib}</control-param>
</control>
</field>
<field id="datos:datosVersions">
<control template="/org/alfresco/components/form/controls/textarea.ftl" />
</field>
<field id="datos:datosIncr">
<control template="/org/alfresco/components/form/controls/textarea.ftl" />
</field>
<field id="datos:datosUpdates">
<control template="/org/alfresco/components/form/controls/textarea.ftl" />
</field>
<field id="datos:datosDRD">
<control template="/org/alfresco/components/form/controls/textarea.ftl" />
</field>
<field id="datos:datosScope">
<control template="/org/alfresco/components/form/controls/selectone.ftl" />
</field>
<field id="datos:datosDel">
<control template="/org/alfresco/components/form/controls/checkbox.ftl" />
</field>
<field id="datos:datosRemarks">
<control template="/org/alfresco/components/form/controls/textarea.ftl" />
</field>
</appearance>
</form>
<!--Data Grid view-->
<form id="datagrid">
<field-visibility>
<show id="datos:datosID" />
<show id="datos:datosTitle" />
<show id="datos:datosAttachments" />
<show id="datos:datosVersions" />
<show id="datos:datosIncr" />
<show id="datos:datosUpdate" />
<show id="datos:datosDRD" />
<show id="datos:datosScope" />
<show id="datos:datosDel" />
<show id="datos:datosRemarks" />
</field-visibility>
</form>
</forms>
</config>
<!-- Edit view -->
<config evaluator="node-type" condition="datos:datosTabla">
<forms>
Edit marketing item form
<form>
<field-visibility>
<show id="datos:datosID" />
<show id="datos:datosTitle" />
<show id="datos:datosAttachments" />
<show id="datos:datosVersions" />
<show id="datos:datosIncr" />
<show id="datos:datosUpdate" />
<show id="datos:datosDRD" />
<show id="datos:datosScope" />
<show id="datos:datosDel" />
<show id="datos:datosRemarks" />
</field-visibility>
<create-form template="/org/alfresco/components/data-lists/forms/dataitem.ftl" />
<appearance>
<field id="datos:datosID">
<control template="/org/alfresco/components/form/controls/textarea.ftl" />
</field>
<field id="datos:datosTitle">
<control template="/org/alfresco/components/form/controls/textarea.ftl" />
</field>
<field id="datos:datosAttachments">
<control>
<control-param name="startLocation">{doclib}</control-param>
</control>
</field>
<field id="datos:datosVersions">
<control template="/org/alfresco/components/form/controls/textarea.ftl" />
</field>
<field id="datos:datosIncr">
<control template="/org/alfresco/components/form/controls/textarea.ftl" />
</field>
<field id="datos:datosUpdates">
<control template="/org/alfresco/components/form/controls/textarea.ftl" />
</field>
<field id="datos:datosDRD">
<control template="/org/alfresco/components/form/controls/textarea.ftl" />
</field>
<field id="datos:datosScope">
<control template="/org/alfresco/components/form/controls/selectone.ftl" />
</field>
<field id="datos:datosDel">
<control template="/org/alfresco/components/form/controls/checkbox.ftl" />
</field>
<field id="datos:datosRemarks">
<control template="/org/alfresco/components/form/controls/textarea.ftl" />
</field>
</appearance>
</form>
</forms>
</config>
And finally the code in the production environment:
<config evaluator="model-type" condition="datos:datosTabla">
<forms>
<!-- Create item form -->
<form>
<field-visibility>
<show id="datos:datosID" />
<show id="datos:datosTitle" />
<show id="datos:datosAttachments" />
<show id="datos:datosVersions" />
<show id="datos:datosIncr" />
<show id="datos:datosUpdate" />
<show id="datos:datosDRD" />
<show id="datos:datosScope" />
<show id="datos:datosDel" />
<show id="datos:datosRemarks" />
</field-visibility>
<create-form template="/org/alfresco/components/data-lists/forms/dataitem.ftl" />
<appearance>
<field id="datos:datosID">
<control template="/org/alfresco/components/form/controls/textarea.ftl" />
</field>
<field id="datos:datosTitle">
<control template="/org/alfresco/components/form/controls/textarea.ftl" />
</field>
<field id="datos:datosAttachments">
<control>
<control-param name="startLocation">{doclib}</control-param>
</control>
</field>
<field id="datos:datosVersions">
<control template="/org/alfresco/components/form/controls/textarea.ftl" />
</field>
<field id="datos:datosIncr">
<control template="/org/alfresco/components/form/controls/textarea.ftl" />
</field>
<field id="datos:datosUpdates">
<control template="/org/alfresco/components/form/controls/textarea.ftl" />
</field>
<field id="datos:datosDRD">
<control template="/org/alfresco/components/form/controls/textarea.ftl" />
</field>
<field id="datos:datosScope">
<control template="/org/alfresco/components/form/controls/selectone.ftl" />
</field>
<field id="datos:datosDel">
<control template="/org/alfresco/components/form/controls/checkbox.ftl" />
</field>
<field id="datos:datosRemarks">
<control template="/org/alfresco/components/form/controls/textarea.ftl" />
</field>
</appearance>
</form>
<!--Data Grid view-->
<form id="datagrid">
<field-visibility>
<show id="datos:datosID" />
<show id="datos:datosTitle" />
<show id="datos:datosAttachments" />
<show id="datos:datosVersions" />
<show id="datos:datosIncr" />
<show id="datos:datosUpdate" />
<show id="datos:datosDRD" />
<show id="datos:datosScope" />
<show id="datos:datosDel" />
<show id="datos:datosRemarks" />
</field-visibility>
</form>
</forms>
</config>
<!-- Edit view -->
<config evaluator="node-type" condition="datos:datosTabla">
<forms>
<!-- Edit marketing item form -->
<form>
<field-visibility>
<show id="datos:datosID" />
<show id="datos:datosTitle" />
<show id="datos:datosAttachments" />
<show id="datos:datosVersions" />
<show id="datos:datosIncr" />
<show id="datos:datosUpdate" />
<show id="datos:datosDRD" />
<show id="datos:datosScope" />
<show id="datos:datosDel" />
<show id="datos:datosRemarks" />
</field-visibility>
<create-form template="/org/alfresco/components/data-lists/forms/dataitem.ftl" />
<appearance>
<field id="datos:datosID">
<control template="/org/alfresco/components/form/controls/textarea.ftl" />
</field>
<field id="datos:datosTitle">
<control template="/org/alfresco/components/form/controls/textarea.ftl" />
</field>
<field id="datos:datosAttachments">
<control>
<control-param name="startLocation">{doclib}</control-param>
</control>
</field>
<field id="datos:datosVersions">
<control template="/org/alfresco/components/form/controls/textarea.ftl" />
</field>
<field id="datos:datosIncr">
<control template="/org/alfresco/components/form/controls/textarea.ftl" />
</field>
<field id="datos:datosUpdates">
<control template="/org/alfresco/components/form/controls/textarea.ftl" />
</field>
<field id="datos:datosDRD">
<control template="/org/alfresco/components/form/controls/textarea.ftl" />
</field>
<field id="datos:datosScope">
<control template="/org/alfresco/components/form/controls/selectone.ftl" />
</field>
<field id="datos:datosDel">
<control template="/org/alfresco/components/form/controls/checkbox.ftl" />
</field>
<field id="datos:datosRemarks">
<control template="/org/alfresco/components/form/controls/textarea.ftl" />
</field>
</appearance>
</form>
</forms>
</config>

ngCordova Camera not working in iOS

I use ngCordova and in order to access the camera i use the below code
var destinationType = navigator.camera.DestinationType.FILE_URI;
var options = {
quality: 50,
destinationType: destinationType,
sourceType: pictureSource,
correctOrientation: true,
encodingType: Camera.EncodingType.PNG,
}
var cameraPromise = $cordovaCamera.getPicture(options);
cameraPromise.then(function (imageUri) {
deferedPromise.resolve(imageUri);
$cordovaCamera.cleanup();
});
return deferedPromise;
The code works fine in Android but when i run the same on iOS it takes the photo but returns to the app but when i click on view image the link seems to be broken . See below
In orde to test the changes we need to do a remote build so testing the app is difficult . Is there anything obvious that i am missing ? The File Explorer option seems to work in iOs that is image picked from the gallery is picked and on view is shown ?
<?xml version="1.0" encoding="utf-8"?>
<widget xmlns:cdv="http://cordova.apache.org/ns/1.0" xmlns:vs="http://schemas.microsoft.com/appx/2014/htmlapps" id="com.frontavenue.hseq" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" defaultlocale="en-US">
<name>HSEQ Master</name>
<description>HSEQ</description>
<author href="http://cordova.io" email="dev#cordova.apache.org">frontAvenue</author>
<content src="index.html" />
<vs:features />
<preference name="SplashScreen" value="screen" />
<preference name="SplashScreenDelay" value="5000" />
<preference name="windows-target-version" value="8.1" />
<!-- Support for Cordova 5.0.0 plugin system -->
<plugin name="cordova-plugin-whitelist" version="1" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<allow-intent href="tel:*" />
<allow-intent href="sms:*" />
<allow-intent href="mailto:*" />
<allow-intent href="geo:*" />
<platform name="android">
<allow-intent href="market:*" />
</platform>
<platform name="ios">
<allow-intent href="itms:*" />
<allow-intent href="itms-apps:*" />
</platform>
<platform name="android">
<icon src="res/icons/android/icon-36-ldpi.png" density="ldpi" />
<icon src="res/icons/android/icon-48-mdpi.png" density="mdpi" />
<icon src="res/icons/android/icon-72-hdpi.png" density="hdpi" />
<icon src="res/icons/android/icon-96-xhdpi.png" density="xhdpi" />
</platform>
<platform name="ios">
<!-- iOS 8.0+ -->
<!-- iPhone 6 Plus -->
<icon src="res/icons/ios/icon-60-3x.png" width="180" height="180" />
<!-- iOS 7.0+ -->
<!-- iPhone / iPod Touch -->
<icon src="res/icons/ios/icon-60.png" width="60" height="60" />
<icon src="res/icons/ios/icon-60-2x.png" width="120" height="120" />
<!-- iPad -->
<icon src="res/icons/ios/icon-76.png" width="76" height="76" />
<icon src="res/icons/ios/icon-76-2x.png" width="152" height="152" />
<!-- iOS 6.1 -->
<!-- Spotlight Icon -->
<icon src="res/icons/ios/icon-40.png" width="40" height="40" />
<icon src="res/icons/ios/icon-40-2x.png" width="80" height="80" />
<!-- iPhone / iPod Touch -->
<icon src="res/icons/ios/icon-57.png" width="57" height="57" />
<icon src="res/icons/ios/icon-57-2x.png" width="114" height="114" />
<!-- iPad -->
<icon src="res/icons/ios/icon-72.png" width="72" height="72" />
<icon src="res/icons/ios/icon-72-2x.png" width="144" height="144" />
<!-- iPhone Spotlight and Settings Icon -->
<icon src="res/icons/ios/icon-small.png" width="29" height="29" />
<icon src="res/icons/ios/icon-small-2x.png" width="58" height="58" />
<!-- iPad Spotlight and Settings Icon -->
<icon src="res/icons/ios/icon-50.png" width="50" height="50" />
<icon src="res/icons/ios/icon-50-2x.png" width="100" height="100" />
</platform>
<platform name="windows">
<icon src="res/icons/windows/Square150x150Logo.scale-100.png" width="150" height="150" />
<icon src="res/icons/windows/Square150x150Logo.scale-240.png" width="360" height="360" />
<icon src="res/icons/windows/Square30x30Logo.scale-100.png" width="30" height="30" />
<icon src="res/icons/windows/Square310x310Logo.scale-100.png" width="310" height="310" />
<icon src="res/icons/windows/Square44x44Logo.scale-240.png" width="106" height="106" />
<icon src="res/icons/windows/Square70x70Logo.scale-100.png" width="70" height="70" />
<icon src="res/icons/windows/Square71x71Logo.scale-240.png" width="170" height="170" />
<icon src="res/icons/windows/StoreLogo.scale-100.png" width="50" height="50" />
<icon src="res/icons/windows/StoreLogo.scale-240.png" width="120" height="120" />
<icon src="res/icons/windows/Wide310x150Logo.scale-100.png" width="310" height="150" />
<icon src="res/icons/windows/Wide310x150Logo.scale-240.png" width="744" height="360" />
</platform>
<platform name="wp8">
<icon src="res/icons/wp8/ApplicationIcon.png" width="62" height="62" />
<icon src="res/icons/wp8/Background.png" width="173" height="173" />
</platform>
<platform name="android">
<splash src="res/screens/android/screen-hdpi-landscape.png" density="land-hdpi" />
<splash src="res/screens/android/screen-ldpi-landscape.png" density="land-ldpi" />
<splash src="res/screens/android/screen-mdpi-landscape.png" density="land-mdpi" />
<splash src="res/screens/android/screen-xhdpi-landscape.png" density="land-xhdpi" />
<splash src="res/screens/android/screen-hdpi-portrait.png" density="port-hdpi" />
<splash src="res/screens/android/screen-ldpi-portrait.png" density="port-ldpi" />
<splash src="res/screens/android/screen-mdpi-portrait.png" density="port-mdpi" />
<splash src="res/screens/android/screen-xhdpi-portrait.png" density="port-xhdpi" />
</platform>
<platform name="ios">
<splash src="res/screens/ios/screen-iphone-portrait.png" width="320" height="480" />
<splash src="res/screens/ios/screen-iphone-portrait-2x.png" width="640" height="960" />
<splash src="res/screens/ios/screen-ipad-portrait.png" width="768" height="1024" />
<splash src="res/screens/ios/screen-ipad-portrait-2x.png" width="1536" height="2048" />
<splash src="res/screens/ios/screen-ipad-landscape.png" width="1024" height="768" />
<splash src="res/screens/ios/screen-ipad-landscape-2x.png" width="2048" height="1536" />
<splash src="res/screens/ios/screen-iphone-568h-2x.png" width="640" height="1136" />
<splash src="res/screens/ios/screen-iphone-portrait-667h.png" width="750" height="1334" />
<splash src="res/screens/ios/screen-iphone-portrait-736h.png" width="1242" height="2208" />
<splash src="res/screens/ios/screen-iphone-landscape-736h.png" width="2208" height="1242" />
</platform>
<platform name="windows">
<splash src="res/screens/windows/SplashScreen.scale-100.png" width="620" height="300" />
<splash src="res/screens/windows/SplashScreen.scale-240.png" width="1152" height="1920" />
<splash src="res/screens/windows/SplashScreenPhone.scale-240.png" width="1152" height="1920" />
</platform>
<platform name="wp8">
<splash src="res/screens/wp8/SplashScreenImage.jpg" width="480" height="800" />
</platform>
<vs:plugin name="cordova-plugin-camera" version="1.2.0" />
<vs:plugin name="cordova-plugin-file" version="3.0.0" />
<vs:plugin name="cordova-plugin-splashscreen" version="2.1.0" />
<vs:plugin name="cordova-plugin-file-transfer" version="1.4.0" />
<vs:plugin name="cordova-plugin-dialogs" version="1.2.0" />
<vs:plugin name="cordova-plugin-network-information" version="1.1.0" />
<vs:plugin name="de.appplant.cordova.plugin.email-composer" version="0.8.2" src="C:\Users\francisf\Downloads\cordova-plugin-email-composer-0.8.2" />
<preference name="Fullscreen" value="False" />
<preference name="KeepRunning" value="False" />
<preference name="ShowTitle" value="True" />
<preference name="InAppBrowserStorageEnabled" value="False" />
<preference name="SuppressesIncrementalRendering" value="True" />
<vs:plugin name="com.ionic.keyboard" version="1.0.4" src="C:\Users\francisf\Downloads\ionic-plugin-keyboard-1.0.4" />
<vs:plugin name="com.hiddentao.cordova.filepath" version="1.0.0" src="F:\D-Drive\Softwares\Cordova_Plugins\cordova-plugin-filepath-master" />
<vs:plugin name="com.synconset.imagepicker" version="1.0.7" src="F:\D-Drive\Softwares\Cordova_Plugins\cordova-imagePicker-1.0.7" />
<preference name="Orientation" value="default" />
</widget>

Log4Net not calling the stored procedure using commandType

Long story short, I'm using Log4net and I want to write inside into the DB calling a Stored Procedure. Here is the setting in the web.config:
<log4net debug="true">
<root>
<level value="ALL" />
<appender-ref ref="AdoNetAppender" />
<appender-ref ref="RollingLogFileAppender" />
</root>
<appender name="AdoNetAppender" type="log4net.Appender.AdoNetAppender">
<bufferSize value="1" />
<threshold value="ALL"/>
<connectionType value="System.Data.SqlClient.SqlConnection, System.Data, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<connectionString value="data source=***;initial catalog=***;user id=**;password=***;MultipleActiveResultSets=True;" />
<commandText value="iE_AddUserActivityLog" />
<commandType value="StoredProcedure" />
<parameter>
<parameterName value="#log_date" />
<dbType value="DateTime" />
<layout type="log4net.Layout.RawTimeStampLayout" />
</parameter>
<parameter>
<parameterName value="#thread" />
<dbType value="AnsiString" />
<size value="255" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%thread" />
</layout>
</parameter>
<parameter>
<parameterName value="#log_level" />
<dbType value="AnsiString" />
<size value="50" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%level" />
</layout>
</parameter>
<parameter>
<parameterName value="#logger" />
<dbType value="AnsiString" />
<size value="255" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%logger" />
</layout>
</parameter>
<parameter>
<parameterName value="#page" />
<dbType value="AnsiString" />
<size value="255" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%property{page}" />
</layout>
</parameter>
<parameter>
<parameterName value="#host" />
<dbType value="AnsiString" />
<size value="50" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%property{host}" />
</layout>
</parameter>
<parameter>
<parameterName value="#ipaddress" />
<dbType value="AnsiString" />
<size value="15" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%property{ipaddress}" />
</layout>
</parameter>
<parameter>
<parameterName value="#browser" />
<dbType value="AnsiString" />
<size value="15" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%property{browser}" />
</layout>
</parameter>
<parameter>
<parameterName value="#platform" />
<dbType value="AnsiString" />
<size value="15" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%property{platform}" />
</layout>
</parameter>
<parameter>
<parameterName value="#device" />
<dbType value="AnsiString" />
<size value="15" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%property{device}" />
</layout>
</parameter>
<parameter>
<parameterName value="#message" />
<dbType value="AnsiString" />
<size value="4000" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%message" />
</layout>
</parameter>
<parameter>
<parameterName value="#exception" />
<dbType value="AnsiString" />
<size value="2000" />
<layout type="log4net.Layout.ExceptionLayout" />
</parameter>
</appender>
<appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
<file value="logs\log.txt" />
<appendToFile value="true" />
<rollingStyle value="Size" />
<maxSizeRollBackups value="10" />
<maximumFileSize value="10MB" />
<staticLogFileName value="true" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%-5p %d %5rms %-22.22c{1} %-18.18M - %m%n" />
</layout>
</appender>
</log4net>
Can someone help me here to understand why I cannot use the commandType? Because if I use either:
<commandText value="INSERT INTO user_activity_log ([Date],[Thread],[Level],[Logger],[page],[host],[browser],[platform],[device],[ipaddress],[Message],[Exception]) VALUES (#log_date, #thread, #log_level, #logger, #page, #host, #browser, #platform, #device, #ipaddress, #message, #exception)" />
or:
<commandText value="exec iE_AddUserActivityLog #log_date, #thread, #log_level, #logger, #page, #host, #browser, #platform, #device, #ipaddress, #message, #exception" />
I can see that is writing.
UPDATE: I've also tried to introduce the DBO prefix, in this way:
<commandText value="dbo.iE_AddUserActivityLog" />
<commandType value="StoredProcedure" />
Ok, I was to able to solve it. But I'm not sure why. Basically, I needed to rename the some parameters in the web.config, in order to match with the same name that I have in my Stored Procedure.

Log4net SmtpAppender configuration to receive chunks of log

I would like to save everything in a log file and receive mails containing 512 messages per mail.
RollingFileAppender works fine. But in emails I receive sometimes 1 message in mail, sometimes 4 messages (not the same ones).
I tried MemoryAppender too. There I have also 1-2 messages in queue, nothing more.
I tried "lossy" SmtpAppender, the result is same. What should I change?
My configuration is here
<log4net>
<appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
<file value="c:\temp\log-" />
<bufferSize value="0" />
<appendToFile value="true" />
<rollingStyle value="Composite" />
<param name="DatePattern" value="yyyy.MM.dd'.log'" />
<maxSizeRollBackups value="-1" />
<maximumFileSize value="10MB" />
<staticLogFileName value="false" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date %-5level - %message%newline" />
</layout>
</appender>
<appender name="SmtpAppender" type="log4net.Appender.SmtpAppender">
<bufferSize value="512" />
<lossy value="false" />
<authentication value="Basic" />
<to value="test#test.com" />
<from value="test#test.com" />
<username value="test#test.com" />
<password value="xxxxx" />
<subject value="My subject" />
<smtpHost value="mail.test.com" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date %-5level - %message%newline" />
</layout>
</appender>
<root>
<level value="ALL" />
<appender-ref ref="RollingLogFileAppender" />
<appender-ref ref="SmtpAppender" />
</root>
</log4net>
The following appender config works for me (I get 6 log messages at a time):
<appender name="SmtpAppender" type="log4net.Appender.SmtpAppender">
<to value="name#server.com" />
<from value="name#server.com" />
<subject value="Log Email" />
<smtpHost value="email.test.com" />
<bufferSize value="5" />
<lossy value="false" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%property{log4net:HostName} :: %date %level %logger [%thread] - %message%newline" />
</layout>
</appender>
Do your log messages have multiple lines perhaps?

Resources