Search Example Code inside for Versioned and non-Versioned Documents

These may be of use to someone...
File names:
AttributeSearch.java
AttributeContentSearch.java
The AttributeSearch application will search for documents (both versioned and non-versioned) with a file name containing "txt", residing in the user "system"'s home directory.
The AttributeContentSearch application will search for documents (both versioned and non-versioned) with a file name containing "txt", and document content containing the word "hello", residing in the user "system"'s home directory.

import oracle.ifs.beans.LibraryService;
import oracle.ifs.beans.LibrarySession;
import oracle.ifs.common.CleartextCredential;
import oracle.ifs.common.ConnectOptions;
import oracle.ifs.common.IfsException;
import java.util.Locale;
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;
// SEARCH RESULT
import oracle.ifs.beans.SearchResultObject;
// CONTENT + ATTRIBUTE SEARCH
import oracle.ifs.search.ContextSearchSpecification;
// SELECT, FROM
import oracle.ifs.search.SearchClassSpecification;
// ORDER BY
import oracle.ifs.search.SearchSortSpecification;
// WHERE
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;
public class AttributeContentSearch
public static void main(String args[])
try {
LibraryService ifsService = new LibraryService();
System.out.println("Oracle iFS Version " + ifsService.getVersionString());
CleartextCredential credentials = new CleartextCredential("system","manager");
ConnectOptions options = new ConnectOptions();
options.setLocale(Locale.getDefault());
options.setServiceName("ServerManager");
options.setServicePassword("ifssys");
LibrarySession ifsSession = ifsService.connect(credentials,options);
DirectoryUser thisUser = ifsSession.getUser();
System.out.println("Connected as \"" + thisUser.getDistinguishedName() + (thisUser.isAdminEnabled() ? "\" (admin enabled)" : "\""));
PrimaryUserProfile userProfile = thisUser.getPrimaryUserProfile();
SearchResultObject[] sro = runSearch (ifsSession,"hello");
if (sro != null)
for (int i = 0; i < sro.length; i++)
System.out.print (((PublicObject)sro.getLibraryObject()).getName());
System.out.println (" (" + ((PublicObject)sro[i].getLibraryObject()).getId() + ")");
} catch (IfsException e)
public static SearchResultObject [] runSearch( LibrarySession ifsSession, String searchCriteria) throws IfsException
ContextSearchSpecification ss = null;
SearchClassSpecification scs = new SearchClassSpecification();
SearchSortSpecification sss = new SearchSortSpecification();
SearchQualification sc = null;
ss = new ContextSearchSpecification();
ss.setContextClassname(ContentObject.CLASS_NAME);
scs.addSearchClass( PublicObject.CLASS_NAME );
scs.addSearchClass( Document.CLASS_NAME );
scs.addSearchClass( ContentObject.CLASS_NAME );
scs.addResultClass( Document.CLASS_NAME );
sss.add( Document.CLASS_NAME, "NAME", true );
sc = buildSearchClause( ifsSession, searchCriteria);
ss.setSearchClassSpecification( scs );
ss.setSearchQualification( sc );
ss.setSearchSortSpecification( sss );
Search s = new Search( ifsSession, ss );
s.open();
SearchResultObject [] sro = s.getItems();
s.close();
return sro;
public static SearchQualification buildSearchClause( LibrarySession ifsSession, String searchCriteria ) throws IfsException
Folder f = ifsSession.getUser().getPrimaryUserProfile().getHomeFolder();
FolderRestrictQualification frq = new FolderRestrictQualification();
frq.setStartFolder( f );
frq.setSearchClassname(PublicObject.CLASS_NAME);
AttributeQualification aq = new AttributeQualification();
aq.setAttribute(Document.CLASS_NAME, PublicObject.NAME_ATTRIBUTE);
aq.setOperatorType(AttributeQualification.LIKE);
aq.setValue("%txt%");
ContextQualification cq = new ContextQualification();
cq.setQuery(searchCriteria);
cq.setName("Test0");
JoinQualification jq1 = new JoinQualification();
jq1.setLeftAttribute ( Document.CLASS_NAME, Document.CONTENTOBJECT_ATTRIBUTE );
jq1.setRightAttribute( ContentObject.CLASS_NAME, null);
JoinQualification jq = new JoinQualificatio n();
jq.setLeftAttribute ( PublicObject.CLASS_NAME, PublicObject.RESOLVEDPUBLICOBJECT_ATTRIBUTE );
jq.setRightAttribute( Document.CLASS_NAME, null);
SearchClause sc;
sc = new SearchClause(jq, jq1, SearchClause.AND);
sc = new SearchClause(sc, cq, SearchClause.AND);
sc = new SearchClause(sc, frq, SearchClause.AND);
sc = new SearchClause(sc, aq, SearchClause.AND);
return sc;
null

