Smitha H Rao

Ranch Hand
+ Follow
since Oct 20, 2007
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Smitha H Rao

This book sounds interesting. For many professionals who are looking their career in software, such books are good motivation. I am looking forward for this book.
10 years ago
Hi,

I have integrated hibernate serach into an existing spring and hibernate web application. I have added following 2 in the persistence.xml files:
<property name="hibernate.search.default.directory_provider"
value="org.hibernate.search.store.FSDirectoryProvider" />
<property name="hibernate.search.default.indexBase" value="e:\search" />

My eo class looks like below:
@Entity
@Table(name="test")
@Indexed
@AnalyzerDef(name = "customanalyzer",
tokenizer = @TokenizerDef(factory = StandardTokenizerFactory.class),
filters = {
@TokenFilterDef(factory = LowerCaseFilterFactory.class),
@TokenFilterDef(factory = SnowballPorterFilterFactory.class,
params = {
@Parameter(name = "language", value = "English")
})
})
public class TestEO extends UpdateableEO implements Test,java.io.Serializable {

private static final long serialVersionUID = 1L;

private TestCategoryEO testCategoryEO;
private SkillUserProfileEO guruEO;

@Transient
Test test;

@Transient
public Test getTest(){
return this.test;
}

public void setTest(Test test){
this.test=test;
}

public TestEO() {
this.test = new TestVO();
}

public TestEO(Test test) {
this.test=test;
}

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@DocumentId
@Column(name="test_id")
public Integer getTestId() {
return test.getTestId();
}

public void setTestId(Integer testSetId) {
test.setTestId(testSetId);
}

@Column(name="test_name", unique=false, nullable=true, insertable=true, updatable=true, length=45)
@Field(index=Index.TOKENIZED, store=Store.NO)
@Analyzer(definition = "customanalyzer")
public String getTestName() {
return test.getTestName();
}

public void setTestName(String testName) {
test.setTestName(testName);
}

@Column(name="test_desc")
@Field(index=Index.TOKENIZED, store=Store.NO)
@Analyzer(definition = "customanalyzer")
public String getTestDesc() {
return test.getTestDesc();
}

public void setTestDesc(String testDesc) {
test.setTestDesc(testDesc);
}
.....


The code I am using to do search is as follows:
String[] fields = new String[]{"testName","testDesc", "keywords"};

MultiFieldQueryParser parser = new MultiFieldQueryParser(fields, new StandardAnalyzer());
org.apache.lucene.search.Query query = parser.parse( strTest );
// wrap Lucene query in a javax.persistence.Query
javax.persistence.Query persistenceQuery = testDAO.getFullTextEntityManager().createFullTextQuery(query, TestEO.class);
// execute search
System.out.println("created query::"+persistenceQuery.toString());
List<TestEO> result = persistenceQuery.getResultList();
System.out.println("result ::"+result);
if(result!=null){
tests = new ArrayList<TestVO>();
for (TestEO testeo : result) {
TestVO test = (TestVO) testeo.getTest();
test.setGuru(testeo.getGuruEO().getUserProfile());
test.setTestCategory(testeo.getTestCategoryEO().getTestCategory());
}
}


The problem is in the index directory, i. e in e/search I can see TestEO directory being created and inside that I see segments and segments.gen files, but they are just 1 kb files where my table is full of data.

Searching on any string shows blank List.. Please help me solving this.


Thanks
Smitha
Hi All,

I am new to Hibernate search. But after all set up, I get blank list of object on every search. In the index directory, though I see segments and segments.gen files, they are just a 1 kb files (where my table is full of data). I think the indexes are not being generated for the table. Does anyone has any idea about it? Please help.

Thanks
Smitha
Can you copy web.xml file here?
10 years ago
JSF
I had same requirement in one of my pages and I did as below:

set a bean property if you want to call javascript function and then assign it to a javascript variable as below:

<script language='javascript'>

var rowFlag = '<h:outputText value="#{bean.property}" />';

// your function goes here
function myFunction(){
}

// now on the basis of the rowFlag you can call myFunction()
if(rowFlag == 'Some Expected value')
myFunction();

</script>

<body>
<f:view>
<h:form>
.
.
.
10 years ago
JSF
JSF components gets rendered from server and javascript function gets called at client side.
So If you want to set a javascript variable when the page is rendered/loaded, you can simply do it in <body onLoad="" function.

>
10 years ago
JSF
javax.faces.model.SelectItem;
10 years ago
JSF
If you want to display message then it should be

<h: outputText id="message" styleClass="errores" value="#{AuthenticationBean.message}"/>

10 years ago
JSF
Even I suggest PrimeFaces.

You can also find a sample tutorial for graphs in jsf at:
http://www.skill-guru.com/blog/2009/08/31/implementing-charts-in-jsf-using-jsf-comp-library/

Hope this helps!

10 years ago
JSF
Hi Ram,

Is this position still open?
Thanks
Smitha
10 years ago
This means inside webapp you have
get war which intern have
testUpload
testUpload /WEB-INF etc

Then your setting is wrong.

you must have the WEB-INF directory exactly inside get.war (it should not be inside another directory testUpload )
You should know tomcat webapplication directory structure.

10 years ago
JSF
I used to get this kind of errors when there are some attribute values in some tages not surrounded by double quotes.
Something like
<table border=1

this should be <table border="1"

I guess this is the case in your end also.

Thanks
Smitha>
10 years ago
JSF
Sonia,

The directory stucture you have listed looks like a eclipse work directory. When you deploy it in tomcat, a new deployable testUpload directory will be created with contents of only webcontent folder and classes compiled.
Suppose your eclipse working directory is something say E:/java/myEclipseWork and you tomcat deployed directory is say c:/tomcat

then when you deploy the application from eclipse a directory c:/tomcat
c:/tomcat/webapp/testUpload will be created and this is actually the directory from which the tomcat picks up the file when you request something.

If you want to download something, you have to specify path for upload at c:/tomcat/webapp/testUpload folder.



10 years ago
JSF
JSF
If you use <h:messages /> tag at the top of your form, you will know what is the exact error.
10 years ago
JSF
I recommend JSF.
If you dont find some components in core JSF , you have flexibility to use other thirdparty components like richfaces, tomahawk library in core by simply configuring them.

I have used this for 3 projects and I find it cool.


10 years ago
JSF