Usage if the ifs-search classes
hi,
I look for an example of the use of the search classes -- Oracle.ifs.search.*, Oracle.ifs.beans.Search and Oracle.ifs.beans.SearchResultObject.
It would be nice if you could give me a small codeexample
TIA
Oliver
* This method seaches and gets the content of an iFS document.
private static String getStyleSheetContent(LibrarySession ifs, String xslName)
throws IfsException
String retString = "";
String className[] = {"DOCUMENT"};
SearchClassSpecification scs = new SearchClassSpecification(className);
scs.addResultClass("DOCUMENT");
AttributeQualification aq1 = new AttributeQualification();
aq1.setAttribute("DOCUMENT", "NAME");
aq1.setOperatorType(AttributeQualification.LIKE);
aq1.setValue(xslName);
SearchSortSpecification ss = new SearchSortSpecification();
ss.add("NAME" , SearchSortSpecification.ASCENDING);
AttributeSearchSpecification ass = new AttributeSearchSpecification();
ass.setSearchClassSpecification(scs);
ass.setSearchQualification(aq1);
ass.setSearchSortSpecification(ss);
Search srch = new Search(ifs, ass);
srch.open();
try
{ while (true)
LibraryObject lo = srch.next().getLibraryObject();
Document d = (Document)lo;
InputStream is = d.getContentStream();
BufferedReader br = new BufferedReader(new InputStreamReader(is));
for (String nextLine = br.readLine(); nextLine != null; nextLine = br.readLine())
retString += nextLine;
br.close();
catch (IfsException e)
if (e.getErrorCode() == ERRORCODE)
if (DEBUG)
System.out.println("Reached the end of the search data");
else
throw e;
catch (IOException ioe)
System.err.println("IOException reading XSL : " + ioe.toString());
srch.close();
if (DEBUG)
System.out.println("Returning :[" + retString + "]");
return retString;
null
Similar Messages
-
Extending the iFS WebUILogin class
Morning, all,
We're in the process of integrating a Web Content Management System with the iFS repository. Short version of the story is that we have tables and PL/SQL packages on a separate schema within the same database that the iFS repository is resident in that are being accessed through a JSP front end. During the early phase of the development, we used the following connection bean to open a connection to the schema
import java.sql.*;
import java.sql.DriverManager;
import java.sql.SQLException;
import javax.servlet.http.*;
import oracle.jdbc.driver.OracleDriver;
import java.util.Vector;
public class CMSConnectionBean implements HttpSessionBindingListener {
private Connection __CMSConnection;
private Statement __Statement;
private final static String ConnectString ="jdbc:oracle:thin:@.....";
private final static String uid = "uid";
private final static String pwd = "pwd";
* Constructor Definitions
public CMSConnectionBean() {
try {
DriverManager.registerDriver (new OracleDriver());
myConnection = DriverManager.getConnection(ConnectString,uid,pwd);
myStatement = __CMSConnection.createStatement();
catch (SQLException e) {
System.err.println("Connection Bean: driver is not loaded - " + e);
myConnection = null;
// Method implementations...
and used an SQLJ wrapper class generated from Jdeveloper to call the PL/SQL packages. Read only views of the necessary tables in the CMS schema have been created, and grant execute privs on the necessary PL/SQL packages have been incorporated into a role that has been granted to IFSSYS.
What we want to do know is use the WebUILogin class to authenticate users logging onto the Content Management System using iFS authentication; and we want to provide a Connection and Statement object so we can query the CMS table views and invoke the PL/SQL packages through the JSP app, as well as access the iFS API. Is it possible to create a new class extending the WebUILogin class, and include two new class attributes from the java.sql.* library (specifically, a Connection and Statement object) and then implement the associated getter and setter methods? More to the point, how would we use the iFS LibrarySession information to open a JDBC driver to the IFSSYS schema to access the views and packages from the CMS schema? For example, can we extend the WebUILogin class, and then generate a constructor for the new subclass, something like
package pkg;
import ...etc etc etc;
public class newclass extends WebUILogin {
// Class attributes
private Connection myConnection;
private Statement myStatement;
//Constructor
public newclass() {
try {
super(); //calls the constructor for the base class, WebUILogin
// open the JDBC thin driver here
DriverManager.registerDriver (new OracleDriver());
myConnection = DriverManager.getConnection(..LibrarySession provided information here...);
myStatement = myConnection.createStatement();
catch (...)
// Method implementations
Or is there a better way of getting this functionality?
Thanks for your help
Geoff.
nullGeoff
Are you wanting to use the iFS JDBC Connection or establish your own connection based on user information (username,password) stored somewhere in iFS.
If you want to use your own information then you could create an extendedUserProfile that would allow you to record the uid,pwd needed to establish your own connection.
As Alan says, if you want to share the iFS JDBC connection that's not currently supported -
Where did the iFS Javadoc webpages go?
The Javadoc webpages of iFS APIs seem to have vaporized early last week. Can someone please point to their new home? they were not easy to find in the first place, but now I am having no luck at all.
Thanks,
-JeffI'm trying very hard to just create a new versioned document in IFS 9.0.2 via APIs. Unfortunately, I'm running into problems at many different points:
If I don't specify a content string, I get:
oracle.ifs.common.IfsException: IFS-30002: Unable to create new LibraryObject
oracle.ifs.common.IfsException: IFS-31803: No Content specified in ContentObjectDefinition
If I leave the file out of the DocDef, I get a different error:
java.lang.NoSuchMethodError: long oracle.jdbc.dbaccess.DBAccess.lobWrite(oracle.sql.BLOB, long, byte[])
Even if this were to work, embedded within the code, there is quirky behaviour coming from the order of establishing Documents, VersionsSeries, and Families. I know you guys are trying to maintain flexability, but the structures listed in the book have hidden sequential dependencies (difficult coupling issues). It's not well documented, making these APIs very difficult to use without a lot of insider knowledge. It's great that you all can agree as to where I should go for examples, but you have not clearly communicated to me where I can see these examples. This is the same as when I asked for javadocs. please be kinder to me, I can't read your minds or participate in your internal communication. Don't get me wrong, I appreciate all the help, but I am not making great progress on this side. With all of the quirkiness my company has experienced with iFS's Java APIs, we've decided to isolate and eliminate 80% of the extra methods provided. We are trying to wrap the remaining 20% into a highly reliable Interface & Implementation. The I/F is easy to define, but even just sifting through and using the ifs bean classes for implementation is proving difficult.
com.rsaiia.common.pdm.Folder aDir = testFileRepository.getRootFolder()
.getFolder("home")
.getFolder("jeffr")
.getFolder("SecondTest");
com.rsaiia.common.pdm.myDoc = aDir.createDocument("BungBucket.unc",
"UNCLASSIFIED_DOCUMENT",
new File("C:\\docs\\VersionTest.txt"));
public com.lmco.rsaiia.common.pdm.Document
createDocument(String theDocName, String theContentTypeName, File theFolderPath)
throws PDMException {
com.lmco.rsaiia.common.pdm.Document theDoc;
if (theDocName == null)
throw new NullPointerException("No Document Name");
if (theContentTypeName == null)
throw new NullPointerException("No ContentType Name");
if (theFolderPath == null)
throw new NullPointerException("No File Name");
String description = theDocName + " Description";
// The content (file to be contained in document) is associated in the
// createDocumentDefinition call
try{
DocumentDefinition def = createDocumentDefinition(theDocName, description,
theFolderPath, theContentTypeName);
def.setAddToFolderOption(myFolder);
// the more general variant of createDocument does the rest
theDoc = getDocument(createDocument(def));
theDoc.addAttribute(m_SOURCE_FILE_LOCATION_ATTRIBUTE); // should already be there but just in case
PublicObject aFileObject = myFolder.findPublicObjectByPath(theDocName);
Family aFamily = (Family)aFileObject;
myFileSystem.makeVersioned(aFileObject); // make all created files versioned
VersionSeries aVSeries = aFileObject.getFamily().getPrimaryVersionSeries();
VersionDescription aVersDesc = aVSeries.getLastVersionDescription();
System.out.println("Created Document " + theDocName + " In " + theFolderPath);
return theDoc;
catch (Exception e){
throw new PDMException(e);
* create a DocumentDefinition.
* @param docName the name of the new document
* @param classname the name of the classobject for the new document
* @param filePath a local file system path to content for
* this document
* @param parent the folder that will become the parent of the
* new document
* @return the created Document
* @exception IfsException if operation fails.
private DocumentDefinition createDocumentDefinition (String name,
String description, File filePath, String contentType)
throws IfsException {
if ( name == null )
throw new NullPointerException("Next time, offer a document name");
DocumentDefinition def = new DocumentDefinition(getSession());
def.setAttribute(oracle.ifs.beans.Document.NAME_ATTRIBUTE,
AttributeValue.newAttributeValue(name));
def.setAttribute(oracle.ifs.beans.Document.DESCRIPTION_ATTRIBUTE,
AttributeValue.newAttributeValue(description));
// Set the class only if it's specified
ClassObject co = (contentType == null)
? null : lookupClassObject(contentType);
if (co != null)
def.setClassObject(co);
// Set the content if specified
if (filePath != null)
applyContentSettings(def, filePath.toString());
return def;
Gets the file extension from the supplied file name and
uses this to infer the Format which is written to the supplied
document definition object
private void applyContentSettings(DocumentDefinition def, String filePath)
throws IfsException
if ((filePath != null) && (def != null))
String ext = null;
int pos = filePath.lastIndexOf(".");
if (pos > 0 && pos < filePath.length())
ext = filePath.substring(pos + 1);
if (ext == null)
// default to "txt"
ext = "txt";
// set the based on the extension from the filepath
Format fmt = lookupFormatByExtension(ext);
def.setFormat(fmt);
def.setContentPath(filePath);
* Creates a new folder in the directory specified by the oParentFolder input parameter
* @param Document a Oracle Document.
* @return PDMDocument
* @throws IfsException if operation fails.
private com.lmco.rsaiia.common.pdm.Document getDocument (oracle.ifs.beans.Document theDoc)
throws PDMException {
try{
return new PDMDocument(theDoc,getSession(),getFileSystem());
catch (Exception e){
throw new PDMException(e);
private oracle.ifs.beans.Document createDocument(DocumentDefinition def) // was public
throws IfsException {
oracle.ifs.beans.Document theDoc =
(oracle.ifs.beans.Document) getSession().createPublicObject(def);
return theDoc; -
Best Practice: Usage of the ABAP Packages Concept?
Hi SDN folks,
I've just started on a new project - I have significant ABAP development experience (15 years+) - but one thing that I have never seen used correctly is the Package concept in ABAP - for any of the projects that I have worked on.
I would like to define some best practices - about when we should create packages - and about how they should be structured.
My understanding of the package concept is that they allow you to bundle all of the related objects of a piece of development work together. In previous projects - and almost every project I have ever worked on - we just have packages ZBASIS, ZMM, ZSD, ZFI and so on. But this to me is a very crude usage of packages, and really it seems that we have not moved on passed the 4.6 usage of the old development class concept - and it means that packages do not really add much value.
I read in the SAP PRESS Next Generation ABAP book (Thomas Ljung, Rich Hellman) (I only have the 1st edition) - that we should use packages for defining separation of concern for an application. So it seems there they are recommending that for each and every application we write - we define at the least 3 packages - one for Model, one for Controller and one for view based objects. It occurs to me that following this approach will lead to a tremendous number of packages over the life cycle of an implementation, which could potentially lead to confusion - and so also add little value. Is this really the best practice approach? Has anyone tried this approach across a full blown implementation?
As we are starting a new implementation - we will be running with 7 EHP2 and I would really like to get the most out of the functionality that is provided. I wonder what others have for experience in the definition of packages.
One possible usage occurs to me that you could define the packages as a mirror image of the application business object class hierarchy (see below). But perhaps this is overcomplicating their usage - and would lead to issues later in terms of transportation conflicts etc.:
ZSD
|
ZSOrder ZDelivery ZBillingDoc
Does anyone have any good recommendations for the usage of the ABAP Package concept - from real life project experience?
All contributions are most welcome - although please refrain from sending links on how to create packages in SE80
Kind Regards,
JulianHi Julian,
I have struggled with the same questions you are addressing. On a previous project we tried to model based on packages, but during the course of the project we encountered some problems that grew overtime. The main problems were:
1. It is hard to enforce rules on package assignments
2. With multiple developers on the project and limited time we didn't have time to review package assignment
3. Devopelers would click away warnings that an object was already part of another project and just continue
4. After go-live the maintenance partner didn't care.
So, my experience is is that it is a nice feature, but only from a high level design point of view. In real life it will get messy and above all, it doesn't add much value to the development. On my neew assignment we are just working with packages based on functional area and that works just fine.
Roy -
I have created a custom search engine using the iFS search API. When I do a content search, it works fast (+/- 5 sec). When I do an attribute search (on title and description attribute), it also goes fast (+/- 3 sec). But when I want to combine the two, it goes really slow (+/- 30 sec). We have about 2500 documents inside are iFS repository. They have all been indexed. I don't know what I'm doing wrong. Can someone have a look at my code please?
AttributeQualification aqDescription = new AttributeQualification();
aqDescription.setAttribute("SOMEDOCUMENT", "DESCRIPTION");
aqDescription.setOperatorType(AttributeQualification.LIKE);
aqDescription.setValue("%" + newContent + "%");
aqDescription.setCaseIgnored(true);
AttributeQualification aqTitle = new AttributeQualification();
aqTitle.setAttribute("SOMEDOCUMENT", "DOCTITLE");
aqTitle.setOperatorType(AttributeQualification.LIKE);
aqTitle.setValue("%" + newContent + "%");
aqTitle.setCaseIgnored(true);
JoinQualification jq = new JoinQualification();
jq.setLeftAttribute("SomeDocument", "CONTENTOBJECT");
jq.setRightAttribute("CONTENTOBJECT", null);
ContextQualification cq = new ContextQualification();
cq.setQuery("search for ...");
SearchClause sc1 = new SearchClause(aqDescription,cq,SearchClause.OR);
SearchClause sc2 = new SearchClause(aqTitle,jq,SearchClause.OR);
scContent = new SearchClause( sc1, sc2, SearchClause.AND);
String [] sortClasses = new String[] {"SOMEDOCUMENT","SOMEDOCUMENT"};
String [] attNames = new String[] {"NAME", "NAME"};
boolean [] orders = new boolean[] {true, false};
SearchSortSpecification sortSpec = new SearchSortSpecification(sortClasses, attNames, orders);
ContextSearchSpecification cp = new ContextSearchSpecification();
cp.setContextClassname("CONTENTOBJECT");
cp.setSearchClassSpecification(new SearchClassSpecification(new String[]
{"SOMEDOCUMENT", "CONTENTOBJECT"}));
cp.setSearchQualification(sc);
cp.setSearchSortSpecification(sortSpec);
Search s = new Search(librarySession,cp);
s.open();
.....I have the same performace problems. The additional factor is I'm searching using 'custom' attributes and the performance is VERY BAD ...minutes not seconds with only a 5000 folders to query... Oracle suggested enabling InterMedia as the IFSSYS schema (indexing) would benefit but it makes no difference.
//getJnlFolderByJournalCode
public LibraryObject getJnlFolderByJournalCode(String journalCode) {
String CLASS_NAME = "EVSJNLFOLDER";
String JNLNAME_ATTRIBUTE = "EVSJNLNAME";
LibraryObject foundFolder = null;
try {
AttributeSearchSpecification searchSpec = new AttributeSearchSpecification();
SearchClassSpecification classSpec = new SearchClassSpecification();
classSpec.addSearchClass(CLASS_NAME);
classSpec.addResultClass(CLASS_NAME);
//Create Attribute Qualifications, ie. identifier searched for
AttributeQualification searchQual = new AttributeQualification();
searchQual.setAttribute(JNLNAME_ATTRIBUTE);
searchQual.setOperatorType(AttributeQualification.EQUAL);
AttributeValue evsJnlName = AttributeValue.newAttributeValue(journalCode);
searchQual.setValue(evsJnlName);
// Create Folder Restrictions Qualifications, ie start location
FolderRestrictQualification frq = new FolderRestrictQualification();
FolderPathResolver fpr = new FolderPathResolver(ifsSession);
fpr.setRootFolder();
Folder startFolder = (Folder) fpr.findPublicObjectByPath(evsRoot);
frq.setStartFolder(startFolder);
// Join attribute and Folder restrictions to create the Search clause
SearchClause sc = new SearchClause(searchQual, frq, SearchClause.AND);
// Set the SELECT statement and FROM statement of the search
searchSpec.setSearchClassSpecification(classSpec);
// Set the WHERE clause of the Search
searchSpec.setSearchQualification(sc);
Search search = new Search(ifsSession, searchSpec);
//OPEN search cursor
search.open();
SearchResultObject resObj = search.next();
if (resObj != null) {
foundFolder = resObj.getLibraryObject();
search.close();
} catch (IfsException ifse) {
//ifse.printStackTrace();
if (ifse.getErrorCode() != 22000) { //could not find folder specified
} else {
this.evsUtility.plsqlLog("getJnlFolderByJournalCode" + ifse.getMessage(),"ERROR_LOGFILE");
} catch (Exception e) {
e.printStackTrace();
this.evsUtility.plsqlLog("getJnlFolderByJournalCode" + e.getMessage(),"ERROR_LOGFILE");
finally {
return foundFolder;
}//getJnlFolderByJournalCode -
IFS-32656: Unable to get the FolderRestrictedQuery search clause
Hi!,
I have a new problem. I have created a portal with Oracle Portal and cmsdk to manage a set of documents. When I try to visualize documents on portlet my application failures. I receive this exception
06/08/28 15:33:56 oracle.ifs.common.IfsException: IFS-32656: Unable to get the FolderRestrictedQuery search clause
oracle.ifs.common.IfsException: IFS-32659: Error determining Folder Index level
java.sql.SQLException: Parametro IN o OUT mancante nell'indice:: 3
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:137)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:174)
at oracle.jdbc.driver.OraclePreparedStatement.processCompletedBindRow(OraclePreparedStatement.java:1552)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:2927)
at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:2973)
at oracle.ifs.server.FolderIndexService.isFolderAtMaplevel(FolderIndexService.java:1877)
at oracle.ifs.server.FolderIndexService.determineMapLevel(FolderIndexService.java:1842)
at oracle.ifs.server.FolderIndexService.getFrqInClause(FolderIndexService.java:890)
at oracle.ifs.server.FolderIndexService.getFrqClause(FolderIndexService.java:833)
at oracle.ifs.server.SQLGeneration_Helper.getFrqClause(SQLGeneration_Helper.java:907)
at oracle.ifs.search.toSQLVisitor.visitFRQualifier(toSQLVisitor.java:437)
at oracle.ifs.search.FolderRestrictQualification.accept(FolderRestrictQualification.java:393)
at oracle.ifs.search.toSQLVisitor.visitSearchClause(toSQLVisitor.java:546)
at oracle.ifs.search.SearchClause.accept(SearchClause.java:391)
at oracle.ifs.search.SQLGenerator.generateWhereClause(SQLGenerator.java:318)
at oracle.ifs.search.SQLGenerator.getSQLStatement(SQLGenerator.java:754)
at oracle.ifs.search.SQLGenerator.getSQLStatement(SQLGenerator.java:180)
at oracle.ifs.search.AttributeSearchSpecification.getSQLString(AttributeSearchSpecification.java:490)
at oracle.ifs.search.AttributeSearchSpecification.getSQL(AttributeSearchSpecification.java:457)
at oracle.ifs.search.SearchSpecification.getSQL(SearchSpecification.java:252)
at oracle.ifs.server.S_Search.open(S_Search.java:273)
at oracle.ifs.server.S_LibrarySession.DMOpenSearch(S_LibrarySession.java:6230)
at oracle.ifs.beans.LibrarySession.DMOpenSearch(LibrarySession.java:11328)
at oracle.ifs.beans.Search.open(Search.java:541)
at oracle.ifs.beans.Search.open(Search.java:500)
at oracle.ifs.beans.Search.open(Search.java:452)
Really this exception is launched only if I set in Oracle Portal a provider that points to an oc4j who runs on an application server 10.1.2.0.2 version (this is the version of application server installed on server machine). If I set a provider that points to oc4j on my pc every thing runs finally. The only difference between two machine is that on my pc is installed an application server 9.0.4.0.1 version. I suppose that this behaviour is caused by driver odbc, but I don’t know how can I resolve it. Can you help me to configure every thing correctly?
Thanks in advanceMake sure the searchbase is correct. Make sure to restart the identity server and web server (after selecting the 'Person' and 'Group' objectclasses, and before clicking on 'Next' ) during the Product Setup.
-
Attn: Installing the Sample Applications from the ifs Development Kit
There are a number of problems with the sample Applications included in the
Developer's kit. These need to manually fixed in order to get the demos to work.
#1: Solaris Only
The install of the iFS Development Kit, replaces the existing adk.jar with a new
one containing some additional classes. Unfortunately the install process does not
set the correct privileges on the new version of adk.jar. Please ensure that the
file $ORACLE_HOME/ifs/lib/adk.jar is world readable.
Bug # 1304730
This issue will be resolved on the next drop of the Oracle Internet File System
development kit.
#2: Generic
There is a problem with the way in which the login.jsp establishes a connection to
the repository. The current code makes incorrect assumptions about the name of the
iFS Service and the schema password.
The following changes are required.
In order to connect to the repository 4 pieces of information are required.
1. The iFS User Name
2. The iFS User's password
3. The properties file to be used
4. The database password of the user who owns the iFS Schema
The Login.jsp needs to be altered so that it requests these four arguments before
attempting to establish a connection to the repository.
(The current version only requests username and password).
All four arguments need to be provided as arguments to the login method on the
underlying JavaBean that the JSP invokes when it want to open a connection
to the repository.
***************** HERE IS THE REVISED CODE FOR INSURANCE APPLICATIONS ************
********************************** LOGIN.JSP *************************************
<%@ page import = "ifsdevkit.sampleapps.insurance.InsuranceLogin" %>
<%@ page import = "oracle.ifs.adk.security.IfsHttpLogin" %>
<html><head>
<jsp:useBean id="inslogin" scope="session" class="ifsdevkit.sampleapps.insurance.InsuranceLogin" />
<jsp:setProperty name="inslogin" property="*"/>
<%
String REDIRECT_PATH = "/public/examples/insuranceApp/claims";
boolean loggedIn = false;
if (inslogin.getSession() != null && inslogin.getResolver() != null)
// Use existing insurance login
loggedIn = true;
else
// No existing insurance login
IfsHttpLogin login = (IfsHttpLogin) request.getSession(true).getValue("IfsHttpLogin");
if (login != null && login.getSession() != null && login.getResolver() != null)
// Use existing IfsHttpLogin login
inslogin.init(login.getSession(), login.getResolver());
loggedIn = true;
if (!loggedIn)
String username = request.getParameter("username");
String password = request.getParameter("password");
String serviceName = request.getParameter("serviceName");
String schemaPassword = request.getParameter("schemaPassword");
if (username != null && password != null &&
!username.trim().equals("") && !password.trim().equals(""))
// Login using username/password
try
if (serviceName == null | | serviceName.trim().equals(""))
serviceName = "IfsDefault";
inslogin.init(username, password, serviceName, schemaPassword);
request.getSession(true).putValue("IfsHttpLogin", inslogin);
loggedIn = true;
catch (Exception e)
%>
<SCRIPT LANGUAGE="JavaScript1.2">
alert("The username or Password was not valid, please try again.");
</SCRIPT>
<%
if (loggedIn)
// Redirect to the directory where the claim files reside
response.sendRedirect(REDIRECT_PATH);
else
%>
<title>Insurance Demo App Login</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF">
<form METHOD=POST NAME="loginform" ACTION="login.jsp">
<table>
<tr>
<td><b>Username:</b></td>
<td><input type="text" name="username" value=""></td>
</tr>
<tr>
<td><b>Password:</b></td>
<td><input type="password" name="password" value=""></td>
& lt;/tr>
<tr>
<td><b>Service Name:</b></td>
<td><input type="text" name="serviceName" value="IfsDefault"></td>
</tr>
<tr>
<td><b>Schema Password:</b></td>
<td><input type="password" name="schemaPassword" value=""></td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td>
<input type="submit" value="Log in">
</td>
<td>
<input type="reset" value="Reset">
</td>
</tr>
</table>
</form>
</body>
</html>
<% } %>
*************************** END INSURANCE LOGIN.JSP ******************************
This code has been changed so that it requests the four agruments that are required
to connect to the repository and passes them to the login method on the underlying
bean. Note that we have provided the complete source code to this file in order to
make it simple to deploy the revised version of the code. Simply cut and paste this
code into a new file called login.jsp. Copy the File into the iFS
repository folder /ifs/jsp-bin/ifsdevkit/sampleapps/insurance.
****************************** INSURANCELOGIN.JAVA *******************************
package ifsdevkit.sampleapps.insurance;
* Copyright (c) 2000 Oracle Corporation. All rights reserved.
import java.util.Locale;
import javax.servlet.http.HttpSessionBindingEvent;
import oracle.ifs.beans.DirectoryUser;
import oracle.ifs.beans.FolderPathResolver;
import oracle.ifs.beans.LibrarySession;
import oracle.ifs.beans.LibraryService;
import oracle.ifs.common.CleartextCredential;
import oracle.ifs.common.ConnectOptions;
import oracle.ifs.common.IfsException;
import oracle.ifs.adk.security.IfsHttpLogin;
* The login bean for the Insurance demo app.
* <p>
* This class provide the login info. The class implements the
* <code>IfsHttpLogin</code> interface so it can share login data with other
* login beans.
* @author Edward Yu
* @version 1.0
* @see IfsHttpLogin
public class InsuranceLogin implements IfsHttpLogin
* The <code>LibrarySession</code>.
private LibrarySession m_session;
* The <code>FolderPathResolver</code>.
private FolderPathResolver m_resolver;
* Default constructor required by the jsp spec for the USEBEAN tag
* @exception IfsException
public InsuranceLogin()
throws IfsException
* Make a connection to iFS
* @param username The username to be used for login.
* @param password The password to be used for login.
* @param serviceName The service name to be used for login.
* @param schemaPassword The schema password to be used for login.
* @exception IfsException if operation failed.
public void init(String username, String password, String serviceName,
String schemaPassword)
throws IfsException
LibraryService service = new LibraryService();
CleartextCredential me = new CleartextCredential(username, password);
ConnectOptions connection = new ConnectOptions();
connection.setLocale(Locale.getDefault());
connection.setServiceName(serviceName);
connection.setServicePassword(schemaPassword);
m_session = service.connect(me, connection);
m_resolver = new FolderPathResolver(m_session);
m_resolver.setRootFolder();
DirectoryUser user = m_session.getDirectoryUser();
if (user.isAdminEnabled())
m_session.setAdministrationMode(true);
* Initialize the login bean.
* <p>
* The default constructor does not set the necessary fields so it needs
* to be set instantiation.
* @param session The <code>LibrarySession</code> object.
* @param resolver The <code>FolderPathResolver</code> object.
public void init(LibrarySession session, FolderPathResolver resolver)
m_session = session;
m_resolver = resolver;
* Return the login's session object.
* @return The <code>LibrarySession</code> object.
public LibrarySession getSession()
return m_session;
* Return the login's path resolver.
* @return The <code>FolderPathResolver</code> object.
public FolderPathResolver getResolver()
return m_resolver;
* Called when this object is bound to the HTTP session object.
* @param event The event when the object is bound to the Http session.
public void valueBound(HttpSessionBindingEvent event)
// do nothing
* Called when this object is unbound from the HTTP session object.
* @param event The event when the object is unbound to the Http session.
public void valueUnbound(HttpSessionBindingEvent event)
m_resolver = null;
try
if (m_session != null)
m_session.disconnect();
catch (IfsException e)
e.printStackTrace();
finally
m_session = null; // release the resources
*****************************END INSURANCELOGIN.JAVA ******************************
This code has been changed so that it accepts the four agruments that are required
to connect to the repository and uses them to connect to the repository. Note that
we have provided the complete source code to this file in order to make it simple
to deploy the revised version of the code. Simply cut and paste this
code into a new file called. Save the file on the native file system
in a file called InsuranceLogin.java in the directory
$ORACLE_HOME/ifs/ifsdevkit/sampleapps/insurance/
*************** HERE IS THE REVISED CODE FOR WEB COMMAND APPLICATIONS ************
********************************** LOGIN.JSP *************************************
<%@ page import = "ifsdevkit.sampleapps.webcommandapp.WebCommandLogin" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Author" content="Patricia Li">
<title>Login</title>
</head>
<jsp:useBean id="wclogin" scope="session" class="ifsdevkit.sampleapps.webcommandapp.WebCommandLogin" />
<jsp:setProperty name="wclogin" property="*"/>
<%
String REDIRECT_PATH = "/ifs/ifsdevkit/sampleapps/WebCommandApp/html/main.html";
boolean loggedIn = false;
if (wclogin.getSession() != null)
// Use existing WebCommand login
loggedIn = true;
else
String username = request.getParameter("username");
String password = request.getParameter("password");
String serviceName = request.getParameter("serviceName" );
String schemaPassword = request.getParameter("schemaPassword");
if (username != null && password != null)
// Login to iFS
try
wclogin.init(username, password, serviceName, schemaPassword);
request.getSession(true).putValue("IfsHttpLogin", wclogin);
loggedIn = true;
catch (Exception e)
%>
<SCRIPT LANGUAGE="JavaScript1.2">
alert("The credentials are not valid; please try again.");
</SCRIPT>
<%
if (loggedIn == true)
// Go to main page...
response.sendRedirect(REDIRECT_PATH);
else
%>
<title>Web Command App Login</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF">
<h2>WebCommand Application Login</h2>
<form METHOD=POST NAME="loginform" ACTION="login.jsp">
<table>
<tr>
<td><b>Username:</b></td>
<td><input type="text" name="username" value=""></td>
</tr>
<tr>
<td><b>Password:</b></td>
<td><input type="password" name="password" value=""></td>
</tr>
<tr>
<td><b>Service Name:</b></td>
<td><input type="text" name="serviceName" value="IfsDefault"></td>
</tr>
<tr>
<td><b>Schema Password:</b></td>
<td& gt;<input type="password" name="schemaPassword" value=""></td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td>
<input type="submit" value="Log in">
</td>
<td>
<input type="reset" value="Reset">
</td>
</tr>
</table>
</form>
</body>
</html>
<% } %>
************************* END WEB COMMAND LOGIN.JSP ******************************
This code has been changed so that it requests the four agruments that are required
to connect to the repository and passes them to the login method on the underlying
bean. Note that we have provided the complete source code to this file in order to
make it simple to deploy the revised version of the code. Simply cut and paste this
code into a new file called login.jsp. Copy the File into the iFS repository folder
/ifs/jsp-bin/ifsdevkit/sampleapps/WebCommandApp
****************************WEBCOMMANDLOGIN.JAVA**********************************
package ifsdevkit.sampleapps.webcommandapp;
import java.util.Locale;
import oracle.ifs.beans.DirectoryUser;
import oracle.ifs.beans.FolderPathResolver;
import oracle.ifs.beans.LibrarySession;
import oracle.ifs.beans.LibraryService;
import oracle.ifs.common.CleartextCredential;
import oracle.ifs.common.ConnectOptions;
import oracle.ifs.common.IfsException;
import oracle.ifs.adk.filesystem.IfsFileSystem;
import oracle.ifs.adk.security.IfsHttpLogin;
import javax.servlet.http.HttpSessionBindingEvent;
* WebCommand application that illustrates the usage of the
* File System API.
* @version 1.0
* @pub
public class WebCommandLogin implements IfsHttpLogin
private LibrarySession m_session; // Session
private FolderPathResolver m_resolver; // Resolver
private IfsFileSystem m_ifs; // File System object
* Default constructor required by the jsp spec for the USEBEAN tag
public WebCommandLogin()
throws IfsException
* Make a connection to iFS
* @pub
public void init(String username, String password, String serviceName,
String schemaPassword)
throws IfsException
LibraryService service = new LibraryService();
CleartextCredential cred = new CleartextCredential(username, password);
ConnectOptions options = new ConnectOptions();
options.setLocale(Locale.getDefault());
options.setServiceName(serviceName);
options.setServicePassword(schemaPassword);
m_session = service.connect(cred, options);
m_resolver = new FolderPathResolver(m_session);
m_resolver.setRootFolder();
m_ifs = new IfsFileSystem(m_session);
DirectoryUser user = (DirectoryUser) m_session.getDirectoryUser();
if (user.isAdminEnabled())
m_session.setAdministrationMode(true);
* Use the existing connection.
* The default constructor does not set the necessary fields.
* @pub
public void init(LibrarySession session, FolderPathResolver resolver)
throws IfsException
m_session = session;
m_resolver = resolver;
m_ifs = new IfsFileSystem(m_session);
* Return the login's session
* @pub
public LibrarySession getSession()
return m_session;
* Return the login's path resolver
* @pub
public FolderPathResolver getResolver()
return m_resolver;
* Return the IfsFileSystem API object
* @pub
public IfsFileSystem getIfsFileSystem()
return m_ifs;
* Implementation of valueBound
* @pub
public void valueBound(HttpSessionBindingEvent e)
* Implementation of valueUnbound
* @pub
public void valueUnbound(HttpSessionBindingEvent e)
try
m_session.disconnect();
catch (IfsException ie)
************************* END WEBCOMMANDLOGIN.JAVA *******************************
This code has been changed so that it accepts the four agruments that are required
to connect to the repository and uses them to connect to the repository. Note that
we have provided the comple te source code to this file in order to make it simple
to deploy the revised version of the code. Simply cut and paste this code into a
new file called WebCommandLogin.java in the directory
$ORACLE_HOME/ifs/ifsdevkit/sampleapps/webcommandapp/
Compile the java class.
Copy the classfile to $ORACLE_HOME/ifs/custom_classes/ifsdevkit/sampleapps/webcommandapp/
Stop and Start all of the protocol servers.
This issue will be resolved on the next drop of the Oracle Internet File System
development kit.
#3. Making the BaseRendererClass available to the Protocol Servers
Note this step is not required if you have the 1.0.8.3 patch set installed.
Install the BaseRenderer Class. The BaseRenderer class is delivered in the jar file
ifsdevkit.jar and can be used to simplify the task of creating a custom renderer.
Unfortunately the jar file containing this class is not referenced in any of the Classpaths
used by the iFS protocol servers. This means that they will not be able to load any
customer renderers that extend BaseRenderer. In order to make BaseRenderer available
to the Protocol Servers it need to be placed in the appropriate directory under
<ORACLE_HOME>/ifs/custom_classes.
Extract the class from the ifsdevkit.jar.
ifsdevkit.jar is located in <ORACLE_HOME>/ifs/lib after the devkit has been installed.
jar -xvf ifsdevkit.jar
extracted: META-INF/MANIFEST.MF
extracted: BaseRenderer.class
Create the following directory heirachy in <ORACLE_HOME>/ifs/custom classes
oracle/ifs/server/renderers
Copy <ORACLE_HOME>/ifs/lib/BaseRenderer.class to
<ORACLE_HOME/ifs/custom_classes/oracle/ifs/server/renderers
That should do it.
Regards
Mark D. Drake
nullMoving to Top
-
Reading sub folders in ifs using the ifs api
hi,
Is there any way i could get all the sub folders under the parent folders ,using the ifs api.
i am able to get the all the folders starting from the root ( parent folders) but i am unable to get the folders under each parent folder.
for example
at my root level i have folders x, y ,z etc..
and under x i have folders a,b,c etc.
i am able to get x,y,z but not able to get the sub folders under x i.e a, b,c folders etc.
Thanks
ArvindA much more elegant method would be to utilize the oracle.ifs.search package!
You will see in there a Folder Restrict Qualification.
You can set your search class to be Folder.CLASS_NAME
Matt. -
The search class below works. When I try to pass the String array
into a servlet using:
Searcher search_instance = new Searcher();
String[] servlet_array = search_instance.getRes();
it always fails. When I configure the class as a stand-alone
class (with the 'getRes' method called from a 'main' method. It
works. Also, when I tried to convert this code into a servlet,
it fails as well. I simply want to return search results to a
browser using a servlet or JSP. Has anyone solved a similiar
problem?
import oracle.ifs.beans.LibraryService;
import oracle.ifs.beans.LibrarySession;
import oracle.ifs.common.CleartextCredential;
import oracle.ifs.common.IfsException;
import oracle.ifs.beans.DirectoryUser;
import oracle.ifs.beans.PrimaryUserProfile;
import oracle.ifs.beans.PublicObject;
import oracle.ifs.beans.Document;
import oracle.ifs.beans.Folder;
import oracle.ifs.beans.ContentObject;
import oracle.ifs.beans.Search;
import oracle.ifs.beans.SearchResultObject;
import oracle.ifs.search.ContextSearchSpecification;
import oracle.ifs.search.SearchClassSpecification;
import oracle.ifs.search.SearchSortSpecification;
import oracle.ifs.search.SearchClause;
import oracle.ifs.search.SearchQualification;
import oracle.ifs.search.JoinQualification;
import oracle.ifs.search.FolderRestrictQualification;
import oracle.ifs.search.AttributeQualification;
import oracle.ifs.search.ContextQualification;
import oracle.ifs.common.AttributeValue;
public class Searcher extends Object {String[] results = new
String[100];
public String[] getRes(){
try {
LibraryService ifsService = LibraryService.startService
("ifsDefault", "ifssys");
CleartextCredential cred = new CleartextCredential
("bill","bill");
LibrarySession ifsSession = ifsService.connect(cred, null);
DirectoryUser thisUser = ifsSession.getUser();
String[] ctxClauseName = {"Test1"}; // order by SCORE
// set DESCENDING sort order
boolean [] sortOrders = {false};
SearchSortSpecification sortSpec =
new SearchSortSpecification(new String[] {"DOCUMENT"},
new String[]
{ContextQualification.ORDER_PREFIX + "." +
ctxClauseName[0]},
sortOrders);
// create a query expression using interMedia Text query
syntax
String searchWord1 = "Clareos";
String searchWord2 = "cart";
String queryOperator = " & ";
//String queryExpr = searchWord1 + queryOperator +
searchWord2;
String queryExpr = searchWord1 ;
// create a ContextQualification and specify the query
expression
ContextQualification cq = new ContextQualification();
cq.setQuery( "?" );
cq.setName(ctxClauseName[0]);
// now join with CONTENTOBJECT
JoinQualification jq = new JoinQualification();
jq.setLeftAttribute("DOCUMENT", "CONTENTOBJECT");
jq.setRightAttribute("CONTENTOBJECT", null);
SearchClause sc = new SearchClause( cq, jq,
SearchClause.AND );
ContextSearchSpecification cp = new
ContextSearchSpecification();
cp.setContextClassname("CONTENTOBJECT");
cp.setSearchClassSpecification(new SearchClassSpecification
(new String[]
{"DOCUMENT", "CONTENTOBJECT"}));
cp.setSearchQualification(sc);
cp.setSearchSortSpecification(sortSpec);
Search s = new Search(ifsSession, cp);
AttributeValue[] bindValue = new AttributeValue[1];
bindValue[0] = AttributeValue.newAttributeValue( queryExpr );
int y=0;
s.open(bindValue);
while (y<results.length){
results[y]= s.next().getLibraryObject().getName();
System.out.println(results[y]);
y++;
s.close();ifsSession.disconnect();} catch (IfsException e){}
return results;}
}Hi,
Please try to use the following query text.
(CONTAINS(PlacesId, 'a2ce9dd7-f801-4403-affb-1944bf253255') OR (PlacesId > ''))
Here are two materials for you to take a look at:
http://blog.mastykarz.nl/excluding-empty-text-values-sharepoint-search/
http://social.msdn.microsoft.com/Forums/sharepoint/en-US/2ad1963f-f6e5-4c01-8826-444a6ba8de40/fulltextsqlquery-for-null-value?forum=sharepointdevelopmentprevious
Thanks,
Dennis Guo
TechNet Community Support
Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
[email protected]
Dennis Guo
TechNet Community Support -
The javadoc states that "The user can also specify the Media on which the Text Queries are to be performed".
How ?
The Media[] argument of this method is not documented and there seems to be no constructor for the class either.
I want to make a context query on content in one class + on description (or also content if that were impossible) in another class.Tom
This allows a content search on description.
It uses the FreeForm SQL ability. It gets the score for the search of the related Content. I'm not sure if I can get the score for the description search.
// $Header$
// Copyright (c) 2000 Oracle Corporation
package ifs.pm.examples.search;
import ifs.pm.common.application.*;
import oracle.ifs.beans.LibrarySession;
import oracle.ifs.beans.PublicObject;
import oracle.ifs.beans.Document;
import oracle.ifs.beans.ContentObject;
import oracle.ifs.common.IfsException;
import oracle.ifs.beans.Search;
import oracle.ifs.beans.SearchResultObject;
import java.io.BufferedReader;
import java.io.IOException;
import oracle.ifs.search.*;
* A Class class.
* <P>
* @author Mark D. Drake
* Please complete these missing tags
* @rref
* @copyright
* @concurrency
* @see
public class ExtendedContentSearch extends BaseTestHarness
* Constructor
* Please complete the missing tags for ContentSearch
* @param
* @return
* @throws
* @pre
* @post
public ExtendedContentSearch()
* Please complete the missing tags for doSomething
* @param
* @return
* @throws
* @pre
* @post
public void doSomething( LibrarySession ifs )
throws IfsException
ifs.setAdministrationMode(true);
SearchSpecification searchSpecification = buildSearch( Document.CLASS_NAME, "doc", "zydeco" );
Search search = new Search( ifs, searchSpecification );
search.open();
SearchResultObject [] results = search.getItems();
search.close();
if( results != null )
System.out.println("The number of object found is " + results.length);
for( int i = 0; i < results.length; i++ )
SearchResultObject sro = results [ i ];
Document doc = ( Document ) sro.getLibraryObject( Document.CLASS_NAME );
System.out.println( "Document : " + doc.getName() + " Score (query1) = " + sro.getScore("query1"));
doc.filterContent( false );
BufferedReader reader = new BufferedReader( doc.getFilteredContent() );
try
for( String nextLine = reader.readLine();
nextLine != null;
nextLine = reader.readLine() )
System.out.println( nextLine );
catch( IOException ioe )
throw new IfsException( 9999, ioe );
else
System.out.println("No Results Found");
* Please complete the missing tags for buildSearch
* @param
* @return
* @throws
* @pre
* @post
public SearchSpecification buildSearch( String className, String fileExtension, String phrase )
throws IfsException
// Document.DescriptionAttribute contains 'phrase';
AttributeQualification aq1 = new AttributeQualification();
aq1.setAttribute( Document.CLASS_NAME, PublicObject.NAME_ATTRIBUTE );
aq1.setOperatorType( AttributeQualification.LIKE );
aq1.setCaseIgnored( true );
aq1.setValue( "%doc" );
// Document.ContentObject = ContentObject.ID
JoinQualification jq1 = new JoinQualification();
jq1.setLeftAttribute( className, Document.CONTENTOBJECT_ATTRIBUTE );
jq1.setRightAttribute( ContentObject.CLASS_NAME, null );
// Combine the Attribute and Join Qualifications
SearchClause searchClause = new SearchClause( aq1, jq1, SearchClause.AND );
// Create the Content Query 'Document Body contains phrase...' and add it in.
String queryName = "query1";
ContextQualification contentClause = new ContextQualification();
contentClause.setQuery( phrase );
contentClause.setName( queryName );
searchClause = new SearchClause( searchClause, contentClause, SearchClause.AND );
// Add in the FreeForm Search....
FreeFormQualification fq1 = new FreeFormQualification();
fq1.setSqlExpression("contains(description,'Temporary',2) > 0");
searchClause = new SearchClause( searchClause, fq1, SearchClause.AND);
// Set up the Search Class Spec.
SearchClassSpecification scs = new SearchClassSpecification();
// Add in the Class for the Where Clause
String [] searchClasses = new String []
className,
ContentObject.CLASS_NAME
scs.addSearchClasses( searchClasses );
// Add in the Class for the Select Clause
scs.addResultClass( className );
// Define the Order by Clause
// The List of Classes for the Order Clause
String [] classNames = new String []
ContentObject.CLASS_NAME
// The List of Attibutes for the Order Clause.
String [] attributes = new String []
ContextQualification.ORDER_PREFIX + "." + queryName
// The Ordering for the Attributes in the Order Clause
boolean [] sortOrder = new boolean []
false
SearchSortSpecification sss = new SearchSortSpecification( classNames, attributes, sortOrder );
// AttributeSearchSpecification searchSpec = new AttributeSearchSpecification();
ContextSearchSpecification searchSpec = new ContextSearchSpecification();
searchSpec.setContextClassname( ContentObject.CLASS_NAME );
// Set the SELECT statement and FROM statement of the search
searchSpec.setSearchClassSpecification( scs );
// Set the WHERE clause of the Search
searchSpec.setSearchQualification( searchClause );
// Set the ORDER by clause of the search
searchSpec.setSearchSortSpecification( sss );
return searchSpec;
* main
* @param args
* Please complete the missing tags for main
* @return
* @throws
* @pre
* @post
public static void main( String [] args )
ExtendedContentSearch contentSearch = new ExtendedContentSearch();
contentSearch.run();
null -
Comparing the BOM usage with the actual usage for materials.
Hi All
My client want to compare the BOM usage with the actual usage and have a report for this within a period? More specified they want to calculate the BOM usage, based on the requirement quantity from confirmation - but with out the scrap %. mulitplied with the confimed quantity of the header material.
The actual usage should be based on goods issuing from stock, either as goods issue to order (backflushing) or as goods issue to cost center.
I havent been able to indentiy a standard report for doing this - does some of you know a standard report?
- I was thinking of the following method:
Look at tabel RESB and compare it with MSEG, but I have some diferent problems with this.
- In resb there is no qty before scrap.
- The data amount from MSEG, is so huge so it is not possible to make a data search for a whole period (eg. month)
Br. MThere is one std report MCRX which gives a comparison of quanity in order and actual consumption,
if it doesnt meet your need, you may have to create a custom report.
logic can be find the quantites as per BOM for the produced quantities
issued quantities to the order
tables you may need are AUFK AUFM
AFKO, STAS STPO
MSEG, MKPO
JEST ( if you want to filter using order status) -
How to Change the default Search value for Field Role?
HI,
I went through numerous threads on how to default the search value , but does not help for my issue. Hence im posting this new thread. Please provide your suggestions on how to achieve this.
For the Ship-to party field (in item detail ) on webui when i do a F4 help i get the pop up with various search criteria and for the field Role the default value is "Ship-to party". which is visible. we need to change this default value to Prospect which is available in drop down.
The attribute is STRUCT.ROLE and view BP_HEAD_SEARCH/SearchHelp . The method GET_DQUERY_VALUEHELPS from the context node class is called to fill the value help for this attribute, but i dont understand how the ship-to party is filled as default. There is no code in this method to default the value.
The generic GET_V_S_STRUCT method also does not default the Ship-to party on this field.
I want to understand how this Ship-to party is filled by default and how can i change this to prospect..
Many Thanks,
ShaikWe had a same requirement of defaulting Sales org and division in search criteria for a specific value.
this can be doen by redefining "DO_PREPARE_OUTPUT" method in IMPL class for the respective view.
See the code:
METHOD do_prepare_output.
*CALL METHOD SUPER->DO_PREPARE_OUTPUT
** EXPORTING
** iv_first_time = ABAP_FALSE
DATA:
lr_qs TYPE REF TO cl_crm_bol_dquery_service.
* Get current query object
lr_qs ?= me->typed_context->search->collection_wrapper->get_current( ).
IF iv_first_time = abap_true.
lr_qs->clear_selection_param_values( ).
lr_qs->delete_empty_selection_params( ).
* if l_sales_orgs is initial.
CALL METHOD lr_qs->insert_selection_param
EXPORTING
iv_index = '1'
iv_attr_name = 'SALES_ORG'
iv_sign = ' '
iv_option = 'EQ'
iv_low = 'O 50000514'.
* endif.
* if l_dist_chan is initial.
CALL METHOD lr_qs->insert_selection_param
EXPORTING
iv_index = '2'
iv_attr_name = 'DISTR_CHAN'
iv_sign = ' '
iv_option = 'EQ'
iv_low = '01'.
* endif.
Hope this will help..
THanks & Regards,
Amit -
How to enhance the standard search with custom field?
Hi all,
I would like to know the general optimal procedure to enhance the standard searches like Opportunity search or Lead search.
I've gone through some of the threads here. Some suggest, to add the new field using AET and copy the IMPL class of the search and then code the custom logic. Some say, append the new field to the structure of the search object and then implement the BADI.
I'm actually a bit confused to understand the correct procedure.
Can someone please help me with a generic procedure to enhance the standard search with a custom field?
Thanks in advance.Hi Maren,
Once I have got the same development. I have followed the below steps, please check with this. Let me know for further inputs.
Add new field using Append structure of type ‘XXX’ in search
Create BADI implementation for Enhancement spot ‘ES_CRM_RF_Q1O_SEARCH’ and include filter ‘BTQOPP’
Put your logic in BADI implementation – SEARCH method
Add it in WebUI configuration
Remove the operator if required
Regards,
Swadini Sujanaranjan -
Search help for Web Dynpro using the SAP-search help
Hi,
Im trying to create a generic search help for Web Dynpro using the SAP-search help. It should working so, that I construct a Web Dynpro-component, that gets the data of the search help from the SAP-system, interpreted it and creates the ui-elements and the needed context generic.
The mapping between the Input field of the customerview and the right search help is to be made with an xml-file, which contains the information: name of the view, the input field, the search-help-name and the name of the field that will be returned.
The xml-file is reading from a helper-class. That helper-class contains any information, witch need the search help-component as well as the customer-component.
The initialization takes place in the method wdDoModify of the customer. The call of the search help from the customer should be implement with an Action, witch is bound to a Button(create dynamic in the helper-class behind the input field).
In a second foot should be create a plugin for eclipse, witch insert the used files (search help component, helper class, ) in the project. In addition it should create the call in the customer generic.
It would be great if someone can give me a feedback!Hi Mike,
The BlanketAgreement.exe is a reference to the executable that will be created when you compile the solution you created in Part II - Part III. I think there is a mistake in the tutorial because it asks you to name the project 'Blanket' which means that by default the executable will be called Blanket.exe and not BlanketAgreement.exe. The tutorial also misses the step asking you to compile the Blanket project before you go on to create an installer. You should compile your Blanket project in Release mode before creating an installer. By compiling the project you'll get a Blanket.exe file in the bin folder of your Blanket project which you then need to add to the installer per the instructions.
SAP do offer development courses in some areas and there is training material here on the SDN and on the SAP partner portal (and maybe the customer portal as well). Try searching this forum for 'training' or 'tutorial' and you should get a few links. There's also a development certification.
Personally I'd recommend you give yourself a little project to work on and just get stuck in
Kind Regards,
Owen -
Getting versioned and unversioned docs in the same search
Hi folks,
I want to do the following search:
Get all unversioned documents and all versions of versioned documents that meet an specific criteria (attribute or content qualification) and that are in an specific folder (the document itself or its family object).
For instance, I have the following PublicObjects in folder /public/test (consider "attr" is any attribute):
* DocA.txt - document - attr = 'X'
* DocB.txt - document - attr = 'Y'
* DocC.txt - family
- DocC.txt version 1 - document - attr = 'X'
- DocC.txt version 2 - document - attr = 'Y'
I want to build a search that returns every doc in this folder where attr = 'X'. It should return docA.txt and DocC.txt version 1.
I tried a lot of things, I don't think it would be useful to relate all I did. I think my problem is in the fact that the family object is foldered, not the document itself, and I want to find unversioned documents too in the same search. How would you do the search?
Thanks a lot.
Daniel.I managed to do it through the following code:
SearchClassSpecification scp = new SearchClassSpecification();
scp.addSearchClass(PublicObject.CLASS_NAME, "PO");
scp.addSearchClass(Document.CLASS_NAME, "DOC");
scp.addResultClass("DOC");
FolderRestrictQualification frq = new FolderRestrictQualification();
Folder f = session.getRootFolder();
frq.setMultiLevel(true);
frq.setStartFolder(f);
frq.setSearchClassname("PO");
JoinQualification jqFolder1 = new JoinQualification();
jqFolder1.setLeftAttribute("PO", null);
jqFolder1.setRightAttribute("DOC", Document.FAMILY_ATTRIBUTE);
JoinQualification jqFolder2 = new JoinQualification();
jqFolder2.setLeftAttribute("PO", null);
jqFolder2.setRightAttribute("DOC", null);
SearchClause scJoinFolder = new SearchClause();
scJoinFolder.setLeftSearchQualification(jqFolder1);
scJoinFolder.setRightSearchQualification(jqFolder2);
scJoinFolder.setOperatorType(SearchClause.OR);
SearchClause scFolder = new SearchClause();
scFolder.setLeftSearchQualification(frq);
scFolder.setRightSearchQualification(scJoinFolder);
scFolder.setOperatorType(SearchClause.AND);
(following the AttributeQualification, etc...)
The issue is that I was trying to use Family instead of PublicObject. I did a lot of crazy things, including an outter-join between Document and Family. It worked for admin users, but not for common users, because iFS adds some access control clauses in the SQL query that did not take into account my outter-join.
Now it looks much simpler and elegant. And works for all users. :-)
Thanks.
Maybe you are looking for
-
Windows 8.1 BSOD on Install
Hi All. 8.1 has been released today and I was keen to get updated. I must stress this is not the Preview Release Clean install of Windows 8 Pro a couple of days ago, setting up with my Microsoft Account. Successfully downloaded from store and set's o
-
Business Objects on Virtual Machines
Hi, We are setting up new servers for our Business Objects to accomodate the DEV/TEST and PROD environments. Can we use Virtual Machines (VM Servers) for both the DEV/TEST and PROD environments? Thanks.
-
"New" Godaddy webhosting account's won't work w/Dreamweaver CS3
Hello, I am having problems getting my Godaddy webhosting account's to work with Dreamweaver CS3. My older accounts work, it is my newer (last 6 months) accounts that have this issue. The ftp information works in my CuteFTP8 Professional. I called Go
-
Including Bean-Property in Database-Binding
Hello, I'm testing SJSC and right now I'm testing the Database-Bindings. I was successfull in integrating the MySQL JDBC-driver and creating JNDI-Ressource, JDBC-Ressource and Connection-Pool (I have several "RaveGenerated entrys but this problem wil
-
HP pro 3500 mt i have downloaded th sound drivers but still sound is not working
right click "my computer"click "manage"click "device manager"click "sound,video and game controller open(audio codes,legacy audio driver,legacy video capture device,media control devices,video codes. i can choose any of them it shows this device is w