Similar Messages

  • Whenever I go to iTunes with my iPod 5th generation 32 gb iPod Touch, running iOS 8.0.2, It tells me that the "Other" category is using up 14.59 gb of data. I have no clue why it says this and I have searched the internet for fixes and none worked.

    Whenever I go to iTunes with my iPod 5th generation 32 gb iPod Touch, running iOS 8.0.2, It tells me that the "Other" category is using up 14.59 gb of data. I have no clue why it says this and I have searched the internet for fixes and none worked. I have tried on a windows and a mac and noticed no change. I have tried restoring to a backup but that didn't help. I haven't had time to do a full restore but I will try if the problem persists.

    An "other" larger than about 1 1/2 GB indicates corrupted files.
    What is the Other on my iPhone and How to Remove It
    What is "Other" and What Can I Do About It?
    Next, usually restoring from backup eliminated the corrupted files. However, sometimes restoring to factory settings/new iPod is required.
    To restore from backup see:
    iOS: How to back up
    To restore to factory settings/new iPod see:
    iTunes: Restoring iOS software

  • Development of Form for Returnable and Non-returnable material Gate pass

    Dear Experts,
    I am working with an Indian client impementing SAP PM. I need help in developing a form for Returnable and Non Returnable Gatepass. Requirements are below;
    RGP/NRGP should be made for all materials going out of the factory, irrespective of it being coded or not
    It should be plant specific
    It should have reference to material movement document for tracking purpose
    It should have details of vendor, transport company, vehicle number, permits if required, etc
    A Z report should give details of all RGP/NRGP based on material document number and date
    Please guide me based on your experience.
    Thanks,
    Boby

    Boby,
    This can be met. But before developing this, have you implemented the refurbishment process of PM module? This will really help in tracking the equipment and also for the development of RGP/NRGP.
    First you have to create a form for the gate pass  and have to create an enhancement in MIGO for triggering the RGP/NRGP, else you can also create a separate Z transaction code for printing the Gate pass. You will get all the fields like vendor, material, QTY, movement type from the MIGO GI document. 
    For the gate pass the MIGO document will be the reference all the times, you can also develop a Z report for the records for the gate pass.
    Regards,
    Praveen

  • Material Design for bonded and non-bonded warehouse

    In some countries the materials put in bonded and non-bonded warehouse are treated differently, for example the cost, shipment, trace of the material.
    In general, there are two designs. One is "Only One Material Number", and the other is "Two material numbers".
    Which design you used?
    My client is in China.

    One material to extend it to two different plant, using evaluation class to diff the cost.
    cons are
    a. complex cost accounting for surcharge and freight distributed to material, not necessary for bonded-inventory
    b. MRP will combine the PR for bonded and non-bonded.
    two material ID
    solves the previous problem.
    cons are
    a. one material have two id, makes little sense
    b. big number of material, high volumn of data maintenance

  • Is marvel the code name for the next Portal version?

    I played around a bit in Marvel and I notice similar functionality in Portal.
    Is marvel the code name for the next Portal version?

    actually, joep, project marvel differs from portal in several respects. primarily, though, oracle portal is geared more towards content management whereas project marvel focuses more on application development.

  • Report for Excisable and Non Excisable vendor

    Hello
    Is there any Std report is there....it can give us the list of Excisable and Non excisable Vendors based on the Perticular Purchase Orgnisation.
    Regards
    sapman man

    Hi
    I do not think in SAP this kind of report is available.
    what you can do , if your vendor master has different  accounting group for Excisable and Non excisable vendor then you can check in standard table of vendor master like LFA1  and LFM1 or create Z report or Query.
    Awaiting your feedback.
    Kishor Rudani

  • Safari will no longer open.  I was using firefox until I could find a fix for safari.  I made the mistake of changing my default search to firebox later for convenience and now I can't open my system preference or many safari or apple linked files.

    Safari will no longer open. It just goes back to my desktop.  When I right click on the safari icon in my dashboard it says it is open.  I was using firefox until I could find a fix for safari.  I made the mistake of changing my default search to firebox later for convenience and now I can't open my system preference or many safari or apple linked files. Some of my emails from trusted sites won't open and does the same thing. 
    I upgraded my original system from 10.4.11 to I believe 10.6. something about a year or so ago.  I thought about re installing my safari app but when I go to open anything connected to safari my screen goes back to the desktop.  I cant open any files that I have on my desktop that I set up through safari, like my banking program. Prior to changing system preference to safari default I was able to open those files and now I can't get into change it back.  Can you guide me through this?
    Thanks,
    Betty

    Try running the 10.6.8 combo update.
    10.6.8 Combo Updater
    System Preferences or Safari Preferences?
    Do a backup.
    Quit the application.
    Go to Finder and select your user/home folder. Select Library. Then go to Preferences/com.apple.Safari.plist. Move the .plist to your desktop.
    Restart the computer, open the application and test. If it works okay, delete the plist from the desktop.
    If the application is the same, return the .plist to where you got it from, overwriting the newer one.

  • Invoice Posting using INVOIC02 Idoc for PO and Non-Po based invoices

    Hi All,
      We have a problem regarding posting Invoices using Idocs.
    We have po and non-po invoices coming frm thirdparty in the form of idoc files.
    We need a clarification whether Invoic02 idoc can handle both Po and Non Po Based invoices or threre are seperate idoc types or message types for Po and Non Po Invoices.
    Could any one give some inputs on Partner Profiles also for this senario.
    Please kindly reply as early as possible.
    Regards
    Anil Kumar K

    Hi
      I Got your name from this site.I would be very thankful if you can help me here.I am designing a EDI based invoice LIV.Is it possible to post some charges which are without PO reference but are coming in Vendor Invoices.Is it possible to post these kind of charges with EDI message INOIC01 or we have to post through FI posting.If possible through EDI in which segment of IDOC we will enter these charges with amt.Also is it possible to post credit memo also with EDI
    Thanks
    Sanjeev

  • Different segment in same document for leading and non-leading ledger

    Hi,
    Is it possible to have different segments derived in the same document for Leading and Non-leading ledgers.
    Is there an exit where we can substitute the segment originally derived so as to update only in one particular ledger
    Please suggest.

    Thanks Alex for your response.
    But would it be possible to update the segment only in one ledger, the other one carrying the default values coming from profit center?

  • USB sync cable different for CDMA and GSM version phones?

    I recently ordered a USB sync cable for Iphone 4S from ebay. I want to know whether the USB sync cable for Iphone 4S is different for CDMA and GSM version phones? And if they are then what are the likely consequences if they are interchanged and used inadvertantly.

    All recent iDevices use the same type of connector/cable.
    Stedman

  • Wanting to deactivate PS Elements on Mac and transfer program to a friend. Is it OK to download a trial to my friend's Mac and use my serial number.  Also is the serial number the same for Mac and Win versions?  Many thanks.

    Wanting to deactivate PS Elements on Mac and transfer program to a friend. Is it OK to download a trial to my friend's Mac and use my serial number.  Also is the serial number the same for Mac and Win versions?  Many thanks.

    Yes it should work transferring PSE10 from Mac to Mac. There is a download link below for PSE10, which your friend could use. There is a formal licence transfer process but it’s not necessary for your friend to register the product (activation is sufficient) although he couldn’t benefit from future upgrade pricing without registration. Serial numbers typically can only be registered one time.
    Boxed versions of PSE are normally multi-platform with disks for both Windows and Mac; so the serial number is the same. Downloads have tended to be single platform only although I believe the current version PSE12 will work on both Windows and Mac with the same serial number – boxed or download.
    http://helpx.adobe.com/photoshop-elements/kb/photoshop-elements-10-11-downloads.html

  • What difference on ABAP language between 2004 version and before version

    Hi everyone,
    Does there exist difference about ABAP language between 2004 version and before version? If it does, what's that? For example, what's new keywords? Which old key words can't be applied on 2004 platform any more?
    Any suggestion is highly appreciated.
    Best Regards,
    Julian

    hi
    good
    to get all these details plz visit the SAP site where you ll get the release notes related to all the concepts.
    Thanks
    mrutyun^

  • Difference between Planning Version and Simulation Version

    Hi friends,
    What is the difference between Planning Version and Simulation Version?
    Thanks,
    Debi

    Debi
    There are a lot of threads in this forum that give detailed info about version concept. Also you can refer to help.sap.
    Anyways , planning version is the version against which your live cache data is stored.  The data against this version is the one that the planners and buyers are going to refer to or use to make their planning and buying decisions. Data against the planning version is nothing but data relevant to the business .
    There may be instances where you would like to simulate some scenario. If you want to do trial and error analysis and at the same time if you do not want to impact the actual business data , then you create simulation versions and simulate your scenario.
    For example your actual sales orders received for the month of March may be 100 CS. This is the actual number that will be stored against your planning version. Lets say the demand planner wants to find out what will be the impact if there is a sudden bulk demand from a new customer for 500 CS - that is if he wants to do a what - if analysis then he can create a simulation version and try to check the impact .
    Thanks
    Aparna

  • The product version and database version are not compatible

    The following simple program gets an exception {The product version and database version are not compatible} its very hard to proceed from here. Does anybody know what cause this?  
    Best Regards
    Jan Isacsson
    using System.Collections.ObjectModel;
    using Microsoft.MasterDataServices.Deployment;
    using Microsoft.MasterDataServices.Services.DataContracts;
    namespace MdsDeploy
        class Program
            static void Main(string[] args)
                try
                    ModelReader reader = new ModelReader();
                    Collection<Identifier> models = reader.GetModels();
                    foreach (Identifier modelId in models)
                        Console.WriteLine(modelId.Name);
                catch (System.Exception ex)
                    Console.WriteLine("Error: " + ex.Message);
                Console.ReadKey();

    Hi Jan,
    For the error "The product version and database version are not compatible", as Emma said, the version number of the Service does not match the database schema version.
    In your scenario, which version of database are you using? Please note that MDS update required after SQL 2012 SP1 installation, please refer to the links below to see the details.
    http://byobi.com/blog/2012/11/mds-update-required-after-sql-2012-sp1-installation/
    http://msdn.microsoft.com/en-IN/library/gg488708.aspx
    Regards,
    Charlie Liao
    TechNet Community Support

  • Tool versions and Application versions

    hi,
    i have a doubt in basic concept of peopleosft regarding the realtion between tool versions and application versions
    I have two systems..
    system1 : Application version 8.8 and tool version 8.49
    system 2: Application version 8.9 and tool version 8.46
    Now, the integration broker and webservices are completley different in these two tool versions...
    from whatever i know..when tool version is upgraded..navigations in application remain same but the way the process is done in background differ...
    so if we have webservices in application 8.8 and tools 8.46...the navigations are different and when we upgrade to 8.49 the whole concept of webservices change...so the navigations invariably change..how can it be possible..?
    Can someone explain me this or give a link to a doc for reference..
    Thanks in advance,
    Karthik
    Edited by: karthik tulasi on May 18, 2009 12:14 PM

    Well, you seems confuse, or I was not clear enough.
    Maybe I'm still not getting your question as it should, so you could try to rephrase it again.
    What's your concern exactly ?
    A new try on my side:
    The menu your are talking about is the Peopletools menu, so application does not interact with it.
    The only link between application and Peopletools are some calls. The application does NOT care about the Peopletools menu.
    The application/peopletools capabilities are embeded in the Peopletools which are ready or not ready to receive calls from differents Applications versions.
    Once more, menus are only frontend user GUI, but internally, this is an other stuff I tried to explain above.
    Basically, for the application point of view, Peopletools version are not know. This is the other way around, Peopletools are willing to receive application calls.
    Nicolas.

