+1-888-365-2779
Try Now
More in this section

Forums / Sitefinity SDK / New Products Sample - Not Complete?

New Products Sample - Not Complete?

44 posts, 0 answered
  1. Phill Hodgkinson
    Phill Hodgkinson avatar
    362 posts
    Registered:
    10 Nov 2004
    14 Jan 2011
    Link to this post
    Hi There,

    I just started to look at the code for the new Products module and noticed that there are references to "News" all over the place. Obviously this sample was based on the built in News module but it would appear that what was included is far from being converted over. The references to "news" in comments in the code isn't a big deal but there are many other places where it's pointing to News ascx templates (that aren't provided i.e. internal const string titlesOnlyLayoutTemplateName = "Telerik.Sitefinity.Resources.Templates.Frontend.News.TitlesOnlyListView.ascx"; in the file MasterListView.cs) and things like:
    static ProductItem()
    {
        // set default values
        permissionsetObjectTitleResKeys = new Dictionary<string, string>()
        {
            { ProductsConstants.Security.PermissionSetName, "NewsActionPermissionsListTitle" }
        };
    }
    Which I would think could even possibly cause conflicts using the name name for keys in both modules? 

    As I said I'm just starting to look into this but I'm not going to waste any more of my time if this is actually not completed or the wrong code was included in the release. Can someone from Telerik clarify so we know if this is as good as it gets or if there's a cleaner version on the way.

    Thanks,
    Phill
  2. Dido
    Dido avatar
    149 posts
    Registered:
    24 Sep 2012
    19 Jan 2011
    Link to this post
    Hello Phill Hodgkinson,

    The products module is complete, but, as you can see, there are things that are not cleared yet.

    ISecuredObject.PermissionsetObjectTitleResKeys is not yet documented. It is used like this:

    Since the "General" permission set is widely used for different items, one might want to differentiate them in the UI. For example, in the "permissions" dialog, one might want to see "View this blog" instead of just "View".

    The "syntax" of permissionsetObjecTitleKeys is something like

    {
        { "Supported permission set name": "Key in SecurityResources" }
    }

    The key is looked up in SecurityResources and replaced like "View/edit/modify/create this {0}".

    Since the products module defines its own resources for security actions (see ProductsModule.InstallCustomPermissions and look up "ViewProducts" in ProductsResource), you can leave permissionsetObjecTitleKeys as either empty or null.

    Kind regards,
    Dido
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. Kiril
    Kiril avatar
    19 posts
    Registered:
    09 Dec 2008
    19 Jan 2011
    Link to this post
    Hi,

    We have already implemented several modules based on the Products module. Most of the things work fine, except the Taxonomies. They are just not working.
    If you add a Category or Tag to a product item, but it is not saved or loaded.
    Also the filters by taxonomy is not working.

    //Kiril
  4. Duneel
    Duneel avatar
    166 posts
    Registered:
    08 Dec 2010
    19 Jan 2011
    Link to this post
    Hi,

    I tried to run the sitefinity website in sdk example solution and I'm getting an exception from ProductManager.GetManager(string providerName) function. I debuged and found that providerName parameter is an empty string, not sure if this is the problem. Can some one help me to get this working. I want to develop a custom module and first want to see how the products module is implemented and working.

    one other thing is...i changed the app.config of the products module to point to the correct database instance in my working environment.

    Exception type: TargetInvocationException.
    Inner Message: Field 'UrlName_' of class 'Telerik.Sitefinity.GenericContent.Model.Content' is described as compiled and artificial at the same time. --> Telerik.Sitefinity.Model, Version=4.0.1098.0, Culture=neutral, PublicKeyToken=b28c218413bdf563/namespace[Telerik.Sitefinity.GenericContent.Model]/class[Telerik.Sitefinity.GenericContent.Model.Content]/field[UrlName_]

    Also this exception....

    Persistence-capable-superclass 'Telerik.Sitefinity.GenericContent.Model.Content' not declared in meta data. --> ProductCatalogSample, Version=1.0.4036.18724, Culture=neutral, PublicKeyToken=null/namespace[ProductCatalogSample.Model]/class[ProductCatalogSample.Model.ProductItem]

    Thanks!
  5. Kiril
    Kiril avatar
    19 posts
    Registered:
    09 Dec 2008
    20 Jan 2011
    Link to this post
    I have managed to fix one of the issues
    - Tags and Categories are now saved
    Here is how:
    The module installer doesn't call InstallTaxonomies method on a installation where the previousSystemVersion is different from 0 (Thank you Reflector!)
    This becomes the end of the 
    public override void Install(SiteInitializer initializer)

    this.InstallCustomWorkflow(initializer);
    this.InstallCustomPermissions();
    this.InstallTaxonomies(initializer);

    But even when the InstallTaxonomies is called the Taxonomies are not saved for some reason.
    so InstallTaxonomies becomes 
    protected override void InstallTaxonomies(SiteInitializer initializer)
    {
        base.InstallTaxonomy(initializer, typeof(CaseStudy));
        initializer.Context.MetadataManager.SaveChanges(false);
    }

    This creates the metadata fields for Categories and Tags to the Model

    This still doesn't resolve the problem with Filtering the the Custom item by Category or Tag

    //Kiril
  6. bemara57
    bemara57 avatar
    135 posts
    Registered:
    27 Mar 2008
    24 Jan 2011
    Link to this post
    I am getting the same error as Duneel when I try to reuse the Product Module (inheriting it). I think I hosed the database. Any idea what this could be from?

    Server Error in '/' Application.

    Field 'UrlName_' of class 'Telerik.Sitefinity.GenericContent.Model.Content' is described as compiled and artificial at the same time. --> Telerik.Sitefinity.Model, Version=4.0.1098.0, Culture=neutral, PublicKeyToken=b28c218413bdf563/namespace[Telerik.Sitefinity.GenericContent.Model]/class[Telerik.Sitefinity.GenericContent.Model.Content]/field[UrlName_]

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: Telerik.OpenAccess.Exceptions.MetadataException: Field 'UrlName_' of class 'Telerik.Sitefinity.GenericContent.Model.Content' is described as compiled and artificial at the same time. --> Telerik.Sitefinity.Model, Version=4.0.1098.0, Culture=neutral, PublicKeyToken=b28c218413bdf563/namespace[Telerik.Sitefinity.GenericContent.Model]/class[Telerik.Sitefinity.GenericContent.Model.Content]/field[UrlName_]

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

    Stack Trace:

    [MetadataException: Field 'UrlName_' of class 'Telerik.Sitefinity.GenericContent.Model.Content' is described as compiled and artificial at the same time. --> Telerik.Sitefinity.Model, Version=4.0.1098.0, Culture=neutral, PublicKeyToken=b28c218413bdf563/namespace[Telerik.Sitefinity.GenericContent.Model]/class[Telerik.Sitefinity.GenericContent.Model.Content]/field[UrlName_]]
       DynamicModule.ns.Wrapped_OpenAccessMembershipProvider_4b00f6fbda094382b600901add4ec12e.Initialize(String providerName, NameValueCollection config, Type managerType) +284
       Telerik.Sitefinity.Data.ManagerBase`1.InstantiateProvider(IDataProviderSettings providerSettings, Type providerType, ExceptionPolicyName policy, ManagerBase`1 manager) +2706
       Telerik.Sitefinity.Data.ManagerBase`1.InstantiateProvider(IDataProviderSettings providerSettings, ExceptionPolicyName policy, ManagerBase`1 manager) +117
       Telerik.Sitefinity.Data.ManagerBase`1.SetProvider(String providerName, String transactionName) +407
       Telerik.Sitefinity.Data.ManagerBase`1..ctor(String providerName, String transactionName) +249
       Telerik.Sitefinity.Security.UserManager..ctor(String providerName, String transactionName) +39
    
    [TargetInvocationException: Exception has been thrown by the target of an invocation.]
       System.RuntimeMethodHandle._InvokeConstructor(IRuntimeMethodInfo method, Object[] args, SignatureStruct& signature, RuntimeType declaringType) +0
       System.RuntimeMethodHandle.InvokeConstructor(IRuntimeMethodInfo method, Object[] args, SignatureStruct signature, RuntimeType declaringType) +15
       System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +281
       System.Reflection.ConstructorInfo.Invoke(Object[] parameters) +17
       Telerik.Sitefinity.Data.ManagerBase`1.GetManager(String providerName, String transactionName) +1323
       Telerik.Sitefinity.Security.UserManager.GetManager(String providerName, String transactionName) +41
       Telerik.Sitefinity.Security.SecurityManager.LogoutImpl(String providerName, Guid userId, String userName, Credentials credentials) +73
       Telerik.Sitefinity.Security.SecurityManager.Logout(String providerName, Guid userId) +178
       Telerik.Sitefinity.Security.SecurityManager.Logout() +257
       Telerik.Sitefinity.Security.Web.UI.LogoutForm.DoLogout(String navigateUrl) +33
       Telerik.Sitefinity.Security.Web.UI.LogoutForm.SwitchUserButton_Command(Object sender, CommandEventArgs e) +32
       System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e) +115
       System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument) +169
       System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +9
       System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
       System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +176
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5563
    


    Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1
  7. Dido
    Dido avatar
    149 posts
    Registered:
    24 Sep 2012
    25 Jan 2011
    Link to this post
    Hi,

    @Duneel Muthubandara

    I think I described in the module documentation that Sitefinity does not use that app.config. You should NOT specify the connection string there. Sitefinity uses only the connection strings defined in /DataConfig/ConnectionStrings.

    @Basem Emara

    Again, in the module documentation I tried to explain how a module should be configured.The app.config of your persistent should start like this

    <?xml version="1.0"?>
    <configuration>
      <configSections>
        <section name="openaccess" type="Telerik.OpenAccess.Config.ConfigSectionHandler, Telerik.OpenAccess.Config, Version=1.0.0.0, Culture=neutral, PublicKeyToken=7ce17eeaf1d59342" requirePermission="false" />
      </configSections>
      <openaccess xmlns="http://www.telerik.com/OpenAccess">
        <references>
          <!-- Do not add any references here, as they are added dynamically by Sitefinity
          and it will be duplicated-->    
        </references>

    Notice the comment. It is extremely important NOT to include any references there. Sitefinity merges information about meta types, it's own app.config for Telerik.Sitefinity.Model.dll and all your persistent module's app.configs. Every type knows which assembly it comes from (MetaType.AssemblyName). If you hard-code any reference there, you will get the error you've just received.I believe it is the same for Duneel Muthubandara. Please, TURN OFF open access visual studio integration. In the documentation it is explained how to configure the project to build with the proper version of OpenAccess, and which features to turn off, and how to enhance the assembly.

    @Kiril Jovchev

    Site modules are initialized on the first request to sitefinity. The Bootstrapper is called, then SiteInitializer gose over the registerd modules and initializes. All modules share the same global named transaction, and therefore, if anything fails, the module won't be installed.
    Please, reastrain from committing anything in the module initialization. Doing so might render your system unusable (especially if something goes wrong with meta types). The condition to save the meta types (e.g. Tags and Categories meta fields) is that everything went smoothly. Remove the SaveChanges, as SiteInitializer, and more preciesly, its InstallContext, takes care of this.
    Failures are wrapped in try-catch so that the system is protected from going unusable if one of the modules fails installing. Therefore, you should debug the module and look for the exception that is thrown (this is the only case when install context doesn't save).

    Best wishes,
    Dido
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  8. Kiril
    Kiril avatar
    19 posts
    Registered:
    09 Dec 2008
    25 Jan 2011
    Link to this post
    Hi Dido

    I had filed 2 tickets for the Products module, and your support guys have been really helpfull and they spoted 2 bugs:
    The install bug is next one in ProductsModule.cs:
            pageInfo.Parameters["ModuleName"] = ProductsModule.ModuleName;
            var comments = new BackendContentView() { ControlDefinitionName = ProductsDefinitions.BackendCommentsDefinitionName };
            initializer.CreatePageFromConfiguration(pageInfo, moduleNode, comments);
        }
    }
    The highlighted moduleNode should be productsNode 

    And the next bug was with that Taxonomy filters were not working
    So the bug is in Data\ProductsDataProvider.cs
    public override IEnumerable GetItemsByTaxon(Guid taxonId, bool isSingleTaxon, string propertyName, Type itemType, string filterExpression, string orderExpression, int skip, int take, ref int? totalCount)
    {
        if (itemType == typeof(ProductItemUrlData))
        {
            this.CurrentTaxonomyProperty = propertyName;
    The highlighted ProductItemUrlData should be ProductItem.

    May be you guys from Telerik should consider to put the version of the module with fixes for download, or may a sicky for a while?

    Kiril Jovchev
    Software Architect
    UOMA OY | Merimiehenkatu 36 D | FI-00150 Helsinki | www.uoma.fi



  9. bemara57
    bemara57 avatar
    135 posts
    Registered:
    27 Mar 2008
    26 Jan 2011
    Link to this post
    Thanks Dido for all your help (and Kiril :). The Products Module is all there and complete. It is just a matter of setting it all up correctly. For example, I just figured out that the App.config file has to be set as an embedded resource (http://goo.gl/AREMY).

    Kinda bumpin heads without the documents for this one though. In the latest Jan 14th SDK, the "getting start" screen says "soon" for the "Create a module with OA" documentation. That should shed light on many things.
  10. bemara57
    bemara57 avatar
    135 posts
    Registered:
    27 Mar 2008
    26 Jan 2011
    Link to this post
    Ah-hah!! The documents is in a Word doc in the Products Module project folder (it's obviously excluded from the solution view). Nice!!!
  11. Daniel Plomp
    Daniel Plomp avatar
    952 posts
    Registered:
    18 Feb 2004
    15 Feb 2011
    Link to this post
    Hey guys,

    Since you seem to be much into this products module: how can I add some more custom fields to it?
    What would be the steps to do this?

    Thanks,
    Daniel
  12. Phill Hodgkinson
    Phill Hodgkinson avatar
    362 posts
    Registered:
    10 Nov 2004
    15 Feb 2011
    Link to this post
    Hey Daniel,

    The way I went about figuring that out was to do a search for all instances of "whatsinthebox", one of the custom fields that Telerik added for the sample. I then duplicated and renamed all instances, that's a bit simplified but you know what I mean. One thing I've encountered is that if I add one field, install the module to see if it works and then try to add another it won't install the second time and there's no uninstall method. So be sure to do this on a test DB and backup the test db before the install and do a restore before each time you try to add any new data fields.

    Hope that helps, if not later this evening (EST) I can dig through and tell you what files were modified specifically.

    Cheers,
    Phill
  13. Daniel Plomp
    Daniel Plomp avatar
    952 posts
    Registered:
    18 Feb 2004
    15 Feb 2011
    Link to this post
    Hi Phill,

    Thanks for the explanation.
    Well, that seems quite a lot of work for some fields :(

    For now, I'm still struggling with the bugs mentioned in this post: saving taxonomies and filtering on them. 
    Can't get them to work. 

    Maybe I'm the only one having such problems with these custom modules, but it took quite a while before I had installed this ProductsModule. And now I have the same problem with the Migration module. It just doesn't shows up in the menu. Frustrating!

    Anyway, I'll try your suggestions.

    Thanks!
    Daniel
  14. Phill Hodgkinson
    Phill Hodgkinson avatar
    362 posts
    Registered:
    10 Nov 2004
    15 Feb 2011
    Link to this post
    Hi Daniel,

    If you want I can zip up my Products Module code and send to you. I've added some simple custom fields (ItemNumber, ModelNumber, etc) in addition to what Telerik had added. I've also added the fixes that Kiril has supplied as well. You can email me at phillh {at} pbnj [dot] ca  and I'll send you a zip, might help you get a jump start.

    Regards,
    Phill
  15. Duneel
    Duneel avatar
    166 posts
    Registered:
    08 Dec 2010
    15 Feb 2011
    Link to this post
    Hi,

    I was able to get the Products module working in the sample solution came with the SDK. Now I wanted to create my own module and install within the same sample sitefinity website. I modified the SystemConfig.config to have an entry for the new module exactly the same way as for the Products module. I launched the website and foundout that nothing has been created for the new module (not even the back-end database tables sfex_ and sfx_). Can someone help me on how I should trigger module installation which creates everythings and show the module name under Content menu in sitefinity administration?

    Thanks!
    Duneel
  16. Phill Hodgkinson
    Phill Hodgkinson avatar
    362 posts
    Registered:
    10 Nov 2004
    15 Feb 2011
    Link to this post
    Hi Duneel,

    I don't have a complete answer to your problem but I know that if you have an error in your code that when it tries to install the module it will fail and nothing will be done. This is actually a nice feature, especially since modules can't be un-intstalled, as it prevents broken modules from being installed. The thing I'm not much help on is I don't know if the errors are logged anywhere or what the best way to trouble shoot is. I think if you put a breakpoint in at your module installation method you might be able to step through and find out what's going on.

    Hope that helps a bit.

    Cheers,
    Phill
  17. Duneel
    Duneel avatar
    166 posts
    Registered:
    08 Dec 2010
    16 Feb 2011
    Link to this post
    Hi Phill,

    I debuged the code and the execution is not coming to the Install functions. However Module.Initialize function gets executed. Another question is do we need to copy the app.config file of the custom module over to the bin of website along with the dll? I saw it has some database connection settings and does that has to be pointing to the same database instance? Is there a way I can share the complete module project with you?

    I tried to install the Products sample module on a different site and it is not getting installed and create the back-end tables in the new db. it works only with the database came with the sdk (Sitefinity.mdf).

    Thanks!
    Duneel
  18. Kiril
    Kiril avatar
    19 posts
    Registered:
    09 Dec 2008
    16 Feb 2011
    Link to this post
    Hi Duneel

    Did you register the module in Settings->Advanced->System->ApplicationModules?

    //Kiril
  19. Duneel
    Duneel avatar
    166 posts
    Registered:
    08 Dec 2010
    16 Feb 2011
    Link to this post
    Hi Kiri,

    Yes I did register from the administration section and also tried by manully adding the entry to the SystemConfig.config file and no difference. The Initilize function of the module gets executed and that means the module is installed right. but not of the install functions get called. I'm also receiving a TargetInvocationException and I can strill continue and load the website. This exception is thrown from the sample products module too. I've uploaded the source code of my module to sendspace.com and it can be downloaded from the link below. You'll have to fix the references and venhance paths.

    http://www.sendspace.com/file/2cgzqz

    Thanks!
    Duneel
  20. Kiril
    Kiril avatar
    19 posts
    Registered:
    09 Dec 2008
    16 Feb 2011
    Link to this post
    Hi Duneel

    Try putting some try catch blocks in Initialize and you might catch the exception that is generated somewhere deep. Or look at SF4 log, You can setup one from web config

    <system.diagnostics>
       <trace autoflush="true">
         <listeners>
           <add name="Text"
                type="System.Diagnostics.TextWriterTraceListener"
                initializeData="messages.log" />
         </listeners>
       </trace>
     </system.diagnostics>

    //Kiril
  21. Duneel
    Duneel avatar
    166 posts
    Registered:
    08 Dec 2010
    16 Feb 2011
    Link to this post
    Hi Kiril,

    Below is the same exception i'm receiving from products module too. Do you know what could be the reason? Also I have the following few questions.

    1. Is the products sample module is fully completed?
    2. Can we install the products module on a fresh SF4 website runs on a fresh database (initialized by SF when the initial run)?
    3. Is registering the module through Administration->Advance->System->ApplicationModule is sufficient?

    Thanks,
    Duneel

    Timestamp: 2/16/2011 3:08:53 PM
      
    Message: HandlingInstanceID: 66f7f329-b63e-4c04-a8ae-096833c5556f
    An exception of type 'System.Reflection.TargetInvocationException' occurred and was caught.
    -------------------------------------------------------------------------------------------
    02/16/2011 10:08:53
    Type : System.Reflection.TargetInvocationException, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Message : Exception has been thrown by the target of an invocation.
    Source : Telerik.Sitefinity
    Help link : 
    Data : System.Collections.ListDictionaryInternal
    TargetSite : Telerik.Sitefinity.Data.IManager GetManager(System.Type, System.String)
    Stack Trace :    at Telerik.Sitefinity.Data.ManagerBase.GetManager(Type managerType, String providerName)
       at Telerik.Sitefinity.Data.ManagerBase.GetManager(Type managerType)
       at Telerik.Sitefinity.Modules.PersistentTypesReporsitory.GetModuleKnownTypes(IModule module)
       at Telerik.Sitefinity.Modules.PersistentTypesReporsitory.RegisterPersistentTypesForModule(IModule module, InstallContext context)
       at Telerik.Sitefinity.Services.SystemManager.InitializeModule(ModuleSettings settings, InstallContext installContext, Boolean start)
      
    Additional Info:
      
    MachineName : DUNEEL7
    TimeStamp : 2/16/2011 3:08:53 PM
    FullName : Telerik.Sitefinity.Utilities, Version=4.0.1160.0, Culture=neutral, PublicKeyToken=b28c218413bdf563
    AppDomainName : 9fffb664-1-129423425126094139
    ThreadIdentity : 
    WindowsIdentity : PAVLIKS\dmuthubandara
    Requested URL : /
        Inner Exception
        ---------------
        Type : Telerik.OpenAccess.Exceptions.MetadataException, Telerik.OpenAccess, Version=2010.3.1125.1, Culture=neutral, PublicKeyToken=7ce17eeaf1d59342
        Message : Persistence-capable-superclass 'Telerik.Sitefinity.GenericContent.Model.Content' not declared in meta data. --> ProductCatalogSample, Version=1.0.4064.16164, Culture=neutral, PublicKeyToken=null/namespace[ProductCatalogSample.Model]/class[ProductCatalogSample.Model.ProductItem]
        Source : Unity_ILEmit_DynamicClasses
        Help link : 
        ErrorId : 0
        ClassName : Telerik.Sitefinity.GenericContent.Model.Content
        FieldName : 
        TableName : 
        ColumnName : 
        AmbiguousValue : 
        DisambiguatedValue : 
        FileName : 
        ProjectName : 
        IndexName : 
        ConstraintName : 
        ProcedureName : 
        PreviousDefiner : 
        Context : --> ProductCatalogSample, Version=1.0.4064.16164, Culture=neutral, PublicKeyToken=null/namespace[ProductCatalogSample.Model]/class[ProductCatalogSample.Model.ProductItem]
        Usage : 
        Column : 0
        Line : 0
        IsWarning : False
        HelpKeyword : 
        InnerExceptions : 
        FailedObject : 
        BackendError : 
        Reason : Runtime
        CanRetry : True
        Data : System.Collections.ListDictionaryInternal
        TargetSite : Void Initialize(System.String, System.Collections.Specialized.NameValueCollection, System.Type)
        Stack Trace :    at DynamicModule.ns.Wrapped_OpenAccessProvider_b092fda689ac4eadbeaa99fdbe87543f.Initialize(String providerName, NameValueCollection config, Type managerType)
           at Telerik.Sitefinity.Data.ManagerBase`1.InstantiateProvider(IDataProviderSettings providerSettings, Type providerType, ExceptionPolicyName policy, ManagerBase`1 manager)
           at Telerik.Sitefinity.Data.ManagerBase`1.InstantiateProvider(IDataProviderSettings providerSettings, ExceptionPolicyName policy, ManagerBase`1 manager)
           at Telerik.Sitefinity.Data.ManagerBase`1.SetProvider(String providerName, String transactionName)
           at Telerik.Sitefinity.Data.ManagerBase`1..ctor(String providerName, String transactionName)
           at Telerik.Sitefinity.Data.ManagerBase`1..ctor(String providerName)
           at Telerik.Sitefinity.Modules.GenericContent.ContentManagerBase`1..ctor(String providerName)
           at ProductCatalogSample.Data.ProductsManager..ctor(String providerName) in C:\Program Files (x86)\Telerik\Sitefinity 4.0\Samples\CS\Products\Data\ProductsManager.cs:line 34
           at ProductCatalogSample.Data.ProductsManager..ctor() in C:\Program Files (x86)\Telerik\Sitefinity 4.0\Samples\CS\Products\Data\ProductsManager.cs:line 25

  22. Kiril
    Kiril avatar
    19 posts
    Registered:
    09 Dec 2008
    16 Feb 2011
    Link to this post
    Hi Duneel

    It looks like your model has not been registered.
    The build action for the app.config must be "Embedded Resource", and are you running the VEnhance to add the model info to the assembly?

    //Kiril
  23. Duneel
    Duneel avatar
    166 posts
    Registered:
    08 Dec 2010
    16 Feb 2011
    Link to this post
    Hi Kiri,

    The App.Config file in the module is already set as an Embedded Resource. The VEnhance path is correctly set in the project file. Would you be able to give a try with the module source code I uploaded and get back to me please?

    Thanks!
  24. Nicolas
    Nicolas avatar
    156 posts
    Registered:
    19 Jan 2011
    16 Feb 2011
    Link to this post
    Hi,

    I made a try too of Products module.
    I successfully register my own module through Administration.

    But I encounter a problem with App.config, it's cleary connections configuration in Openaccess who cause troubles.
    Originally we have this :
    <openaccess xmlns="http://www.telerik.com/OpenAccess">
        <references>
          <!-- Do not add any references here, as they are added dynamically by Sitefinity
          and it will be duplicated-->     
        </references>
        <connections>
          <connection id="DatabaseConnection1">
            <databasename>Database1</databasename>
            <servername>(local)\SQLEXPRESS</servername>
            <integratedSecurity>True</integratedSecurity>
            <backendconfigurationname>mssqlConfiguration</backendconfigurationname>
          </connection>
        </connections>
    ....
    </openaccess>

    But i don't get how editing this part, in Sitefinity site connection string are already define into DataConfig.config.

    @Duneel => Hi, i see your messages. For verify if your module are really register you can look in SecurityConfig.config, normally Products module create customs permission.
  25. Duneel
    Duneel avatar
    166 posts
    Registered:
    08 Dec 2010
    16 Feb 2011
    Link to this post
    Hi Nicholas,

    Did you try on a fresh instance? Does it create all the back-end tables when you registered the module?

    Thanks!
  26. Basem
    Basem avatar
    131 posts
    Registered:
    22 Dec 2010
    16 Feb 2011
    Link to this post
    I had a hard time reinstalling my module, so I always restored the database to a point before the initial install. I also had to restore the ~/App_Data/Sitefinity folder completely. We will just have to wait until the Uninstall and Upgrade events are implemented.

    I successfully replicated the Products Module and wrote a blog about it. I even included the fixes in this thread. Check it out:
    http://www.sitefinity.com/marketplace/modules/falafel-contacts-module-for-sitefinity-4.aspx

    I hope this sheds some more light. I am really looking forward to the Q1 update on this.
  27. Nicolas
    Nicolas avatar
    156 posts
    Registered:
    19 Jan 2011
    17 Feb 2011
    Link to this post
    Hi Duneel,

    i'm on a fresh instance, i just start on Sitefinity ;-).
    The Backend tables doesn't create, but i just verify ContentViewConfig.config and config:link for module aren't generated.

    I think my connection configuration in App.config module is bad, it results InitializeDefaultViews in ProductsConfig.cs doesn't work well and don't construct backend part.

    I made connections like this :
    <connections>
      <connection id="DatabaseConnection1">
        <databasename>MyBase</databasename>
        <servername>SRV100\MS02</servername>
        <integratedSecurity>True</integratedSecurity>
        <backendconfigurationname>mssqlConfiguration</backendconfigurationname>
      </connection>
    </connections>

    But I just got in response when I register the module and restart application this exception :
    Telerik.OpenAccess: No enhanced assembly has been found for meta-data construction. This may be caused by a missing app.config file (use app.config as embedded resource then) or by an insufficient references section in the configuration file (add the referenced enhanced assemblies there too) or by a wrong enhancement setting; please check your configuration.

    My App.config is configured as an embedded resource.

    Regards

    Nicolas
  28. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    19 Sep 2016
    17 Feb 2011
    Link to this post
    Hi Nicolas,

    It looks like the class library is not enhanced. Please check the .csproj file and make sure that you have configured  VEnhance.exe.

    All the best,
    Ivan Dimitrov
    the Telerik team
  29. Duneel
    Duneel avatar
    166 posts
    Registered:
    08 Dec 2010
    17 Feb 2011
    Link to this post
    Hi Nicolas,

    I got the products module working. Try with a fresh website with the default database settings (pointing to SQLExpress) and the app.config of the module should also have the default db settins (Database1 and SQLExpress). Verify the project file has been updated to reference VEnhance.

    Once the dll is build copy over to the bin folder of the website and register the module through the admin screen. once done, update the web.config and re-save and refresh the page to trigger the module installation.

    Cheers!
    Duneel
  30. Nicolas
    Nicolas avatar
    156 posts
    Registered:
    19 Jan 2011
    17 Feb 2011
    Link to this post
    Hi,

    Thanks for your responses.

    After investigation, the problem seems to be VEnhance. I follow process describe into documentation attached with module "Creating a custom module for Sitefinity 4.docx" but i don't success configure VEnhance.

    When i try to build the module VEnhance cause an error type 3. If I test same line command into DOS it seems works.

    <ProjectExtensions>
        <VisualStudio>
          <UserProperties OpenAccess_ConfigFile="App.config" OpenAccess_ConnectionId="DatabaseConnection1" OpenAccess_Enhancing="True" OpenAccess_UpdateDatabase="False" OpenAccess_EnhancementOutputLevel="1" />
        </VisualStudio>
      </ProjectExtensions>
      <PropertyGroup>
        <PostBuildEvent>
        </PostBuildEvent>
        <PreBuildEvent>
        </PreBuildEvent>
      </PropertyGroup>
      <!-- Telerik OpenAccess enhancement -->
      <Target Name="EnhanceAssembly" Condition="'$(_AssemblyTimestampBeforeCompile)'!='$(_AssemblyTimestampAfterCompile)'">
        <Copy SourceFiles="$(TargetPath)" DestinationFiles="$(TargetPath).notenhanced" />
        <Copy SourceFiles="$(PdbFile)" DestinationFiles="$(PdbFile).notenhanced" ContinueOnError="true" />
        <Message Text="$(TargetDir)" Importance="high" />
        <Exec IgnoreExitCode="False" WorkingDirectory="$(TargetDir)" Command=""..\DLLs\Sitefinity\VEnhance.exe" -verboseMode:2 "-config:$(ProjectDir)App.config" -signAssembly "-keyFile:$(ProjectDir)$(AssemblyOriginatorKeyFile)" "-assembly:$(TargetPath)"" Condition="'$(AssemblyOriginatorKeyFile)'!=''" />
        <Exec IgnoreExitCode="False" WorkingDirectory="$(TargetDir)" Command=""..\DLLs\Sitefinity\VEnhance.exe" -verboseMode:2 "-config:$(ProjectDir)App.config" "-assembly:$(TargetPath)"" Condition="'$(AssemblyOriginatorKeyFile)'==''" />
        <Copy SourceFiles="$(TargetPath)" DestinationFolder="$(IntermediateOutputPath)" />
        <Copy SourceFiles="$(PdbFile)" DestinationFolder="$(IntermediateOutputPath)" ContinueOnError="true" />
      </Target>
      <Target Name="PeVerify" Condition="'$(_AssemblyTimestampBeforeCompile)'!='$(_AssemblyTimestampAfterCompile)'">
       <GetFrameworkSdkPath>
          <Output TaskParameter="Path" PropertyName="SdkPath" />
        </GetFrameworkSdkPath>
        <Exec WorkingDirectory="$(SdkPath)bin" Command="peverify.exe /nologo "$(TargetPath)"" />
      </Target>
      <PropertyGroup>
        <PdbFile>$(OutDir)\$(AssemblyName).pdb</PdbFile>
        <RunPostBuildEvent>OnOutputUpdated</RunPostBuildEvent>
        <PrepareForRunDependsOn>
          $(PrepareForRunDependsOn);
          EnhanceAssembly;
          <!-- PeVerify -->
    </PrepareForRunDependsOn>
      </PropertyGroup>


    Regards,

    Nicolas
44 posts, 0 answered
1 2