<commit_before><cfcomponent extends="eventHandler">

	<cffunction name="doLoadSite">
		<cfscript>
			var siteID = getValue("siteID");
			var firstTime = getValue("firstTime",false);	// this is to flag a site being opened for the first time after creation
			var oSiteDAO = 0;
			var qrySite = 0;
			var oHomePortals = 0;
			var oSiteBean = 0;
			var oContext = 0;
			
			try {
				// if a siteID is given, then set it on the context struct
				if(siteID neq "") {

					// load site information
					oSiteDAO = getService("DAOFactory").getDAO("site");
					qrySite = oSiteDAO.get(siteID);

					// create site bean
					oSiteBean = createObject("component","ColdBricks.components.model.siteBean").init();
					oSiteBean.setID( siteID );
					oSiteBean.setSiteName( qrySite.siteName );
					oSiteBean.setPath( qrySite.path );
					oSiteBean.setOwnerUserID( qrySite.ownerUserID );
					oSiteBean.setCreatedDate( qrySite.createdDate );
					oSiteBean.setNotes( qrySite.notes );
				
					// instantiate HomePortals application
					oHomePortals = createObject("Component","Home.Components.homePortals").init(oSiteBean.getPath());

					// store site and app in session					
					oContext = getService("sessionContext").getContext();
					oContext.clearSiteContext();
					oContext.setSiteInfo(oSiteBean);
					oContext.setHomePortals(oHomePortals);
					
				}

				setNextEvent("ehSite.dspMain","firstTime=#firstTime#");
				
			} catch(any e) {
				setMessage("error",e.message);
				getService("bugTracker").notifyService(e.message, e);<commit_msg>manually call the indexing of all resources when loading a site, this no longer happens automatically on the HomePortals engine<commit_after><cfcomponent extends="eventHandler">

	<cffunction name="doLoadSite">
		<cfscript>
			var siteID = getValue("siteID");
			var firstTime = getValue("firstTime",false);	// this is to flag a site being opened for the first time after creation
			var oSiteDAO = 0;
			var qrySite = 0;
			var oHomePortals = 0;
			var oSiteBean = 0;
			var oContext = 0;
			
			try {
				// if a siteID is given, then set it on the context struct
				if(siteID neq "") {

					// load site information
					oSiteDAO = getService("DAOFactory").getDAO("site");
					qrySite = oSiteDAO.get(siteID);

					// create site bean
					oSiteBean = createObject("component","ColdBricks.components.model.siteBean").init();
					oSiteBean.setID( siteID );
					oSiteBean.setSiteName( qrySite.siteName );
					oSiteBean.setPath( qrySite.path );
					oSiteBean.setOwnerUserID( qrySite.ownerUserID );
					oSiteBean.setCreatedDate( qrySite.createdDate );
					oSiteBean.setNotes( qrySite.notes );
				
					// instantiate HomePortals application
					oHomePortals = createObject("Component","Home.Components.homePortals").init(oSiteBean.getPath());

					// load the full index of the resource library
					oHomePortals.getCatalog().index();

					// store site and app in session					
					oContext = getService("sessionContext").getContext();
					oContext.clearSiteContext();
					oContext.setSiteInfo(oSiteBean);
					oContext.setHomePortals(oHomePortals);
					
				}

				setNextEvent("ehSite.dspMain","firstTime=#firstTime#");
				
			} catch(any e) {
				setMessage("error",e.message);
				getService("bugTracker").notifyService(e.message, e);
{'fraction_non_alphanumeric': 0.11746896760520739, 'fraction_numerical': 0.003027550711474417, 'mean_word_length': 3.4952380952380953, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7515093', 'n_tokens_mistral': 1305, 'n_tokens_neox': 1011, 'n_words': 229}