Get Folder Content with category attributes

Hi Gurus,
I want to get all documents of a folder with few custom category attributes values.
How can I query this?
Thanks
JO

Yes, you make a SearchExpression tree that holds all your attributes and values to compare them to. Here is something I used for a category with 7 attributes:
        AttributeRequest[] ar = new AttributeRequest[]{
            new AttributeRequest(Attributes.CLASS_NAME, null),
            new AttributeRequest(Attributes.METADATA_ATTRIBUTES, new AttributeRequest[]{
            new AttributeRequest(Attributes.ATTRIBUTE_NAME, null),
            new AttributeRequest(Attributes.DISPLAY_NAME, null)
        NamedValue[] SEARCH_INCLUDES_VERSIONHISTORY = new NamedValue[] {
            new NamedValue(Options.SEARCH_VERSION_HISTORY,Boolean.TRUE)
        NamedValue[] PRI_SORT_NAME_ASC = new NamedValue[] {
            new NamedValue(Options.PRIMARY_SORT_ATTRIBUTE,Attributes.NAME),
            new NamedValue(Options.PRIMARY_SORT_DIRECTION,Boolean.TRUE) // asc
        NamedValue[] options = (NamedValue[])FdkUtils.combineArrays(PRI_SORT_NAME_ASC, SEARCH_INCLUDES_VERSIONHISTORY);
        AttributeRequest[] reqAtr1 = new AttributeRequest[]{
            new AttributeRequest(Attributes.CATEGORIES, new AttributeRequest[]{
                new AttributeRequest(Attributes.CUSTOM_ALL, null),
                new AttributeRequest(Attributes.CATEGORY_CLASS_OBJECT, null) }),
            new AttributeRequest(Attributes.PATH, null),
            new AttributeRequest(Attributes.URL, null)
        Item kat = FdkUtils.getCategoryObject(s_WsCon, null, "DICOM", ar);      
        String className = (String)FdkUtils.getAttribute(kat, Attributes.CLASS_NAME);
        String atr1 = FdkUtils.getAttributeNameFromDisplayName(s_WsCon, kat.getId(), "Ime pacijenta");
        String atr2 = FdkUtils.getAttributeNameFromDisplayName(s_WsCon, kat.getId(), "ID pacijenta");
        String atr3 = FdkUtils.getAttributeNameFromDisplayName(s_WsCon, kat.getId(), "Ime per doktora");
        String atr4 = FdkUtils.getAttributeNameFromDisplayName(s_WsCon, kat.getId(), "Ime ref doktora");
        String atr5 = FdkUtils.getAttributeNameFromDisplayName(s_WsCon, kat.getId(), "ID studije");
        String atr6 = FdkUtils.getAttributeNameFromDisplayName(s_WsCon, kat.getId(), "Opis studije");
        String atr7 = FdkUtils.getAttributeNameFromDisplayName(s_WsCon, kat.getId(), "Datum studije");
        String atr1Operand = "[" + className + FdkConstants.SEPARATOR + atr1 + "]";
        String atr2Operand = "[" + className + FdkConstants.SEPARATOR + atr2 + "]";
        String atr3Operand = "[" + className + FdkConstants.SEPARATOR + atr3 + "]";
        String atr4Operand = "[" + className + FdkConstants.SEPARATOR + atr4 + "]";
        String atr5Operand = "[" + className + FdkConstants.SEPARATOR + atr5 + "]";
        String atr6Operand = "[" + className + FdkConstants.SEPARATOR + atr6 + "]";
        String atr7Operand = "[" + className + FdkConstants.SEPARATOR + atr7 + "]";
        SearchManager sem = s_WsCon.getSearchManager();
        SearchExpression seExp1 = new SearchExpression();
        seExp1.setOperator(FdkConstants.OPERATOR_EQUAL);
        seExp1.setLeftOperand(atr1Operand);
        seExp1.setRightOperand(imePac);
        SearchExpression seExp2 = new SearchExpression();
        seExp2.setOperator(FdkConstants.OPERATOR_EQUAL);
        seExp2.setLeftOperand(atr2Operand);
        seExp2.setRightOperand(IDPac);
        SearchExpression seExp3 = new SearchExpression();
        seExp3.setOperator(FdkConstants.OPERATOR_EQUAL);
        seExp3.setLeftOperand(atr3Operand);
        seExp3.setRightOperand(imePerDok);
        SearchExpression seExp4 = new SearchExpression();
        seExp4.setOperator(FdkConstants.OPERATOR_EQUAL);
        seExp4.setLeftOperand(atr4Operand);
        seExp4.setRightOperand(imeRefDok);
        SearchExpression seExp5 = new SearchExpression();
        seExp5.setOperator(FdkConstants.OPERATOR_EQUAL);
        seExp5.setLeftOperand(atr5Operand);
        seExp5.setRightOperand(IDStud);
        SearchExpression seExp6 = new SearchExpression();
        seExp6.setOperator(FdkConstants.OPERATOR_EQUAL);
        seExp6.setLeftOperand(atr6Operand);
        seExp6.setRightOperand(opisStud);
        SearchExpression seExp7 = new SearchExpression();
        seExp7.setOperator(FdkConstants.OPERATOR_EQUAL);
        seExp7.setLeftOperand(atr7Operand);
        seExp7.setRightOperand(datStud);
        SearchExpression seExp8 = new SearchExpression();
        seExp8.setOperator(FdkConstants.OPERATOR_AND);
        seExp8.setLeftOperand(seExp1);
        seExp8.setRightOperand(seExp2);
        SearchExpression seExp9 = new SearchExpression();
        seExp9.setOperator(FdkConstants.OPERATOR_OR);
        seExp9.setLeftOperand(seExp3);
        seExp9.setRightOperand(seExp4);
        SearchExpression seExp10 = new SearchExpression();
        seExp10.setOperator(FdkConstants.OPERATOR_AND);
        seExp10.setLeftOperand(seExp5);
        seExp10.setRightOperand(seExp6);
        SearchExpression seExp11 = new SearchExpression();
        seExp11.setOperator(FdkConstants.OPERATOR_AND);
        seExp11.setLeftOperand(seExp8);
        seExp11.setRightOperand(seExp9);
        SearchExpression seExp12 = new SearchExpression();
        seExp12.setOperator(FdkConstants.OPERATOR_AND);
        seExp12.setLeftOperand(seExp10);
        seExp12.setRightOperand(seExp7);
        SearchExpression seExp = new SearchExpression();
        seExp.setOperator(FdkConstants.OPERATOR_AND);
        seExp.setLeftOperand(seExp11);
        seExp.setRightOperand(seExp12);
        NamedValue[] result = sem.search(seExp, options, reqAtr1);
        NamedValue[] nvRezultat = null;Hope this helps!
Pedja

Similar Messages

  • Get Folder Contents....bug? ***

    I am creating a workflow using a combination of variables and filters to reorganize a bunch of files. I frequently use the "Get Folder Contents" action in this workflow. It works the first couple of instances I have it in the workflow and in all instances when I first create the workflow. However after I save and quit the workflow, if I open it up again the from the third instance of using the "Get Folder Contents" action it stops working and is flagged as "Get Folder Contents" encountered an error. If I delete this instance of "Get Folder Contents" and drag a new one into the same space it works fine....until I save and quit the workflow and open it up again - and then it fails.....
    How do I fix this?
    Any help greatly appreciated....
    A

    You can pass the input items directly to a Run AppleScript action, or use the Get Folder Contents and Filter Finder Items actions to get a list of file paths.  If you are looking at just getting names, I have a Get Names of Finder Items action that can return various paths and file name parts of the input items.  The action can be downloaded from my Automator web page.

  • Get folder ID with JSOM

    I need to fetch folder ID using JSOM. Actually, I need to update one of its columns, that is why I want to get ID.
    For now, I can get its name:
    function get_currentFolder(OnSuccess, OnError) {
        var context = SP.ClientContext.get_current();
        var web = context.get_web();
        var currentFolder = web.getFolderByServerRelativeUrl(decodeURIComponent(ctx.rootFolder));
        context.load(currentFolder);
        context.executeQueryAsync(
          function () {
              OnSuccess(currentFolder);
          OnError
    get_currentFolder(function (folder) {
            console.log('Current folder:' + folder.get_name());
        }, function (sender, args) {
            console.log(args.get_message());
    Is there a way to get ID or is there a way to update one column of that folder in a different way??

    Check if below can help
    http://www.c-sharpcorner.com/UploadFile/anavijai/how-to-get-the-number-of-items-inside-the-folder-in-sharepoi/
    http://stackoverflow.com/questions/22629710/get-sub-files-with-folders-ids-client-object-model
    var folders = new Dictionary<string,Microsoft.SharePoint.Client.Folder>();
    var folderNames = new[] {"Orders","Requests"};
    foreach (var folderName in folderNames)
    var folderKey = string.Format("/Shared Documents/{0}", folderName);
    folders[folderKey] = context.Web.GetFolderByServerRelativeUrl(folderKey);
    context.Load(folders[folderKey],f => f.Files);
    context.ExecuteQuery(); //execute request only once
    //print all files
    var allFiles = folders.SelectMany(folder => folder.Value.Files);
    foreach (var file in allFiles)
    Console.WriteLine(file.Name);
    If this helped you resolve your issue, please mark it Answered

  • How to get php content with java ??

    i have made a php file what will display a number,
    here's a example
    <?php
    if ($action == "answer"){
    echo "18274926";
    ?>
    no i want to get the number with java
    so here's my java code
    import java.io.*;
    import java.net.*;
    import java.util.Date;
    class URLConnecties
        public static void main(String args[]) throws Exception
            int teken;
            URL url = new URL("http://www.gamer.mineurwar.nl/net/javachallenge.php?command=DaTe");
            URLConnection urlconnection = url.openConnection();
            System.out.println("Type inhoud: " +
                urlconnection.getContentType());
            System.out.println("Datum document: " +
                new Date(urlconnection.getDate()));
            System.out.println("Laatst gewijzigd: " +
                new Date(urlconnection.getLastModified()));
            System.out.println("Document vervalt: " +
                urlconnection.getExpiration());
            int lengteinhoud = urlconnection.getContentLength();
            System.out.println("Lengte inhoud: " + lengteinhoud);
            if (lengteinhoud > 0) {
                InputStream in = urlconnection.getInputStream();
                while ((teken = in.read()) != -1) {
                    System.out.print((char) teken);
                in.close();
    }if you change the url ro a .html file it displays the code correctly(source),
    but when trying to get the content of a php file (the number)
    it says that there is no content from the php file
    yhe source of the original php file what's in the code can be found at
    www.gamer.mineurwar.nl/net/javachallenge.txt

    The 'content' is generated dynamically by a PHP script so the "content lenght" can't be known in advance by the server. For this reason connection.getContentLenght() returns -1; it doesn't mean that there is no content, only that it can't be known how much there will be.
    To solve the issue, remove the if statement from around the while-loop:// if (lengteinhoud > 0) { DELETE THIS LINE
    InputStream in = urlconnection.getInputStream();
    while ((teken = in.read()) != -1) {
        System.out.print((char) teken);
    // } and this too

  • My MacBook won't start up. Get folder icon with ? In it.  Ideas....    Thanks

    My MacBook won't start up.  I get a folder icon with a "?" in it.  Any ideas?  Thanks.

    The MacBook cannot find a startup disk...could be a corrupted hard drive or failed hard drive.  If you have the install disk for your Mac OS X, you show 10.5.8, try booting holding the C key so you startup on the installation disk.  If that works, use disk utility to see if you can do a repair of the internal hard drive and fix system files that are bad, or even do a reinstall so you cleanup bad files.
    If that does not work, then a trip to the Apple store genius bar to have the hard drive checked out and possibly replaced.

  • How can I compare folder content with time delay

    Hi all, I'm new here, with no programming skills but with a lot of LV manuals read
    So, there is a C-smth program  - no source. It writes .avi file in
    folder if event has occur, and it names that file with exact time
    (yyyy-mm-dd-hh-mm-ss) of that event. Using DAQ and program "written" in
    LV 7.1 I record voltage, but I don't need to store that if nothing new
    is written in that folder with .avi files. However if smt new is in it
    4 minutes before and 4 minutes after event has to be recorded and
    stored  by LV.
    I have no idea how to do this!
    My major problem is comparing content of the folder with that folder but say 1 sec before.
    Any suggestions?
    Izidor

    Izidor,
    You could use two different loops and share the information between them using Queues or Notifiers.  One loop could be acquiring data and sending the datapoints to a consumer loop using the above mentioned methods.  The consumer loop would then check the folder for files with recent timestamps for names and save the data to a file.
    There are examples in example finder (help>>find examples) for Queues and Notifiers.  Also press "new" at the LabVIEW Getting Started Window for looking at the producer/consumer architecture.
    I hope this helps.
    Steven T.

  • Changed out internal harddrive, now getting folder icon with ? when booting.  What to do now?

    See subject

    First, shut down.
    1. Boot from install disc (press power button, immediately insert install disc and hold down c key).
    2. Select your language.
    3. Open Disk Utility from Utilities menu.
    4. Select the HD in the left pane (the manufacturer’s name and the HD model number).
    5. Click on the Erase tab.
    6. Choose the Format: Mac OS Extended (Journaled).
    NOTE: if you want to zero the HD (which I always think is a good idea, but does take time), click on Security Options, click the button for Zero Out Data, click OK. The larger the HD, the longer this will take, in some cases several hours.
    7. Click on Erase and wait for the entire process to finish.
    8. Click the Partition tab.
    9. Click on Volume Scheme and choose the number of partitions (normally just one unless you have other plans).
    10. Click on the Options button (located underneath the Volume Scheme pane) and select GUID.
    11. Click Apply.
    12. Quit Disk Utility and continue with the installation process to install OS X; when finished, restart, repair permissions, run updates (in Apple Menu > Software Update), and repair permissions again.

  • Category attributes default values updating

    Hi,
    I'm developing an application that, upon upload of a file to the specified root folder(through the application), reads some values from a file, creates a folder structure based on those values, and moves the file in the bottom folder. Now, a predefined category should be attached to the file, to enable search by category attributes. My idea is to set the category as required on that bottom folder (or the first), and modify it's attribute default values, so that the file inherits them when moved in it. I have found mshannon's examples in some other thread ( Updating a document with category metadata using updateDocument(): error! ), the first one works only with files, not folders, and the second one doesn't work for me at all, I get an error:
    javax.faces.el.EvaluationException: ORACLE.FDK.AggregateError:ORACLE.FDK.AggregateError
    here is my code:
    public static void updateAttributes() throws FdkException, RemoteException{
    login();
    FileManager fm = s_WsCon.getFileManager();
    Item fajl = fm.resolvePath(prop.getProperty("userhome") + "/root folder/folder1/readme1.txt",
    null);
    long docID = fajl.getId();
    NamedValue[] catInstAtr = new NamedValue[] {
    new NamedValue("CUSTOM_138297", "changed value for att1"),
    new NamedValue("CUSTOM_138299", "changed value for att2")
    NamedValue[] catDef = new NamedValue[] {
    new NamedValue(Options.UPDATE_CATEGORY_ID,new Long(139054)),
    new NamedValue(Options.CATEGORY_DEFINITION_ATTRIBUTES, catInstAtr)
    NamedValue[] docDef = new NamedValue[] {
    new NamedValue(Options.CATEGORY_DEFINITION, catDef)
    AttributeRequest[] reqAtr = new AttributeRequest[]{
    new AttributeRequest(Attributes.DESCRIPTION, null)
    fajl = fm.updateDocument(docID, docDef, reqAtr);
    logut();
    This example is (I think) only for updating on document level, but I could use a solution for folder-level updating, as I explained before. Can anyone help me?
    Thanks,
    Pedja

    Pedja,
    Here is my code to get category from Folder this is updated version from sample code TestCategory2.java
    1. It will get the required category of a folder.
    2. gets the internal category attribute names
    3. get Category id if uploading file along with category attribute values OR
    updating file and also updating previous category instance values..
    package oracle.ifs.examples.content.testcases;
    import java.util.Map;
    import java.util.Properties;
    import java.util.*;
    // Facade Objects
    import oracle.ifs.fdk.AttributeRequest;
    import oracle.ifs.fdk.Attributes;
    import oracle.ifs.fdk.FdkConstants;
    import oracle.ifs.fdk.FdkErrorCodes;
    import oracle.ifs.fdk.FdkException;
    import oracle.ifs.fdk.FdkExceptionEntry;
    import oracle.ifs.fdk.Item;
    import oracle.ifs.fdk.Options;
    import oracle.ifs.fdk.NamedValue;
    import oracle.ifs.fdk.NamedValueSet;
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.FileNotFoundException;
    import java.io.FileOutputStream;
    import java.io.IOException;
    import HTTPClient.HTTPConnection;
    import HTTPClient.HTTPResponse;
    import HTTPClient.HttpOutputStream;
    import java.io.InputStream;
    import java.io.OutputStream;
    import java.net.URL;
    // Web Services Managers
    import oracle.ifs.fdk.CategoryManager;
    import oracle.ifs.fdk.CommonManager;
    import oracle.ifs.fdk.FileManager;
    // Framework
    import oracle.ifs.examples.content.fdk.FdkSession;
    import oracle.ifs.examples.content.fdk.FdkUtils;
    import oracle.ifs.examples.content.fdk.Managers;
    import oracle.ifs.examples.content.fdk.constants.ItemAttributes;
    import oracle.ifs.examples.content.fdk.constants.NamedValueConstants;
    import oracle.ifs.examples.content.testcases.AbstractTest;
    public class TestCategories3
    implements ItemAttributes, NamedValueConstants
    public TestCategories3()
    public static void main(String[] args)
    TestCategories3 tc3= new TestCategories3();
    tc3.getCatinfo();
    * This is where you write your test program.
    public void getCatinfo()
    log(this.getClass().getName()+": starting");
    FdkSession session = null;
    try
    AttributeRequest[] requestedAttributes = null;
    NamedValue[] sortOptions = null;
    Map returnedAttrs = null, map = null;
    log("\nAuthenticating as regular test user ...");
    session = new FdkSession("http://xxx.com:8320/content/","anakkala","sample");
    CommonManager commonM = Managers.getCommonManager(session);
    CategoryManager categoryM = Managers.getCategoryManager(session);
    FileManager fileM = Managers.getFileManager(session);
    // save this attribute request so that it can be used later
    AttributeRequest[] AR_CATEGORY_CONFIGURATION_ATTRIBUTES =
    FdkUtils.newAttributeRequestArray(Attributes.CATEGORY_CONFIGURATION,
    FdkUtils.newAttributeRequestArray(new Object[]
    // Is the category configuration enabled
    FdkUtils.newAttributeRequest(Attributes.CONFIGURATION_ENABLED),
    // Can the category configuration be overridden or is it final
    FdkUtils.newAttributeRequest(Attributes.CONFIGURATION_FINAL),
    // What are the required categories for the category configuration
    FdkUtils.newAttributeRequest(Attributes.REQUIRED_CATEGORIES,
    // for the required categories ...
    FdkUtils.newAttributeRequestArray(new Object[]
    // What is the category classobject display name
    FdkUtils.newAttributeRequest(Attributes.DISPLAY_NAME),
    // get attributes inherited and introduced by category object
    FdkUtils.newAttributeRequest(Attributes.METADATA_ATTRIBUTES,
    // get full settings for each of these attributes
    FdkUtils.newAttributeRequestArray(METADATA_ATTRIBUTE_ATTRIBUTES)
    // Are there any attribute overrides for this category config?
    FdkUtils.newAttributeRequest(Attributes.ATTRIBUTE_OVERRIDES,
    // get full settings for each of these attribute overrides
    FdkUtils.newAttributeRequestArray(ATTRIBUTE_OVERRIDE_ATTRIBUTES))
    log("\nLooking up folder /d-rco/C1/L1/folder1 ...");
    // convert attribute request map to AttributeRequest[]
    requestedAttributes = AR_CATEGORY_CONFIGURATION_ATTRIBUTES;
    Item folder =fileM.resolvePath(
    "/d-rco/C1/L1/folder1",
    requestedAttributes);
    log("folder id is="+folder.getId());
    log("\nProcessing requested attributes - goal: generate override ...");
    //returns a map
    returnedAttrs = FdkUtils.getAttributesMap(folder);
    Item categoryConfig = (Item)
    returnedAttrs.get(Attributes.CATEGORY_CONFIGURATION);
    returnedAttrs = FdkUtils.getAttributesMap(categoryConfig);
    // is CategoryConfiguration enabled?
    Boolean ccEnabled = (Boolean) returnedAttrs.
    get(Attributes.CONFIGURATION_ENABLED);
    // is CategoryConfiguration final? false=subfolders can override
    Boolean ccFinal = (Boolean) returnedAttrs.
    get(Attributes.CONFIGURATION_FINAL);
    // what are the attribute overrides for this category configuration
    log("\nAttribute overrides ...");
    Item[] attributeOverrides = (Item[]) returnedAttrs.
    get(Attributes.ATTRIBUTE_OVERRIDES);
    FdkUtils.log(attributeOverrides);
    // what are the requred categories for this category configuration
    log("\nRequired categories ...");
    Item[] reqCategories = (Item[]) returnedAttrs.get(Attributes.REQUIRED_CATEGORIES);
    FdkUtils.log(reqCategories);
    log("After printing required categories");
    if(ccEnabled.booleanValue() && !ccFinal.booleanValue()
    && reqCategories != null && reqCategories.length >= 1)
    // Folder /<domain>/<basecontainer>/L1/F3.EC has an enabled category
    // configuration that can be overridden and has required categories
    // present ...
    Item category = null;
    for (int i=0; i < reqCategories.length; i++)
    returnedAttrs = FdkUtils.getAttributesMap(reqCategories);
    log( "xxx name="+((String) returnedAttrs.get(Attributes.DISPLAY_NAME) ));
    if ( ((String) returnedAttrs.get(Attributes.DISPLAY_NAME)).
    equals("BG_Serv_Req"))
    category = reqCategories[i];
    break;
    log("category id="+category.getId());
    if (category != null)
    NamedValue[] internalCategoryAttrs = null;
    try {
    internalCategoryAttrs =getInternalCategoryAttrNames("BG_Serv_Req",session);
    }catch(Exception e)
    log("error getting internal names");
    e.printStackTrace();
    log("Category Attribute internal Name ="+ (String)internalCategoryAttrs[0].getValue());
    log("Category Attribute internal Name ="+ (String)internalCategoryAttrs[1].getValue());
    NamedValue[] categoryInstanceAttributes = new NamedValue[] { 
    // use the internal attribute name for all attributes
    new NamedValue((String)internalCategoryAttrs[0].getValue(), "XNXNXNXN 234"),
    new NamedValue((String)internalCategoryAttrs[1].getValue(), "SNKKSKSK 1234")
    NamedValue[] categoryDef = new NamedValue[] { 
    // the id of the category object class for which this new category will be an
    //instance of
    new NamedValue(Options.CATEGORY_CLASS_ID, new Long(category.getId())),
    // the updated values of the category instance
    new NamedValue(Options.CATEGORY_DEFINITION_ATTRIBUTES, categoryInstanceAttributes)
    String sourceFile="test.doc";
    String folderPath = "C:\\upload";
    requestedAttributes = FdkUtils.newAttributeRequestArray(Attributes.URL);
    Item doc = fileM.resolveRelativePath(folder.getId(),sourceFile, requestedAttributes);
    log("START ORACLE TEST CODE FROM TAR");
    // this will get the category instance id
    AttributeRequest categoryAR = new AttributeRequest();
    categoryAR.setAttributeName(Attributes.CATEGORIES);
    AttributeRequest[] attrRequests = new AttributeRequest[]
    { categoryAR};
    Item myDoc = commonM.getItem(doc.getId(), attrRequests);
    NamedValue[] requestedAttributesNV = myDoc.getRequestedAttributes();
    int length = requestedAttributesNV == null ? 0 :
    requestedAttributesNV.length;
    Item[] itemCategories = null;
    log("length="+length);
    for (int i = 0; i < length; i++)
    log("requestedAttributesNV[i].getName()="+requestedAttributesNV[i].getName());
    if(requestedAttributesNV[i].getName().equals(Attributes.CATEGORIES))
    itemCategories = (Item[]) requestedAttributesNV[i].getValue();
    length = itemCategories == null ? 0 : itemCategories.length;
    log("length="+length);
    long categoryInstanceId = 0;
    for (int i = 0; i < length; i++)
    log("Category instance " + itemCategories[i].getName() + " has id " +
    itemCategories[i].getId());
    categoryInstanceId = itemCategories[i].getId();
    log("END ORACLE TEST CODE FROM TAR");
    /* If the document does not exist in OCS */
    if (doc == null) {
    requestedAttributes = FdkUtils.newAttributeRequestArray(Attributes.URL);
    NamedValue[] nvdoc = FdkUtils.newNamedValueArray(
    new Object[][] { { Attributes.NAME,sourceFile} }
    Item def = fileM.createDocumentDefinition(nvdoc,requestedAttributes);
    int uploadStatusCode = uploadContent(
    session,
    getSampleFileStream(sourceFile,folderPath),
    (String) FdkUtils.getAttribute(def,Attributes.URL)
    log("Upload Status to definition file: "+uploadStatusCode);
    nvdoc = FdkUtils.newNamedValueArray(
    new Object[][]
    { Attributes.NAME,sourceFile},
    { Options.USE_SAVED_DEFINITION, new Long(def.getId())},
    { Options.DESTFOLDER, new Long(folder.getId()) },
    // apply category instance informationnew
    { Options.CATEGORY_DEFINITION, categoryDef }
    requestedAttributes = FdkUtils.newAttributeRequestArray(Attributes.URL);
    doc = fileM.createDocument(nvdoc,null,requestedAttributes);
    }else /* if document already exist in OCS */
              log(sourceFile+" file exists so updating ...");
    int uploadStatusCode = uploadContent(
    session,
    getSampleFileStream(sourceFile,folderPath),
    (String) FdkUtils.getAttribute(doc ,Attributes.URL)
    log("uploadStatusCode="+uploadStatusCode);
    FileInputStream fi= getSampleFileStream(sourceFile,folderPath);
    log("category id using in update="+ category.getId());
    NamedValue[] updatecatdef = new NamedValue[] {
    //new NamedValue(Options.UPDATE_CATEGORY_ID, new Long(category.getId())),
    new NamedValue(Options.UPDATE_CATEGORY_ID, new Long(categoryInstanceId)),
    new NamedValue(Options.CATEGORY_DEFINITION_ATTRIBUTES,
    new NamedValue[] {
    new NamedValue((String)internalCategoryAttrs[0].getValue(), "AH234 V2"),
    new NamedValue((String)internalCategoryAttrs[1].getValue(), "SNHGZ12 V2")
    NamedValue[] nv = FdkUtils.newNamedValueArray(
    new Object[][]
    { Attributes.NAME,sourceFile},
    { Attributes.DESCRIPTION,"Sample file"},
    //{Options.CONTENTSTREAM, fi},
    { Options.CATEGORY_DEFINITION, updatecatdef }//Newly added for category upload
    requestedAttributes = FdkUtils.newAttributeRequestArray(Attributes.URL);
    // THIS IS WHERE WE ARE GETTING ERROR
    fileM.updateDocument(doc.getId(),nv,requestedAttributes);
    System.out.println("doc = fm.updateDocument is complete ........." );
    } // end if (Document Confidentiality category present)
    } // end if category configuration enabled / overridable etc
    catch (FdkException fe)
    FdkUtils.log(fe);
    fe.printStackTrace();
    catch (Exception e)
    // java.net.MalformedURLException;
    // java.rmi.RemoteException;
    // javax.xml.rpc.ServiceException;
    // org.apache.axis.AxisFault
    log("Fatal exception occurred in run():");
    e.printStackTrace();
    finally
    if (session != null)
    session.disconnect();
    log("\n"+this.getClass().getName()+": ending");
    private FileInputStream getSampleFileStream(String filename,String path)
    throws FileNotFoundException
    FileInputStream stream = null;
    if (filename != null && filename.length() >= 1)
    if (path.length() >=1 && !path.endsWith("/"))
    path += "/";
    stream = new FileInputStream(new File(path+filename));
    return stream;
    public int uploadContent(
    FdkSession session,
    InputStream inputStream,
    String destinationURL
    throws Exception
    int statusCode = -1;
    if (inputStream == null) return statusCode;
    HTTPConnection conn = null;
    try
    URL url = new URL(destinationURL);
    conn = session.getHttpConnection(url);
    byte[] buffer = new byte[8192];
    int count=0;
    HttpOutputStream outputStream = new HttpOutputStream();
    HTTPResponse response = conn.Put(url.getFile(), outputStream);
    try
    while ((count = inputStream.read(buffer)) != -1)
    outputStream.write(buffer, 0, count);
    finally
    outputStream.flush();
    outputStream.close();
    statusCode = response.getStatusCode();
    finally
    if (inputStream != null)
    inputStream.close();
    if (conn != null)
    conn.stop();
    conn = null;
    return statusCode;
    // Handle the response. Note that a successful response may not be
    // 200, but may also be 201 Created, 204 No Content or any of the other
    // 2xx range responses.
    public void log(String s)
    System.out.println(s);
    public NamedValue[] getInternalCategoryAttrNames(String categoryName,FdkSession session) throws Exception
    NamedValue[] returnNV = null;
    Map attmap = new HashMap();
                   attmap.put(Attributes.METADATA_ATTRIBUTES,
                   FdkUtils.newAttributeRequestArray(
                   new String[] { Attributes.ATTRIBUTE_NAME,
                   Attributes.DISPLAY_NAME }));
                   AttributeRequest[] request = FdkUtils.getAttributeRequestArray(attmap);
                   Item cat = FdkUtils.getCategoryObject(session, null, categoryName, request);
    log("inside method cat id="+cat.getId());
    /** ANAKKALA START **/
    NamedValue[] catNV = cat.getRequestedAttributes();
    if( catNV != null && catNV.length >0)
    for (int i=0; i<catNV.length; i++)
    if(catNV[i].getName().equals("METADATA_ATTRIBUTES"))
    //log("** CatNV.getName="+catNV[i].getName()+" value="+catNV[i].getValue());
    Item[] meta = (Item[]) catNV[i].getValue();
    log("meta length="+meta.length);
    returnNV = new NamedValue[meta.length];
    for (int j=0; j<meta.length; j++)
    log("--Item getname="+meta[j].getName()+" value="+meta[j].getId()+" gettype="+meta[j].getType()+" gettypedesc="+meta[j].getTypeDesc());
    returnNV[j] = new NamedValue(meta[j].getName(),meta[j].getName());
    NamedValue[] metaNV = meta[j].getRequestedAttributes();
    log("---metaNV length="+metaNV.length);
    for(int k=0; k<metaNV.length; k++)
    log("------metaNV.getName="+metaNV[k].getName()+" value="+metaNV[k].getValue());
    /** ANAKKALA END **/
    //NamedValue[] ret = null;
    return returnNV;

  • Automator folder action won't run entire folder contents

    Hi,
    Ok, I think I'm pretty well versed in Automator and getting things to work. But this is just escaping me.
    I've made a simple Photoshop Droplet (done this before). Open Automator, built a workflow for getting a folders contents and then opening the contents with the Droplet.
    Saved this as a folder action,...
    But when I drag multiple items to the folder, it only runs the very first item and stops,...
    If I drag one by one into the folder it will work fine,....
    I'm going to have to be dragging multiples all the time, it's a waste of time to do one by one,...
    I'm totally missing something here,.... please help!!
    I'd also like to move the contents of the folder, once the Droplet has run, to the trash
    But first I have to get this darn thing to run on the entire folders contents,.....
    Workflows I've tried:
    1 - Open finder Items (open in my Droplet) works one at a time
    2 - Get Specified Finder Items (point to my folder)
    Get Folder Contents
    Open finder Items (open in my Droplet) again, works one at a time
    Thanks!!
    Christopher

    Hi Curly, and a warm welcome to the forums!
    I don't know much about Automator, and this may be of no help, but...
    It's either just picking up/passing one variable, when it either needs an array of variables, or needs to loop back for the next one.

  • Very urgent : Problem with field attributes in Datasource

    Hi
    I am getting a problem with field attributes in the datasource.
    The issue came up after i modified the extract structure-i modified one field and
    added one field to the structure.Now those two fields are not visible in BW.
    When i checked with transaction rsa2, i could find that for those two fields , the
    field attribute is <b>'A'</b> which is <b>'Field in OLTP and BW Hidden by SAP'</b>.
    I tried to modify the field attribute to make it visible.Now the issue is that it is not getting reflected after transport in the Q system.What can be the issue.In the Q system its still the old value 'A' ,which makes the fields invisible.
    Please let me know what can be the issue.
    Regards
    Leon

    Hi,
    did you change this attribute via RSA2?
    you need to change your datasource via postprocessing (RSA6); then transport your DS to your Q source system.
    Replicate your datasources in your BW.
    Finally modifiy your Transfer Structure by editing your TRules ( tab Datasource/Tran structure), move your new fields from the right frame to the left frame)
    Maintain your TRules
    Activate
    hope this helps...
    Olivier.

  • How to combine a content search with an attribute search with the API

    Hi
    I have been working with searches in Content Services using the API and I have successfully set up the search over the contents of a document and inside of the Category attributes of the document.
    My problem comes when I try to combine this 2 kinds of search, that is when I want to find all the documents that cointain the text "test" and at the same time contain other text into their category attributes.
    What I do is to build 2 SearchExpression's one for the content search and the other for the attributes search and then joining them in a third SearchExpression object using the FdkConstants.OPERATOR_AND. When I search using only the first or the second SearchExpression everything works fine. But when I do the search using the third SearchExpression an ORACLE.FDK.ParameterError:ORACLE.FDK.InvalidSearchExpression
    exception id raised.
    The code I'm using is like this:
    private SearchExpression getMainSE(String contentQuery, CategoryInfo catInfo)
         SearchExpression contentSE = null;
         SearchExpression catSE = null;
         SearchExpression mainSE = null;
         if(contentQuery != null)
              contentSE = this.setupSE4Contents(contentQuery);
         if(catInfo != null)
              catSE = this.setupSE4Category(catInfo);
         if(contentSE != null && catSE != null)
              mainSE = new SearchExpression();
              mainSE.setLeftOperand(FdkConstants.OPERATOR_AND);
              mainSE.setLeftOperand(catSE);
              mainSE.setRightOperand(contentSE);
         else
              mainSE = contentSE != null ? contentSE : catSE;
         return mainSE;
    CategoryInfo is one class made by my own that contains the categoryId of the document and a List of the attributes where I want to search. mainSE is the SearchExpression that is returned.The portion of code that appears to be having problems is this:
    if(contentSE != null && catSE != null)
         mainSE = new SearchExpression();
         mainSE.setLeftOperand(FdkConstants.OPERATOR_AND);
         mainSE.setLeftOperand(catSE);
         mainSE.setRightOperand(contentSE);
    And finally I only execute the search using the mainSE returned by the function:
    // Define search options
    NamedValue[] nv = WsUtility.newNamedValueArray(new Object[][] {
         { Options.FOLDER_RESTRICTION,
              folder != null ? new Long(folder.getId()) : null },
         { Options.SEARCH_VERSION_HISTORY, Boolean.TRUE } });
         SearchExpression mainSE = this.getMainSE(contentQuery, catInfo);
         try
              // Search documents
              NamedValue[] result = sem.search(mainSE, nv, null);
              // etc....
    Is this the correct way to combine a content search with an attribute search???
    I know that this is possible since I have seen that it can be done in the Collaboration Suite UI.
    I hope yoy can help me...
    Thanks in advance

    Not sure if this is a typo (while pasting code on the forum) or is the cause of the problem you describe.
    Shouldn't mainSE.setLeftOperand(FdkConstants.AND) be replaced by mainSE.setOperator(FdkConstants.AND) ?
    Ravikiran

  • FavoriteFolder, how to get the content inside this folder

    Hi
    I have to get with the Java api consumer the content inside the favorite folder. How can i get it?
    i write this code:
                   String searchQuery = search://{'guaglanto1'}?SearchKeywords=true&SearchExact=true&SearchCaseSensitive=true;
                   ResponseHolder rh = boBIPlatform.get(searchQuery, null);
                   InfoObjects myFav = rh.getInfoObjects();
                   if (myFav == null || source.getInfoObjectArray().length == 0){
                     result="No terms matching the following search query could be found: " + searchQuery;
                             return result;
                   result ="";          
                   for (InfoObject infoObject: myFav.getInfoObjectArray()){
                     result= result+ infoObject.getName() + " has CUID: " + infoObject.getCUID()+ " type "+ infoObject.getKind() + " has childreen "+ infoObject.getChildrenObjects();
    Where guaglanto1 is the title of the favoriteFolder.This code show the CUID,name,kind and children of the favoriteFolder.  Now i want to navigate this folder and get its content (i see from InfoViewApp there are 5 web intelligent report inside the favorite folder) but i don't know how can i get that.
    Anyone can help me to resolve this problem?
    thank you
    best regard
    Andrea

    once you get the SI_ID or SI_CUID of the favorites folder you need to write an additional query to pull all its children using:
    select * from ci_infoobjects where si_parentcuid='<si_cuid of favorites folder>'
    If the favorites folder contains folders with subfolders, this will be a recursive call. You can use query://{select....} or path://
    Look at the BIPlatform documentation in API reference and there is more information on how to use query:// or path://

  • HT204408 My applications folder has a black question mark on it at the bottom of my screen. I do not know what error I made, but my fan effect of the previous applications has gone away. Can I get some help with this?

    One day ago I inadvertantly removed my applications folder. In it's place is a folder with a black question mark which appeared after I attempted to open up the applications file. Also, previously when I clicked on the file applications would open in a fan display. Could I please get some assistance with this?

    ...removed my applications folder.
    From where? And to where?
    If you trashed it and emptied the trash, what backup, if any, do you have? If it's still in the Trash, move it back.
    If no backup, reinstall Snow, which will give you the version as of the DVD you use, then update back to 10.6.8, and run all other needed updates, including any security updates. This should save all your third party programs, as well as settings.
    The white puff of smoke is nothing, it only means you moved it out of the Dock. If you still have it, or had it, as soon as you open it it would reappear in the Dock. The item in the Dock is only a kind of alias.

  • TS3648 great, but my MBA did not come with an installion disc, only a tiny jump drive that is not recognized by windows; and I can't get the contents of that burned to a DVD either. So how the heck do I get the drivers into Windows 7? My MBA has bootcamp

    great, but my MBA did not come with an installion disc, only a tiny jump drive that is not recognized by windows; and I can't get the contents of that burned to a DVD either. So how the heck do I get the drivers into Windows 7? My MBA has bootcamp 3.0.4.

    Here's what I get:
    lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
    inet 127.0.0.1 netmask 0xff000000
    inet6 ::1 prefixlen 128
    inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1
    gif0: flags=8010<POINTOPOINT,MULTICAST> mtu 1280
    stf0: flags=0 mtu 1280
    en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
    ether 00:11:24:7d:e7:1e
    media: autoselect (none) status: inactive
    supported media: none autoselect 10baseT/UTP <half-duplex> 10baseT/UTP <full-duplex> 10baseT/UTP <full-duplex,hw-loopback> 100baseTX <half-duplex> 100baseTX <full-duplex> 100baseTX <full-duplex,hw-loopback>
    en1: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
    inet6 fe80::211:24ff:fe28:2e71%en1 prefixlen 64 scopeid 0x5
    inet 169.254.115.141 netmask 0xffff0000 broadcast 169.254.255.255
    ether 00:11:24:28:2e:71
    media: autoselect status: active
    supported media: autoselect
    fw0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 2030
    lladdr 00:11:24:ff:fe:7d:e7:1e
    media: autoselect <full-duplex> status: inactive
    supported media: autoselect <full-duplex>

  • How do I install OS software on a erased hard drive all I get is folder icon with blinking ?

    Trying to install OS10.6 on erased hard drive but just getting folder with blinking ? symbol any ideas?

    Startup with the Snow Leopard installation disk ALREADY IN THE DRIVE. 
    If it pops out, push it back in during startup.  It will take a long time, but be patient.

Maybe you are looking for