Wednesday, July 18, 2012

Endeca - FATAL ERROR


Solution: Delete the file autogen_dimensions.xml.gz and copy the one from autogen_dimensions.xml.external.gz and rename to autogen_dimensions.xml.gz.


 FATAL     08/29/11 19:00:41.205 UTC   FORGE           {config}: Unable to open C:\Endeca\apps\xxx\data\state\autogen_dimensions.xml.gz for input: I/O Exception: compression format exception:            


ERROR          08/29/11 19:00:41.221 UTC   FORGE           {config}: Forge failed with 1 error and 0 warnings. 

Endeca - Solution for cleanDir_processing failed

Solution is removing the file processing from folder E:\Endeca\apps\xxx2011\data and recreate folder E:\Endeca\apps\xxx2011\data\processing and then re-run baseline update.



INFO: [ITLHost] Starting shell utility 'cleanDir_processing'.
Aug 5, 2011 9:43:10 AM com.endeca.soleng.eac.toolkit.script.Script runBeanShellScript
SEVERE: Utility 'cleanDir_processing' failed. Refer to utility logs in [ENDECA_CONF]/logs/shell on host ITLHost.
Occurred while executing line 17 of valid BeanShell script:
[[

14|        }
15|       
16|        // clean directories
17|        Forge.cleanDirs();
18|        PartialForge.cleanCumulativePartials();
19|        Dgidx.cleanDirs();
20|       

]]

Aug 5, 2011 9:43:10 AM com.endeca.soleng.eac.toolkit.Controller execute
SEVERE: Caught an exception while invoking method 'run' on object 'BaselineUpdate'. Releasing locks.

SharePoint - Create pages with left navigaion

There are plenty of internet pages that teach you how to add left navigation while you create a site page by using SharePoint designer, however, this is definitely not necessary. Any pages changed by SharePoint designer will turned to ungosted and not good for program package. A straight way is locating the correct entry to create page. Here follows steps.
1. Site Action - Manage Content and Structure
2. Click the small right triangle beside folder "Pages" from the left navigation menu. Click New - Page.
3. Name the title, URL and choose page layout. I tried the Blank Web Part page.

It works great for me.

Thursday, September 29, 2011

jQuery UI slider twisting for both iPad and iPhone, or any tablet.

I was working for improving our slider to be avaiable for both iPad and iPhone, however, from the reference of official jQuery UI, it addressed to target only for iPhone(http://bugs.jqueryui.com/ticket/4143). The one (http://bugs.jqueryui.com/ticket/7001) targeting to iPad is using the same of iPhone. It words well with iPhone but not iPad. By checking the code, I found it is a small trick to adjust the code to work for both of them or even more. Here follows the solution.

You want to first put code change as cscott's post first (https://github.com/cscott/jquery-ui/commit/3744712e13271fa06a502be19bb8b3854fe66c59) , then modify the code of file (jquery.ui.mouse.js or ui.mouse.js), finding the following one (around line No. 17th) and do following 2 steps:
Step 1. Modify code:
(deleted) var iPhone = (navigator.userAgent.indexOf('iPad') != -1);
(added) var iPhonePad = (navigator.userAgent.indexOf('iPad') != -1) ||(navigator.userAgent.indexOf('iPhone') != -1);

Step 2. Replace all the keyword "iPhone" to "iPhonePad".


Friday, July 1, 2011

Javascript function - Replace or remove the URL parameters

Well, I've been searching some functions for handle URL parameters to replace or remove on both of javascript or jQuery. However, I didn't find any fit one. This is what I wrote for such usage:


//Handle URL parameter, if newvalue is empty, remove the parameter or replace with new value.
replaceUrlParameter = function (url, param, newvalue) {
if (url.indexOf("#")) {
url = url.split("#")[0];
}
var headUrl = url.split("?")[0];
var arrayParam = url.split("?")[1].split("&");
var idx = null;
for (i = 0; i < arrayParam.length; i++) {
if (arrayParam[i].split("=")[0] == param) {
idx = i;
}
}
if (idx != null) {
var newUrl = null;
if (newvalue != "") {
var newParam = param + "=" + newvalue;
newUrl = arrayParam.splice(idx, 1, newParam);
}
else {
var removedArray = arrayParam.splice(idx, 1);
newUrl = headUrl + "?" + arrayParam.join("&");
}
return newUrl;
}
else
{ return url; }
return url;
}

Thursday, July 15, 2010

2 Levels Common Table Expressions (CTE) Sample

ALTER procedure [dbo].[sp_EndecaFeed_GetAll_ClassesHierarchy]
as
--List all hierarchy
with Hierarchy(ClassID, ClassName, FullName, ParentClassID, ParentHierarchy, Seq) as
(
select FullName = ClassID, ClassName, convert(nvarchar(1000), ClassName), ParentClassID, convert(nvarchar(1000), ClassName) as ParentHierarchy, Seq = 1
from Classes
union all
select FullName = p.ClassID, p.ClassName, convert(nvarchar(1000),FullName + '/' + p.ClassName), p.ParentClassID, convert(nvarchar(1000), FullName) as ParentHierarchy, Seq = Seq + 1
from Classes p
inner join Hierarchy c on c.ClassID = p.ParentClassID
)
--Filter out the redundant hierarchy
,ClassHierarchy(Row, ClassID, ClassName, FullName, ParentClassID, ParentHierarchy) as
(
select ROW_NUMBER() OVER (PARTITION BY ClassID ORDER BY seq DESC), ClassID, ClassName, FullName, ParentClassID, ParentHierarchy
from Hierarchy
)

select Distinct CH.ClassID, CH.ClassName, FullName as Hierarchy, CH.ParentClassID, CH.ParentHierarchy
From Products P,
ProductClasses PC,
ClassHierarchy CH
Where P.ProductID = PC.ProductID AND
PC.ClassID = CH.ClassID AND
CH.Row = 1 AND
--Filter the hierarchy without associated with products
CH.ClassID in (select distinct ClassID from ProductClasses) AND
P.IsActive = 1 AND
P.HasContent = 'Y'
order by ClassID

Monday, August 10, 2009