DNN manifest problems - modules not working after install - dotnetnuke

Having trouble creating a manifest for a couple of modules. The module controls live in:
DesktopModules/Org/ItemManagement
Each module does related but different things, and so should be draggable onto a page as a standalone module.
After looking around, I think I need to create multiple package definitions in the manifest, so I have done that. I have then uploaded the controls and the manifest to the above folder, and installed using Host->Extensions->Create New Module->From Manifest
It seemed to installed okay, appears in the extension list, and appears in the module bar to add to a page; however, when I drag to a location on the page, the page errors on the call to /DesktopModules/internalservices/API/controlbar/AddModule with "The requested resource does not support http method 'GET'.".
If I put each control in a separate folder and install using Host->Extensions->Create New Module->From Control everything works fine, however this is not ideal as all controls will eventually share resources liek CSS, scripts etc., and ideally I want them to just get them from the ModulePath, just so everything is in one place.
Is there anything obviously wrong in my manifest?
<?xml version="1.0" encoding="UTF-8"?>
<dotnetnuke type="Package" version="5.0">
<packages>
<package name="Org_My_Items" type="Module" version="01.00.00">
<friendlyName>My Items</friendlyName>
<description>
My Items grid
</description>
<owner>
<name>Org</name>
<organization>Org</organization>
<email>noreply#example.com</email>
</owner>
<components>
<component type="Module" version="01.00.00">
<desktopModule>
<moduleName>My Items</moduleName>
<foldername>Org</foldername>
<moduleDefinitions>
<moduleDefinition>
<friendlyName>My Items</friendlyName>
<moduleControls>
<moduleControl>
<controlSrc>DesktopModules/Org/ItemManagement/MyItems.ascx</controlSrc>
<controlTitle>My Items</controlTitle>
<controlKey>MyItems</controlKey>
<controlType>View</controlType>
</moduleControl>
</moduleControls>
</moduleDefinition>
</moduleDefinitions>
</desktopModule>
</component>
</components>
</package>
<package name="Org_My_Details" type="Module" version="01.00.00">
<friendlyName>My Details</friendlyName>
<description>
My Details summary display
</description>
<owner>
<name>Org</name>
<organization>Org</organization>
<email>noreply#example.com</email>
</owner>
<components>
<component type="Module" version="01.00.00">
<desktopModule>
<moduleName>My Details</moduleName>
<foldername>Org</foldername>
<moduleDefinitions>
<moduleDefinition>
<friendlyName>My Details</friendlyName>
<moduleControls>
<moduleControl>
<controlSrc>DesktopModules/Org/ItemManagement/MyDetails.ascx</controlSrc>
<controlTitle>My Details</controlTitle>
<controlKey>MyDetails</controlKey>
<controlType>View</controlType>
</moduleControl>
</moduleControls>
</moduleDefinition>
</moduleDefinitions>
</desktopModule>
</component>
</components>
</package>
</packages>
</dotnetnuke>

I have a similar package setup with my open-source DNN Social module. Compare what I have as it is working to install two desktop modules, each with their own module definition, and living in the same folder.
One thing I noticed is that you have specified a controlkey for your module controls. It is my understanding that DNN looks for one control within each moduledefinition with an empty control key <controlKey /> which denotes the default view of the module. Maybe that is an issue?

Related

Configuring Specflow+ Runner for parallel test execution across different Browsers

