Queries not generated for Document Types in version 7

benyamin jain asked on April 8, 2015 00:57

HI

i download and install kenticocms 7 after setup new website i see in documnt types that no queries generated for document types.

i apply hotfixes till 91 but nothing changed.

any idia?

Thans alot

Recent Answers


Juraj Ondrus answered on April 8, 2015 08:58

Hi,

This is by design. the queries are generated on the fly for better performance. you can however add custom ones as usual or, if you add a query with the same name as the system query, this one will be used.

0 votesVote for this answer Mark as a Correct answer

benyamin jain answered on April 8, 2015 09:22

HI, Juraj Ondrus

Thanks for reply.

then by your note whenever i create a new Document Type , it is no problem that i can not see list of standard queries? they are created and there is no problem for working with them?

Another thing that i discover about is : SqlGenerator.GenerateDefaultQueriesToDB statement that is allways return false and prevent system from generating default queries also by removing that statement nothing change.(/CMSModules/AdminControls/Controls/Class/NewClassWizard.ascx.cs Ln:1236).

0 votesVote for this answer Mark as a Correct answer

Juraj Ondrus answered on April 8, 2015 11:55

Hi,

Yes, the system SQL queries are generated on the fly - so they are not listed. Are oyu having any problems? I am not aware of this causing any issues in Kentico 7.

Regarding the second thing - could you please describe it in more details how to reproduce this issue?

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on April 8, 2015 14:22

@ Benyamin,

As Juraj mentions the default queries are generated on the fly. Check out the documentation that has what the default queries are. If you wish to override them, simply create a new query with the same code name (i.e.: SELECTALL, SELECT, DELETE, etc.) and add your own query. Be careful though as this could have a negative impact on your system and/or performance.

0 votesVote for this answer Mark as a Correct answer

benyamin jain answered on April 8, 2015 23:28

@Juraj

i have default corporate site runing on KCMS 7.0 hotfix 91.

by setting break point at (/CMSModules/AdminControls/Controls/Class/NewClassWizard.ascx.cs Line:531 and other places that like this) and then trying to create new document type.

the result of if (SqlGenerator.GenerateDefaultQueriesToDB) always false.

 private void ProcessStep1(WizardNavigationEventArgs e)
 {
    ....
     switch (Mode)
                    {
                        case NewClassWizardModeEnum.DocumentType:
                            // Ensure default permissions
                            PermissionNameInfoProvider.CreateDefaultClassPermissions(dci.ClassID);

                            // Generate special document queries, for possible premature exit from wizzard
                            **if (SqlGenerator.GenerateDefaultQueriesToDB)**
                            {
                                SqlGenerator.GenerateQuery(dci.ClassName, QueryProvider.QUERYNAME_SEARCHTREE, SqlOperationTypeEnum.SearchTree, false, false);
                                SqlGenerator.GenerateQuery(dci.ClassName, QueryProvider.QUERYNAME_SELECTDOCUMENTS, SqlOperationTypeEnum.SelectDocuments, false, false);
                                SqlGenerator.GenerateQuery(dci.ClassName, QueryProvider.QUERYNAME_SELECTVERSIONS, SqlOperationTypeEnum.SelectVersions, false, false);
                            }
                            break;

                        case NewClassWizardModeEnum.Class:
                            break;

                        case NewClassWizardModeEnum.CustomTable:
                            // Ensure default custom table permissions
                            PermissionNameInfoProvider.CreateDefaultCustomTablePermissions(dci.ClassID);
                            break;
                    }
                    ......
  }

With Best Regards

0 votesVote for this answer Mark as a Correct answer

Juraj Ondrus answered on April 9, 2015 09:27

Hi,

this is OK - the queries are composed and generated on the fly at the moment when they are needed. So, they are not generated to the DB upon the document type creation.

0 votesVote for this answer Mark as a Correct answer

benyamin jain answered on April 9, 2015 18:05

@Juraj Ondrus

Thank you so much

now it is completely become clear. however we can add new queries based on new requirements.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.