Maybe you are looking for

  • Stupid question! why is my PDF purple?

    i have a high res PDF but i cannot remove the "varnish" so i can actually see the document it is just purple. i am sure there is a simple solution however i cannot seem to find it. please help!!!!!

  • Healing Brush's sampler remains active, wreaking havoc

    I am a first-time user of Photoshop Elements (8, just arrived today), but I think I've discovered a bug: When I try to use the Healing Brush, I Alt+Click on an area I want to copy, and then begin painting over the blemishes. However, the pixels repla

  • Error code -42110 after installing intunes 64

    Hi, after installing iTunes 64 (Windows) on my new Netbook I get an error code (-42110). Also it is not possible to synchronize my iPod. I can press the button "synchronize" but nothing happend. So my music can not be "downloaded" from iPod into new

  • Adobe 9.31 still crashes browser

    adobe 9.31 danish crashes all my browsers(opera, IE, firefox and google) when I try to open a pdf file in the prowser and NO adobereader is not old but highly updated. fhe only soloution was to uninstal the reader and of course I  have tried to reins

  • Brightness keys stopped working; won't restart or shut down

    A couple days ago my brightness and volume keys stopped working. I thought restarting my computer (i also needed to restart it to install a software update) would fix this problem but then realized my Mac won't go to sleep, restart, or shut down. Any