XAML AdMediator windows 10 configuration - nothing I do shows the ad. - c#

I'm having a hard time getting my ad to show.
Here is my ad element:
<Universal:AdMediatorControl x:Name="AdMediator_2CB784" Height="80" Id="AdMediator-Id-30C8B005-60BC-4616-A7E5-06946A425C5D" Margin="0" Grid.Row="0" VerticalAlignment="Top" />
In visual studios I added the connected service and I configured the Ad Mediation during the first submission (It passed certification but I haven't published it.)
This is what autopopulated when I added the connected service:
<?xml version="1.0" encoding="utf-8"?>
<AdMediatorConfiguration xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<BaseConfiguration>
<AdAdapters>
<AdAdapterInfo>
<Metadata>
<Property>
<Key>WApplicationId</Key>
<Value>fc24e866-0e16-40be-8c10-6908c9b6a4b7</Value>
</Property>
<Property>
<Key>MApplicationId</Key>
<Value>fc24e866-0e16-40be-8c10-6908c9b6a4b7</Value>
</Property>
</Metadata>
<Name>MicrosoftAdvertising</Name>
<Weight>100</Weight>
</AdAdapterInfo>
</AdAdapters>
<AdAdapters>
<AdAdapterInfo>
<Metadata>
<Property>
<Key>WApplicationId</Key>
<Value>f005d95d-4adf-4b55-8020-3b56d74f3253</Value>
</Property>
<Property>
<Key>WAdUnitId</Key>
<Value>242247</Value>
</Property>
<Property>
<Key>WWidth</Key>
<Value>300</Value>
</Property>
<Property>
<Key>WHeight</Key>
<Value>250</Value>
</Property>
<Property>
<Key>MApplicationId</Key>
<Value>22c93881-85e4-487e-bd1a-b9175857e320</Value>
</Property>
<Property>
<Key>MAdUnitId</Key>
<Value>242249</Value>
</Property>
<Property>
<Key>MWidth</Key>
<Value>480</Value>
</Property>
<Property>
<Key>MHeight</Key>
<Value>80</Value>
</Property>
</Metadata>
<Name>MicrosoftAdvertising</Name>
<Rank>1</Rank>
<Weight>100</Weight>
</AdAdapterInfo>
</AdAdapters>
<AdControlConfigurations>
<AdControlConfiguration>
<AdAdapters>
<AdAdapterInfo>
<Metadata>
<Property>
<Key>WAdUnitId</Key>
<Value>10043121</Value>
</Property>
<Property>
<Key>MAdUnitId</Key>
<Value>10865270</Value>
</Property>
</Metadata>
<Name>MicrosoftAdvertising</Name>
</AdAdapterInfo>
</AdAdapters>
<Id>AdMediator-Id-30C8B005-60BC-4616-A7E5-06946A425C5D</Id>
<Name>AdMediator_2CB784</Name>
</AdControlConfiguration>
</AdControlConfigurations>
</BaseConfiguration>
<FileVersion>1.0.1</FileVersion>
<RefreshRate>30</RefreshRate>
<SchemaVersion>1.0.3</SchemaVersion>
<UpdatedDateTime>2015-09-06T15:06:23.7901527Z</UpdatedDateTime>
<UseRoundRobin>true</UseRoundRobin>
</AdMediatorConfiguration>
Per the developer dashboard, fc24e866-0e16-40be-8c10-6908c9b6a4b7 is my application ID. I'm not sure if there should be two or not, but I tried removing those nodes, changing the ID value to my application ID, but nothing happens.
In my app, there just a blank space where my ad unit is. Please help. Thanks.

Here is what worked for me, but I am still not certain it is the best control.
Here's the link I followed:
https://msdn.microsoft.com/en-us/library/windows/apps/xaml/mt219682.aspx

Related

Apache Ignite: can't insert data to persistent cache, because affinity for topology version is not initialized

I am trying to insert data to persistent data region with thin .NET client and after I call PutAllAsync method ignite process is terminated with the following error:
[15:45:09,616][SEVERE][exchange-worker-#66][] JVM will be halted immediately due to the failure: [failureCtx=FailureContext [type=SYSTEM_WORKER_TERMINATION, err=class o.a.i.IgniteCheckedException: Affinity for topology version is not initialized [locNode=8fda194c-c82f-4d52-80b0-24ac1d7c8be7, grp=ignite-sys-cache, topVer=AffinityTopologyVersion [topVer=1, minorTopVer=2], head=AffinityTopologyVersion [topVer=1, minorTopVer=1], history=[AffinityTopologyVersion [topVer=1, minorTopVer=1]]]]]
Here is default-config.xml:
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd">
<!--
Alter configuration below as needed.
-->
<bean id="grid.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">
<property name="dataStorageConfiguration">
<bean class="org.apache.ignite.configuration.DataStorageConfiguration">
<property name="dataRegionConfigurations">
<list>
<bean class="org.apache.ignite.configuration.DataRegionConfiguration">
<property name="name" value="data_persistent_region"/>
<property name="persistenceEnabled" value="true"/>
</bean>
</list>
</property>
</bean>
</property>
</bean>
</beans>
And here is an example of data insertion:
var cacheConfiguration = new CacheClientConfiguration(key, cacheEntity);
cacheConfiguration.CacheMode = CacheMode.Replicated;
cacheConfiguration.DataRegionName = "data_persistent_region";
_igniteClient.GetOrCreateCache<int, T>(cacheConfiguration)
.PutAll(data.Select((x, i) => new KeyValuePair<int, T>(i, x)));
Tried to use "-Djava.net.preferIPv4Stack=true" and "-DIGNITE_QUIET=false" options but it did not help.
PS. I am using Apache Ignite 2.10.0. If I disable region persistance everything works ok.
Seems I figured out what was the problem: cache key contains not supported symbol ":" to create file with the same name.

Need to get a particular value from XML

I have followed many tutorials here on LINQ to XML http://www.dotnetcurry.com/showarticle.aspx?ID=564
The terminology for the XML documents is confusing.
Could someone please help me to write the code snippet that would extract the "Name" value from this xml based on a condition for example.
I need colSDate and colAcqDate because Visible is True but not colSeqNo because it does not have the Visible property or it is set to False.
<XtraSerializer version="1.0" application="View">
<property name="#LayoutVersion" />
<property name="ActiveFilterEnabled">true</property>
<property name="Columns" iskey="true" value="286">
<property name="Item1" isnull="true" iskey="true">
<property name="Name">colSeqNo</property>
</property>
<property name="Item2" isnull="true" iskey="true">
<property name="Visible">true</property>
<property name="VisibleIndex">0</property>
<property name="Name">colSDate</property>
</property>
<property name="Item3" isnull="true" iskey="true">
<property name="Visible">true</property>
<property name="VisibleIndex">1</property>
<property name="Name">colAcqDate</property>
</property>
</property>
<property name="ActiveFilterString" />
<property name="GroupSummarySortInfoState" />
<property name="FindFilterText" />
<property name="FindPanelVisible">false</property>
</XtraSerializer>
I am trying to write some reasonably performing data access code but the absurd requirements are making it difficult. Any help is extremely appreciated. Thanks in advance.
Here is one way to do it, using LINQ to XML:
Dim result = From d In xml.Descendants("property")
Where d.Attribute("name").Value = "Visible" AndAlso
d.Value = "true"
From e As XElement In d.Parent.Elements
Where e.Attribute("name").Value = "Name"
Select e.Value
or using XPath (not sure if you want vb or c# code, not a huge dif):
Dim x As XmlNodeList = ' ... pardon the break here, want to get it all in window.
d.SelectNodes(".//property[#name='Visible'][.='true']/../property[#name='Name']")

How Can i associate an aspect and his property to a document in C# DotCmis Alfresco

I am working in a .net web application than need to be able to create documents in Alfresco and then associate a particular aspect and his prperties to those documents.
I created my aspect (nameModel.xml, name-model-context.xml all this files in the extension folder, name.properties in messages folder and custom-slingshot-application-context.xml share-config-custom.xml in the web-extension folder) in /opt/bitnami/apache-tomcat/shared/classes/alfresco/ path.
In my C# code, i have two methods:
public void PutFile(CMISDocument document)
{
IObjectId cmisObjectFolder = (IObjectId)session.GetObject(document.FolderId);
IDictionary<string, object> properties = new Dictionary<string, object>();
properties[PropertyIds.Name] = document.ContentStreamFileName;
properties[PropertyIds.ObjectTypeId] = "cmis:document";
properties[PropertyIds.CreationDate] = DateTime.Now;
ContentStream contentStream = new ContentStream();
contentStream.FileName = document.ContentStreamFileName;
contentStream.MimeType = document.ContentStreamMimeType;
contentStream.Length = document.Stream.Length;
contentStream.Stream = document.Stream;
IObjectId objectId = session.CreateDocument(properties, cmisObjectFolder, contentStream, DotCMIS.Enums.VersioningState.None);
PutFileDetail(objectId,document.Owner);
}
internal void PutFileDetail(IObjectId objectId,string actorIdCard)
{
ICmisObject cmisObject = session.GetObject(objectId);
IDictionary<string, object> properties = new Dictionary<string, object>();
properties[PropertyIds.ObjectTypeId] = "adm:aridoctypBase";
properties["adm:actidcard"] = actorIdCard;
IObjectId newId = cmisObject.UpdateProperties(properties);
if (newId.Id == cmisObject.Id)
{
// the repository updated this object - refresh the object
cmisObject.Refresh();
}
else
{
// the repository created a new version - fetch the new version
cmisObject = session.GetObject(newId);
}
}
With this code i have as result a error:
The first one is for create the document and the second one is for add the aspect and his properties.
I was looking for a answer, and i finded this: http://docs.alfresco.com/4.0/index.jsp?topic=%2Fcom.alfresco.enterprise.doc%2Fconcepts%2Fopencmis-ext-intro.html
But a really do not know how install Alfresco OpenCMIS Extension; they say that i need put the jar file in my class path. But i do not know what is my class path in bitnami virtual machine.
Other thing is if i forgot something in the creation of my aspect.
pd: It is important but nor urgent for me, that the way to do it could be work if one day a need change Alfresco to Sharepoint or another else enterprise content management
I will apreciate any help.
Thanks! Do you know where can i see a good example? I think that the first point: i need change my model. In this moment i have the properties inside of aspect tags. I will need create the types and the properties ... can you tell me if i am going in good way...?
This is my model xml file (aridocsModel.xml) resume:
<?xml version="1.0" encoding="UTF-8"?>
<model name="adm:aridocsModel" xmlns="http://www.alfresco.org/model/dictionary/1.0">
...
<aspects>
<aspect name="adm:aridocsBase">
<title>AriDocs Base</title>
<properties>
<property name="adm:createdate">
<type>d:date</type>
</property>
<property name="adm:disabledate">
<type>d:date</type>
</property>
<property name="adm:artiddoc">
<type>d:text</type>
</property>
<property name="adm:accnumber">
<type>d:text</type>
</property>
<property name="adm:actidcard">
<type>d:text</type>
</property>
</properties>
</aspect>
</aspects>
</model>
Now, how i can not work with aspects; and i need types ...
<?xml version="1.0" encoding="UTF-8"?>
<model name="adm:aridocsModel" xmlns="http://www.alfresco.org/model/dictionary/1.0">
...
<types>
<type name="adm:aridoctypBase">
<title>Ari Docs Type Base</title>
<parent>cm:content</parent>
<properties>
<property name="adm:createdate">
<type>d:date</type>
</property>
<property name="adm:disabledate">
<type>d:date</type>
</property>
<property name="adm:artiddoc">
<type>d:text</type>
</property>
<property name="adm:accnumber">
<type>d:text</type>
</property>
<property name="adm:actidcard">
<type>d:text</type>
</property>
</properties>
</type>
</types>
...
<!-- i need put the aspect here... Even if i will work with types... -->
...
</model>
I will appreciate any advice.
You don't need the extensions on creating a document. The extension is only for managing aspects.
And from what I've heard the extension isn't available in all the languages, so I'm not sure if there is a .dll for you to include in your project.
Did you read these topics: integrate a .net application with alfresco using cmis
And: .net wcf and create document

Using multiple AutoProxyCreator for the same objects

I am using Spring.Net for IOC and AOP. It seems Spring.Net does not support multiple AutoProxyCreators. I have following classes:
[Facade]
public abstract class AbstractFacade{
}
[TransactionSupportFacade]
public abstract class AbstractTransactionSupportFacade{
}
Some classes are inherited from above classes, I have following xml configuration:
<object type="Spring.Aop.Framework.AutoProxy.AttributeAutoProxyCreator , Spring.Aop">
<property name="AttributeTypes">
<list>
<value>Common.Attributes.TransactionSupportFacadeAttribute, Common</value>
</list>
</property>
<property name="InterceptorNames">
<list>
<value>JUTransactionInterceptor</value>
</list>
</property>
<property name="CheckInherited">
<value>true</value>
</property>
</object>
<object type="Spring.Aop.Framework.AutoProxy.AttributeAutoProxyCreator , Spring.Aop">
<property name="AttributeTypes">
<list>
<value>Common.Attributes.FacadeAttribute, Common</value>
</list>
</property>
<property name="InterceptorNames">
<list>
<value>IdentifyServiceAspect</value>
<value>PushIdentityAspect</value>
<value>AuthenticationAdvice</value>
<value>ValidationAspect</value>
<value>ServiceCallResultWrapperAspect</value>
</list>
</property>
<property name="CheckInherited">
<value>true</value>
</property>
</object>
the problem raises here, only one of these AttributeAutoProxyCreators work at the same time, please help me to solve this problem.

Wrong connection string NHibernate 3.3

How to write correct connection string for Nhibernate using SQL Server 2012?
Should I write also database name?
Error:
I get error with wrong „initial catalog”
Wrong connection string for NHibernate (I copy this connection string from my server):
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
<session-factory>
<property name="connection.provider">NHibernate.Connection.DriverConnectionProvider</property>
<property name="dialect">NHibernate.Dialect.MsSqlCeDialect</property>
<property name="connection.driver_class">NHibernate.Driver.SqlServerCeDriver</property>
<property name="connection.connection_string">Data Source=RAFAL-KOMPUTER\MSSQLSERVER4;Initial Catalog=rafal;Integrated Security=True</property>
<property name="show_sql">true</property>
</session-factory>
</hibernate-configuration>
I copy connection string from this part:
I am trying also this but does not help.
<property name="connection.provider">NHibernate.Connection.DriverConnectionProvider</property>
<property name="dialect">NHibernate.Dialect.MsSql2008Dialect</property>
<property name="connection.driver_class">NHibernate.Driver.SqlClientDriver</property>
<property name="connection.connection_string">Data Source=RAFAL-KOMPUTER\MSSQLSERVER4;Initial Catalog=rafal;Integrated Security=True</property>
I don`t know how correct configure for SQL Server 2012
The first snippet should not work, while the driver is for CE (Compact edition).
The second one looks better, and even more it is working for me. (see more here http://www.connectionstrings.com/sql-server-2012). The most important thing, is to have correct settings of the Provider name (check here: https://stackoverflow.com/a/8150792/315850). Try this adjusted snippet (just to be sure that all parts are set correctly)
<property name="connection.provider">NHibernate.Connection.DriverConnectionProvider</property>
<!-- to profit from features in 2012, use its dialect -->
<property name="dialect">NHibernate.Dialect.MsSql2012Dialect</property>
<property name="connection.driver_class">NHibernate.Driver.SqlClientDriver</property>
<!-- the simplest connection string -->
<property name="connection.connection_string">Data Source=RAFAL-KOMPUTER\MSSQLSERVER4;Database=rafal;Trusted_Connection=True;</property>
We have to be sure that correct driver is used (not CE or any other then NHibernate.Driver.SqlClientDriver which means System.Data.SqlClient)
Double check that your 1) SQL server and named instance is: RAFAL-KOMPUTER\MSSQLSERVER4 and 2) the Database name is: rafal and 3) your login has access rights to it, this must work
just replace : SqlServerCeDriver by SqlClientDriver as below :
Replace : <property name="connection.driver_class">NHibernate.Driver.SqlServerCeDriver</property>
By: <property name="connection.driver_class">NHibernate.Driver.SqlClientDriver</property>

Categories

Resources