November Happy Hour will be moved to Thursday December 5th.

EpiServer 7.1 Problems to crete Dojo component

Vote:
 

Hi,I am trying to create a simple editor for Episerver 7.1. I have tried to follow the few blogs about doing so out there, but I have problemsw to get the component loading. EpiServer tries to load my js from Episerver/shell/2.1.90Clientresources/dtk... and not my relative path.my module.config looks like this:<?xml version="1.0" encoding="utf-8"?>
<module loadLocalBin="true">
<assemblies>
<add assembly="xyz.Intranet" />
</assemblies>
<dojo>
<paths>
<add name="xyz" path="Scripts"/>
</paths>
</dojo>
<clientResources>
<add name="epi-cms.widgets.base" path="Scripts/ModuleInitializer.js" resourceType="Script" />
<add name="epi-cms.widgets.base" path="Scripts/RequireModule.js" resourceType="Script" />
</clientResources>
</module>I have created a simple EditorDescriptor:[EditorDescriptorRegistration(TargetType = typeof(string), UIHint = "ContactPersons")]

public class ContactPersonsEditorDescriptor: EditorDescriptor
{
public ContactPersonsEditorDescriptor()
{
ClientEditingClass = "xyz.ContactPersonsSelection";
}
}

    
}One moduleInitializer file:define([
// Dojo
"dojo",
"dojo/_base/declare",
//CMS
"epi/_Module",
"epi/dependency",
"epi/routes"
], function (
// Dojo
dojo,
declare,
//CMS
_Module,
dependency,
routes
) {
return declare("xyz.ModuleInitializer", [_Module], {
// summary: Module initializer for the default module.
initialize: function () {
this.inherited(arguments);
var registry = this.resolveDependency("epi.storeregistry");
//Register the store
registry.create("xyz.customquery", this._getRestPath("ContactPersons"));
}, _getRestPath: function (name) { return routes.getRestPath({ moduleArea: "app", storeName: name }); }
});
});And one requiremodule file:define([
"dojo",
//CMS
"epi/dependency"], function (
dojo,
//CMS
dependency) {
return {
load: function (
/*String*/id,
/*function*/require,
/*function*/load) {
var moduleManager = dependency.resolve("epi.ModuleManager");
dojo.when(moduleManager.startModules(id), function () { return load(moduleManager.getModule(id)); })
}
}
});And last the actual widget file (I only paste the init parts in it) contactparsonsSelection:define([
"dojo/_base/connect",
"dojo/_base/declare",
"dijit/_CssStateMixin",
"dijit/_Widget",
"dijit/_TemplatedMixin",
"dijit/_WidgetsInTemplateMixin",
"dijit/form/FilteringSelect",
"epi/dependency", "epi/epi",
"epi/shell/widget/_ValueRequiredMixin",
//We are calling the require module class to ensure that the App module has been set up
"xyz/requiremodule!App"], function (
connect,
declare,
_CssStateMixin,
_Widget,
_TemplatedMixin,
_WidgetsInTemplateMixin,
FilteringSelect,
dependency,
epi,
_ValueRequiredMixin,
appModule) {
return declare("xyz.ContactPersonsSelection", [_Widget, _TemplatedMixin, _WidgetsInTemplateMixin, _CssStateMixin, _ValueRequiredMixin],
{..... All files are located in /clientresources/scripts, except the module.config which is placed on the site root. When I try to run the site and load the widget, I get this error:
GET http://dev.xyz.com/EPiServer/Shell/2.1.90/ClientResources/dtk/xyz/ContactPersonsSelection.js 404 (Not Found) dojo.js:15

Error {src: "dojoLoader", info: Array[2]}
dojo.js:15
Error: scriptError at _f (http://dev.xyz.com/EPiServer/Shell/2.1.90/ClientResources/dtk/dojo/dojo.js:15:436) at HTMLScriptElement.<anonymous> (http://dev.xyz.com/EPiServer/Shell/2.1.90/ClientResources/dtk/dojo/dojo.js:15:17711) I feel like I have tried hundred different things and configs, but always I get this error. When i evaluate dojo.config, I can see that my relative path is loaded into the paths-array.
dojo.config

Object {async: true, packages: Array[0], baseUrl: "/EPiServer/Shell/2.1.90/ClientResources/dtk/dojo/", aliases: Array[3], deferredInstrumentation: false…}
afterOnLoad: truealiases: Array[3]async: truebaseUrl: "/EPiServer/Shell/2.1.90/ClientResources/dtk/dojo/"cache: Objectconfig: undefineddeferredInstrumentation: falseioPublish: trueisDebug: falselocale: "en-us"packages: Array[0]parseOnLoad: falsepaths: Objectdgrid: "/EPiServer/Shell/2.1.90/ClientResources/lib/dgrid"epi: "/EPiServer/Shell/2.1.90/ClientResources/EPi"epi-cms: "/EPiServer/CMS/2.1.82/ClientResources/EPi/Cms"epi-packaging: "/EPiServer/EPiServer.Packaging.UI/2.1.90/ClientResources"epi/cms: "/EPiServer/CMS/2.1.82/ClientResources/EPi/Cms"xyz: "/ClientResources/Scripts"put-selector: "/EPiServer/Shell/2.1.90/ClientResources/lib/put-selector"tinymce: "/EPiServer/CMS/2.1.82/ClientResources/Editor/tiny_mce"xstyle: "/EPiServer/Shell/2.1.90/ClientResources/lib/xstyle"__proto__: ObjectuseDeferredInstrumentation: ""__proto__: Object
If someone can point me in the right direction about this, I would be really thankful. I'm starting to go a bit crazy... :)

#76840
Nov 04, 2013 15:32
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.