I am using Specflow+ Runner for my automation testing using Selenium/Appium grid at the backend and want to test my scripts in parallel across multiple Browsers
I have referred to the examples from Specflow examples repository (https://github.com/SpecFlowOSS/SpecFlow.Plus.Examples/tree/master/SeleniumGridWebTest) and using the following Default.srprofile
<?xml version="1.0" encoding="utf-8"?>
<TestProfile xmlns="http://www.specflow.org/schemas/plus/TestProfile/1.5">
<Settings projectName="SpecflowTrial" />
<Execution stopAfterFailures="0" testThreadCount="5" testSchedulingMode="Sequential" retryCount="0" apartmentState="MTA" />
<Environment testThreadIsolation="Process" />
<TestAssemblyPaths>
<TestAssemblyPath>SpecflowTrial.dll</TestAssemblyPath>
</TestAssemblyPaths>
<Report>
<Template name="Report\ReportTemplate.cshtml" />
</Report>
<Targets>
<Target name="Browser_Safari">
<Filter>Browser_Safari</Filter>
<DeploymentTransformationSteps>
<EnvironmentVariable variable="Test_Browser" value="Safari" />
</DeploymentTransformationSteps>
<Environment testThreadIsolation="Process" />
</Target>
<Target name="Browser_Chrome">
<Filter>Browser_Chrome</Filter>
<DeploymentTransformationSteps>
<EnvironmentVariable variable="Test_Browser" value="Chrome" />
</DeploymentTransformationSteps>
<Environment testThreadIsolation="Process" />
</Target>
<Target name="Browser_Firefox">
<Filter>Browser_Firefox</Filter>
<DeploymentTransformationSteps>
<EnvironmentVariable variable="Test_Browser" value="Firefox" />
</DeploymentTransformationSteps>
<Environment testThreadIsolation="Process" />
</Target>
</Targets>
<TestThreads>
<TestThread id="0">
<TestAffinity>testpath:Target:Browser_Safari</TestAffinity>
</TestThread>
<TestThread id="1">
<TestAffinity>testpath:Target:Browser_Chrome</TestAffinity>
</TestThread>
<TestThread id="2">
<TestAffinity>testpath:Target:Browser_Firefox</TestAffinity>
</TestThread>
</TestThreads>
</TestProfile>
where the filters are applied to tags on the scenarios
My problem is that when running all tests in parallel, sometimes the tests are triggered across different browsers and sometimes it is triggered for the same Browsers, in this case, all run on either Chrome, Firefox or Safari.
What is the correct configuration that should be used to trigger tests in parallel across different browsers?
Update:
The above question was resolved bumping the SpecRun to version 3.6.2

Is it possible to create an integration cartridge for BM in the Saleforce for "Marchant Tools" using controllers, not pipelines?

I must create new cartridge for integration in BM but I don't want use pipelines. Can I use the controllers for this? If yes, please provide information on how to do this.
.
Yes, you can. You need to create the bm_extensions.xml and add all the actions/entries.
Note: The file mention pipeline but It can actually be a Controller as you can see in the example I linked below.
<?xml version="1.0" encoding="ISO-8859-1" ?>
<extensions xmlns="http://www.demandware.com/xml/bmmodules/2007-12-11"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.demandware.com/xml/bmmodules/2007-12-11 bmext.xsd">
<menuaction id="paypal_transactions_manager" menupath="orders" position="200" site="true">
<name xml:lang="x-default">PayPal Transactions</name>
<short_description xml:lang="x-default">Manage the PayPal transactions related with this site orders.</short_description>
<description xml:lang="x-default">Manage the PayPal transactions related with this site orders.</description>
<exec pipeline="PaypalAdmin" node="Orders" />
<sub-pipelines>
<pipeline name="PaypalAdmin-Orders" />
<pipeline name="PaypalAdmin-OrderTransaction" />
<pipeline name="PaypalAdmin-Action" />
<pipeline name="PaypalAdmin-CreateNewTransaction" />
</sub-pipelines>
<icon>paypalbm/images/icon_transactions.png</icon>
</menuaction>
</extensions>
PayPal Cartridge bm_paypal is a good example to understand how is done: https://github.com/SalesforceCommerceCloud/link_paypal/tree/master/cartridges/bm_paypal/cartridge
Ps: Let me know if you cannot access the link.

How to Properly Reference Assemblies in DNN Manifest?

I'm writing a DNN 9 custom module using ASP.NET MVC. My development site is setup at dnndev.me and the module is located in C:\websites\dnndev.me\DesktopModules\MVC|MyModule
My DNN manifest is as follows:
<dotnetnuke type="Package" version="5.0">
<packages>
<package name="Onboarding" type="Module" version="00.00.05">
<friendlyName>Onboarding</friendlyName>
<description>Onboarding</description>
<iconFile>~/Icons/Sigma/Software_32X32_Standard.png</iconFile>
<owner>
<name>example.com</name>
<organization>example.com</organization>
<url>https://example.com/</url>
<email>info#example.com</email>
</owner>
<license src="License.txt"></license>
<releaseNotes src="ReleaseNotes.txt"></releaseNotes>
<dependencies>
<dependency type="CoreVersion">08.00.00</dependency>
</dependencies>
<components>
<component type="Script">
<scripts>
<basePath>DesktopModules\MVC\MyModule</basePath>
<script type="Install">
<path>Providers\DataProviders\SqlDataProvider</path>
<name>00.00.01.SqlDataProvider</name>
<version>00.00.01</version>
</script>
<script type="UnInstall">
<path>Providers\DataProviders\SqlDataProvider</path>
<name>Uninstall.SqlDataProvider</name>
<version>00.00.01</version>
</script>
</scripts>
</component>
<component type="ResourceFile">
<resourceFiles>
<basePath>DesktopModules/MVC/MyModule</basePath>
<resourceFile>
<name>Resources.zip</name>
</resourceFile>
</resourceFiles>
</component>
<component type="Module">
<desktopModule>
<moduleName>Onboarding</moduleName>
<foldername>Onboarding</foldername>
<businessControllerClass>MySite.Modules.Onboarding.Components.FeatureController</businessControllerClass>
<supportedFeatures />
<moduleDefinitions>
<moduleDefinition>
<friendlyName>Onboarding</friendlyName>
<defaultCacheTime>0</defaultCacheTime>
<moduleControls>
<moduleControl>
<controlKey />
<controlSrc>Example.Modules.Onboarding.Controllers/Onboarding/Index.mvc</controlSrc>
<supportsPartialRendering>False</supportsPartialRendering>
<controlTitle />
<controlType>View</controlType>
<iconFile />
<helpUrl />
<viewOrder>0</viewOrder>
</moduleControl>
<moduleControl>
<controlKey>Edit</controlKey>
<controlSrc>Example.Modules.Onboarding.Controllers/Onboarding/Edit.mvc</controlSrc>
<supportsPartialRendering>False</supportsPartialRendering>
<controlTitle>Edit Onboarding Records</controlTitle>
<controlType>Edit</controlType>
<iconFile />
<helpUrl />
<viewOrder>0</viewOrder>
<supportsPopUps>True</supportsPopUps>
</moduleControl>
<moduleControl>
<controlKey>Settings</controlKey>
<controlSrc>Example.Modules.Onboarding.Controllers/Settings/Settings.mvc</controlSrc>
<supportsPartialRendering>False</supportsPartialRendering>
<controlTitle>Onboarding Settings</controlTitle>
<controlType>Edit</controlType>
<iconFile />
<helpUrl />
<viewOrder>0</viewOrder>
</moduleControl>
</moduleControls>
</moduleDefinition>
</moduleDefinitions>
</desktopModule>
</component>
<component type="Assembly">
<assemblies>
<assembly>
<name>Onboarding.dll</name>
<path>bin</path>
</assembly>
<assembly>
<name>RestSharp.dll</name>
<path>bin</path>
</assembly>
<assembly>
<name>EntityFramework.dll</name>
<path>bin</path>
</assembly>
<assembly>
<name>EntityFramework.SqlServer.dll</name>
<path>bin</path>
</assembly>
<assembly>
<name>Newtonsoft.Json.dll</name>
<path>bin</path>
</assembly>
</assemblies>
</component>
</components>
</package>
The module won't install despite ensuring that all assemblies are in the bin folder under dnndev.me.
What must I do to rectify this issue?
If you built your MVC module using the Chris Hammond template, you will have the msbuild process for packaging the module that is driven by the file: BuildScripts/ModulePackage.targets
In that file, there is a line of code:
<Copy SourceFiles="$(MSBuildDnnBinPath)\$(AssemblyName).dll" DestinationFolder="$(MSBuildProjectDirectory)\Package\bin"/>
That is responsible for picking up the module's assembly in your local install's bin folder and copying it to the package folder that gets zipped. There is no automated step for including other custom dlls in there. This line occurs twice: once for the 'source' package and the other for the 'install' package.
Most of the time, I will just update this script to include my dependencies. Example:
<Copy SourceFiles="$(MSBuildDnnBinPath)\$(AssemblyName).dll" DestinationFolder="$(MSBuildProjectDirectory)\Package\bin"/>
<Copy SourceFiles="$(MSBuildDnnBinPath)\Onboarding.dll" DestinationFolder="$(MSBuildProjectDirectory)\Package\bin"/>
This isn't the most elegant solution as you need to hardcode your dependencies in the build script. But it works for simple modules. If you know a little about msbuild, you could use a copy step that includes all dlls in a folder and move your dependencies to a single folder and include all of them from the folder.
The way you do it means that the assemblies are included in your install package. To test if the assembies are installed (in the bin folder), you need to add a dependency, but there is no dependency to an assembly containing a version number or something alike. The trick is to add a dependency to a type defined in the assembly, e.g.
<dependency type="Type">DocumentFormat.OpenXml.Extensions.WorksheetWriter</dependency>
AFAIR it is important that the value of the type attribute is case-sensitive, so it has to be "Type", and not "type" or "TYPE".

Drop database from WiX installer

The properties [DATABASE_NAME] and [SERVER_NAME] are defined by the user at installation and it seems like unless they are hard coded then doing this fails:
<Component Id="Component.Sql.Database" Guid="*">
<sql:SqlDatabase
Id="Sql.Database"
Database="[DATABASE_NAME]"
Server="[SERVER_NAME]"
CreateOnInstall="yes"
DropOnUninstall="yes"
ContinueOnError="no"
ConfirmOverwrite="yes" />
</Component>
The bit that is supposed to drop the db is DropOnUninstall="yes"
I've found a post on the WiX user group suggesting the following approach to dropping the database on uninstall:
<Component Id="Component.Sql.DropDatabase" Guid="146CD264-1F6D-4E19-BFCC-E544F5BD2D6C">
<sql:SqlString
Id="Sql.DropDatabase"
SqlDb="Sql.Master"
Sequence="1000"
ExecuteOnInstall="no"
ExecuteOnUninstall="yes"
ExecuteOnReinstall="no"
ContinueOnError="no"
SQL="DROP DATABASE [\[][DATABASE_NAME]\[]]"/>
</Component>
<Fragment>
<sql:SqlDatabase Id="Sql.Master" Database="master" Server="[SERVER_NAME]" />
</Fragment>
The idea being that at uninstall the DROP DATABASE ... command is executed on the master database on the server. However this SQL statement never gets executed on the server.
The MSIEXEC log doesn't seem to give any information and I get no errors.
Has anyone successfully achieved this (before I write a custom action to do this)?
I've tried copying the database name and server to the registry to cache them, but this hasn't helped.
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension" <!-- Need to import this -->
xmlns:sql="http://schemas.microsoft.com/wix/SqlExtension"><!-- Need to import this -->
<sql:SqlDatabase Id="SqlDatabase"
Database="TestDatabase"
Server="[SQLSERVER]"
DropOnUninstall="yes"
User="SQLUser">
This will definitely work.....

iBatis - Why is sqlMapConfig.xml unable to find the sql maps defined in it?

I have a sqlMapConfig.xml that has three SQLMaps defined in it.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMapConfig
PUBLIC "-//ibatis.apache.org//DTD SQL Map Config 2.0//EN"
"http://ibatis.apache.org/dtd/sql-map-config-2.dtd">
<sqlMapConfig>
<!-- Statement namespaces are required for Ibator -->
<settings enhancementEnabled="true" useStatementNamespaces="true"/>
<!-- Setup the transaction manager and data source that are
appropriate for your environment
-->
<transactionManager type="JDBC">
<dataSource type="SIMPLE" >
<property name="JDBC.Driver"
value="com.mysql.jdbc.Driver"/>
<property name="JDBC.ConnectionURL"
value="jdbc:mysql://localhost:3306/sug"/>
<property name="JDBC.Username"
value="root"/>
<property name="JDBC.Password"
value="admin"/>
</dataSource>
</transactionManager>
<!-- SQL Map XML files should be listed here -->
<sqlMap resource="com/tatakelabs/dbmaps/categories_SqlMap.xml" />
<sqlMap resource="com/tatakelabs/dbmaps/pro_SqlMap.xml" />
<sqlMap resource="com/tatakelabs/dbmaps/pro_category_SqlMap.xml" />
</sqlMapConfig>
I get a runtime error - Cause: java.io.IOException: Could not find resource com/tatakelabs/dbmaps/categories_SqlMap.xml
categories_SqlMap.xml is present in that location. I tried changing the location of the map xml, but that did not help. sqlMapConfig.xml validates against the DTD. categories_SqlMap.xml also validates against the right DTD. I am at my wits end trying to figure out why it can't find the resource. The sqlMap files are generated by iBator.
This was happening because the sqlmap file location was not getting copied to target. Added a copy goal and that fixed it.
I had the same problem. It appears the problem lies with the location of the config file. Thus, its in relation of the project resource structure.
I moved the config file in the same package as the mapper classes and it worked. In this case try moving all the resources to this package and update the resource attributes to:
<sqlMap resource="categories_SqlMap.xml" />
<sqlMap resource="pro_SqlMap.xml" />
<sqlMap resource="pro_category_SqlMap.xml" />
Solved it.
I moved the xml file to where the Pojo was located and provided the path as follows:
<sqlMap resource="com/heena/ibatis/model/jsr/jsr.xml" />
And it worked.
place it ...src\java\abc.xml under the Source Packages directory.
If you are using Spring, you can use a SqlMapClientFactoryBean specifying property "mappingLocations". In this property you can specify a generic path, such as "com/tatakelabs/dbmaps/*_SqlMap.xml" or with a variable such as ${mapfiles}, that will be resolved by Spring as an array of file names. This lets you omit sqlMap element in sqlMapConfig. This technique will run with iBatis 2.3.4 on. However sql-map-config-2.dtd is also contained inside iBatis.jar, so you can experience some parsing errors, as /com/ibatis/sqlmap/engine/builder/xml/sql-map-config-2.dtd may have a bug. In this case you may want to replace it inside the jar with the one from the URL:
http://ibatis.apache.org/dtd/sql-map-config-2.dtd.

Resources