Try our conversational search powered by Generative AI!

Dynamic Data Store and error: Invalid name format for storeName. Only characters a-z, 0-9, '.', and '_' are allowed for security reasons

Vote:
 

Hi, 

I am playing with Dynamic Data Store (to see how it works) and I am stuck with that error: Invalid name format for storeName. Only characters a-z, 0-9, '.', and '_' are allowed for security reasons

I read somewhere on the forum that the name of the store is generated based on the namespace and type name. But I can't see anything in my code that can cause that error.

My code is something like this: 

namespace EPiServerUtils.Common

 

  public static void SaveSomePageData(object sender, PageEventArgs e)
        {
                PageData page = DataFactory.Instance.GetPage(e.PageLink);
                
                
                DynamicDataStore store = DynamicDataStoreFactory.Instance.GetStore("MyStore");
                
                if (store == null)
                {
                    store = DynamicDataStoreFactory.Instance.CreateStore("MyStore", typeof(PageInformation));
                }
                PageInformation pageToStore = new PageInformation();
                pageToStore.MyPageData = page;
                pageToStore.MyPageLink = page.PageLink;
                
                store.Save(pageToStore);
            
        }
public class PageInformation
    {
        public PageData MyPageData { get; set; }
        public PageReference MyPageLink { get; set; }
    }

public static void SaveSomePageData(object sender, PageEventArgs e)      

 {

                PageData page = DataFactory.Instance.GetPage(e.PageLink); 

DynamicDataStore store = DynamicDataStoreFactory.Instance.GetStore("MyStore");

if (store == null)

                {

                    store = DynamicDataStoreFactory.Instance.CreateStore("MyStore", typeof(PageInformation));

                }
                PageInformation pageToStore = new PageInformation();

                pageToStore.MyPageData = page;

                pageToStore.MyPageLink = page.PageLink;

store.Save(pageToStore);
             }

public class PageInformation

{

        public PageData MyPageData { get; set; }

        public PageReference MyPageLink { get; set; }

}

 

Can you see anything that may cause that error?

Thank you in advance for any help :)

 

Regards,

Dominik

#41086
Jun 30, 2010 22:07
Vote:
 

I would not recommend storing as complex objects as PageData in the DDS. It would force the DDS to create stores for all other nested complex types, and maybe somewhere in there lies your name problem. There is no need to store PageData or even PageReference objects (you are trying to duplicate data), just store the page guid (or id) and possibly the language branch. Then you have all you need to retrieve the PageData from DataFactory later.

#41669
Jul 20, 2010 13:10
Vote:
 

Hi,

 

Thank you for your answer :)

I will try to do that. I am storing PageData object because it is the deleted page data (if it is deleted i do not have access to it's data, do I?)

 

Regards,

Dominik 

#41670
Jul 20, 2010 13:16
Vote:
 

No you won't. But if you need to trace removed pages perhaps you can try a different approach? Like saving only some log information which is important or moving the pages to an archive location rather than deleting them? Or just use the waste basket (use MoveToWastebasket rather than Delete for the PageData if you do it from code).

#41671
Jul 20, 2010 13:21
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* 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.