Debugging episerver 7 uncompress file

Vote:
 

Hi All,

I follow this artile to try to debug the episerver javascript file: http://world.episerver.com/Blogs/Ben-McKernan/Dates/2012/12/Uncompressed-JavaScript-files-for-debugging-EPiServer-7/. However, it does not work as expected, I event delete some files or the whole folder, clear the cache the Edit mode still work fine. It's really strange, do you guys know where to clear the cache for episerver edit mode?

Thank you,

Hai

 

#67890
Mar 14, 2013 8:18
Vote:
 

Hi Hai!

When I do updates to our override of the Framework masterfile (site.master, the one used by the edit and admin mode) I always have to empty the ASP.NET cache to be able to see the changes. Perhaps it's the same with the javascripts?

#67956
Mar 14, 2013 10:20
Vote:
 

Hi Petter!

Thank you very much for the tip. Unfortunately, I did empty the ASP.NET cache but it still not does the trick. Maybe CMS loads the files from somewhere else.

#67961
Mar 14, 2013 10:36
Vote:
 

It could be a cache issue like Petter suggests but to me it sounds like you might not be extracting it correctly (since deleting a whole VPP folder should probably crash your site).

You need to extract the zip to the root of your site's VPP folder. Don't create any additional folders as the zip file is structured to match the folder structure for the UI modules.

This means that once extracted you should have source files and built files side by side in the VPP folders. To check you can looks at the following path for you site (assuming a default install location):

C:\EPiServer\VPP\%SITE_NAME%\Modules\Shell\1.0.456\ClientResources\epi

There you should see two of each file where one file has the .uncompressed.js extension appended.

#67964
Mar 14, 2013 10:49
Vote:
 

Thank you Ben,

I did extract the zip to the root of your site's VPP folder as described in the article, and I can see the uncompress files. However, for some files even I delete them, the site still fine! Let's say, I need to modify the PageDataController.js.uncompressed.js, I did some chage in the file, clear cache (all kind of caches) but it does not make any changes. Really need to do some chages on this but cannot get it to affect. Hopefully you guys can shed me some light.

Regards,

Hai

#67976
Mar 14, 2013 11:51
Vote:
 

Firstly; do you get the uncompressed version of the file when you view the js source in the browser?

Secondly; changing system files is generally a bad idea since your changes will be lost when you upgrade. What's the problem you're trying to solve?

 

#67982
Mar 14, 2013 12:50
Vote:
 

Thank you Stefan,

Yes, I did see(some) files in the browser, so I think the uncompress file works as it should.

I know that changing the system file is not good at all, yes it's a bad idea...The problem I have currently is set the form editing mode as the default mode when editor select a page in the page tree instead of the preview mode, and I need to change the PageDataController.js to make it work. Do you have any idea about this?

Regards,

Hai 

#67984
Mar 14, 2013 13:09
Vote:
 

Ok, but do you actually see the uncompressed versions of the javascript files in your browser? For example dojo.js?

If so then the uncompressed files are working as expected. If not then the only thing I can think of, assuming you've extracted the files correctly, would be to double check you have added the config entry to EPiServerFramework.config

 

Also changing the files like you are doing isn't supported and, like Stefan said, will be overriden as soon as an upgrade is done. Saying that however I will still point you in the right direction. Change the value of the _defaultEditViewName property in the PageDataController to "formedit".

#67986
Mar 14, 2013 13:29
Vote:
 

Thank you very much for the tip Ben.

Unfortunately, I did chage the file as your sugestion clear browser cahce, reset iis, clear the ASP.NET temp files..., but it does not make any changes.  Even I delete the folder contentediting it still work fine. How can it work without these files?

Regards,

Hai

 

#67990
Mar 14, 2013 14:10
Vote:
 

It won't work without those files, so you're clearly not modifying things in the right place. But since changing system files is a bad thing I'm gonna propose another solution for you.

  1. In you web site (the Alloy site in a standard installation) add a file named "setDefaultEditView.js" in the ClientResources/Scripts folder.
  2. Add the following javascript code to the file you created

    require(["epi/cms/contentediting/PageDataController"], function(pageDataController) {
        pageDataController.prototype._defaultEditViewName = "formedit";
    });

  3. Open the module.config file in the root of your site and add the following code inside the module element:

    <clientResources>
        <add name="epi.cms.widgets.base" path="Scripts/setDefaultEditView.js" resourceType="Script" sortIndex="10" />
    </clientResources>

  4. Touch web.config or execute iisreset so the module.config is re-read.

 

The addition to the module.config file will make sure that setDefaultEditView.js is loaded after the cms widgets, and the javascript code will get hold of the PageDataController and change the default edit mode value.

#68008
Mar 14, 2013 15:30
Vote:
 

Tons of thanks for you Stefan, it work like a charm!!!

You save my day.

Regards,

Hai

#68013
Mar 14, 2013 16:00
Vote:
 

Dear Stefan,

I am facing the same problem, any changes in my javascript changes won't reflect until I clear the cache/reset the website/Recycle tthe app pool/ multiple times. This is for when I add custom property using Dojo, in alloy version 7.1 website (I have upgraded the site to version 7.1 using Add on)

So coming back to my question, in the above code, which is for MVC, what should I do to make it run on webforms? 

Many thanks,
Naz

#117261
Feb 16, 2015 11:04
Vote:
 

The above code should work the same regardless of your site implementation.

Where are the javascript files you're modifying located?

For files located in the site you should start looking at the clientcache configiration and the caching profiles. Look at the caching headers in the response should give you a hint about the current caching.

#117274
Feb 16, 2015 13:42
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.