Attribute Conditional Clause

I would like to know if I'm able to assign values to a member based on another member's attribute assignment using the code fragment below from Sample Basic:
fix (Jan:Mar, @children(West), Budget, @descendants(Product))
"COGS"
if (@ATTRIBUTESVAL("Pkg Type") == "Can")
"COGS"= xyz;
else
"COGS" = abc;
endif;)
endfix

Just use @ISATTRIBUTE. Oddly, it doesn't show up in the Tech Ref, but it's there.
You can also use @ISMBR(@ATTRIBUTE(name)).
See: http://www.network54.com/Forum/58296/thread/1214605070/Untitled
Regards,
Cameron Lackpour

Similar Messages

  • Evaluation of condition clause in whehe clause using case statement

    Hi,
    I have a scenario where in I have to evaluate two different conditions based on the parameter value. Is it possible to evaluate the conditiond based on the parameter value with case statement in where clause.
    Example:
    select A,B,C,D from X,Y,Z
    where
    cond1 and
    cond2 and
    case when param='T' then cond3 else cond4 end
    Here param is an external parameter passed to the query.
    cond3 is something like Y.deptno in(10,30,50,70)
    cond4 is something like Y.deptno in (20,40,60,70,80,90)
    Your responce will be appriciated.
    Regards,
    Varma

    You can place the case statement as a condition, however it depends what context you want it in, for example;
    this will work:
    1* select 1 from dual where (case when 1=1 then 1 end) = 1 and 2=2
    QL> /
            1
            1but this will not;
    SQL> select 1 from dual where case when 1=1 then 1 end and 2=2;
    select 1 from dual where case when 1=1 then 1 end and 2=2
    ERROR at line 1:
    ORA-00920: invalid relational operatorSo, if you're expecting the condition to evaluate to a true/false, so if you mean soemthing like
    when TRUE, then it won't work!
    P;

  • AC 5.3 - CUP - initiator attributes - conditional logic

    Is there a trick to making the conditional logic work correctly in CUP when trying to define/select the initiator attributes?   Even when I specify to use AND, it seems to still be adding the attribute with an OR condition.
    For our non-production provisioning,  I have a role that needs to be approved by different people depending on which system (i.e. Dev, IT, QA) it is being requested.  I am trying to set up the 2 initiators as follows:
    Initiator 1:  Application/System = DEV and  Role = Role 1
    Initiator 2:  Application/System = IT or QA    and    Role = Role1
    Edited by: Jane Yap on Oct 22, 2009 5:12 PM

    After playing around with this more,  it appears that if I am selecting Role as the attribute and use the search functionality (i.e. click on the magnifying glass) to specify/select the actual role/role name,  the conditional logic does not get set accordingly.   In order to get the correct conditional logic set (i.e. populate the one I actually selected),  I need to type the role name or pattern of the role name instead of selecting the role using the search functionality.  
    I guess everywhere else within GRC AC it's always best to use the seach functionality when setting/selecting field values  (as opposed to manually typing/entering the values) EXCEPT for when creating/changing CUP initiators.   Documented feature? Perhaps...
    Thank you to those who responded to my post.

  • Entity Attribute conditional mandatority

    Hello OTN,
    I've got an entity object which is used in different projects. In this entity there is an attribute which should be mandatory conditionally:
    When (attributeA != 1 && attributeA != 2) attributeB should be mandatory.
    This should be reflected in the UI with * symbol and an error message which I define in entity business rules.
    The problem is I can't set Mandatory constraint to be conditional, there's no Validation Execution tab.
    Well, I could add a Script Expression or Java method to EntityImpl as business rule but this woudln't give me the * symbol in the UI and I will have to set inputText required attribute on every page.
    Could I avoid it somehow? I want the business rule to be defined only once in the entity object.
    Thanks.
    ADF 11.1.2.1
    Edited by: ILya Cyclone on Jan 10, 2012 3:25 PM

    Quick brainstorm on my part:
    a) You create a transient attribute on the EO with a groovy expression that defines if the other attribute is mandatory or not
    b) Remove the mandatory property on the original attribute (this removes the mandatory rule), then create a script based declarative validation rule based on the result of "a"
    c) In the page change the original attribute's required EL expression to be based on that of "a" too
    ...or something along those lines, this should give you the inspiration you're looking for.
    CM.

  • ADFBC EO attributes: "conditionally" mandatory

    We've a requirement via ADF BC to say that an EO attribute is mandatory/optional, based on an external piece of logic. In other words the field is "conditionally" mandatory, and polymorphic EOs are not suitable in this situation.
    I note in a previous OTN post: Re: Mandatory flag at  VO level.
    ...that ER 3176734 was raised to include such functionality, but I'm unsure if the ER was every implemented in ADF BC. Essentially is there an isAttributeMandatory() solution available somewhere in the 11g ADF BC framework, or at least some sort of solution that will give me the ability in code to determine is a field should be mandatory?
    Your help appreciated.
    CM.

    Yeah, Steve's 2a and 2b solution is what I came up with initially, which is "urg" as for every attribute you need to create a transient attribute, and I was hoping the ER had resulted in something useable/workable/scalable. We've discovered polymorphic EOs are limited in use where you have a predefined static list of discriminator values. In our case we can have an unlimited number of types, all with their own mandatory/optional attribute requirements, derived from a 3rd party rules engine. Of course it gets worse because we also have the need to change labels on the fly, as well as if the field is shown/hidden. A bunch of chokepoint methods similar to isAttributeUpdateable would have been ideal.
    Alternatively I've been investigating if you can do anything with the EntityDeflImpl class from the AttributeDefImpl point of view, but it seems to be mostly a read-only object which you can't override at runtime.
    Currently I'm thinking that what we'll need to do is create a JSF bean with a getter method based on a hashmap lookup, something like: #{smartBean.fieldMandatory.thisField}, where behind the scenes given the "thisField" hash, the isFieldMandatory method will use the hash to query the external business rule engine to discover if the field is mandatory/optional.... if that makes sense.
    CM.

  • Policy Evaluation using session attributes condition

    Hi Guys,
    I have custom policies defined in Access Manager for several resources to be protected. What i am trying to achieve is When policy evaluation happens to calculate the resources based on the ldaproles for a user entry, I need few session properties to be applied which are defined under "conditions" in the policy setup . I need to figure out how would set these users AM session properties from the client application. Any inputs would be of great help.
    Thanking in advance.
    Akeel M Sayyad.

    Anyways, I figured it out. You can do it using SSOTokenManager.

  • Rule Modeler condition of marketing attribute

    Hi experts,
      I need to create a Rule Modeler to trigger an Alert.
      Does it possible to add the condition to check on BP's marketing attribute?
    For ex:
    If confirmed BP has marketing attribute to accept newsletter, I would like to trigger an alert to remind the agent.
    Currently I did not see the rule modeler has such condition, is it not feasible?
    cheers,
    ginnie

    Hello Ginnie,
    You are correct that there is no out of the box attribute (condition) for BP Marketing Attributes. However, this is something that several customers have done on a project basis. You need to create an ABAP class that retrieves the values of the desired marketing attributes for the confirmed account or contact person. Then you need to map the ABAP class to a new Rule Modeler service. And of course you need to create the attribute itself as well in the Rule Modeler configuration.
    Best regards,
    John

  • Using dimension attributes in the Query Builder Bean

    All...
    I am developing an HTML client based tool using the JSP tags. I wish to create a report that selects the appropriate dimension value based upon an attribute.
    But...
    Using the query builder I can not select dimension values based upon dimension attributes. Is this possible? The only use I have found for the attributes is when I am sorting my selected diemsnion values.
    Thanks in advance
    Dylan.

    1. Java Client QueryBuilder has support for selecting dimension members based on an attribute.
    To use this functionality, go to Dimensional Panel -> Conditions tab. Drill on Match group of conditions. The attribute condition appears as the last available condition, but only for dimensions that have attributes.
    To test this, use BIBDEMO schema supplied with BI Beans and look at conditions for Product dimension.
    2. If you wish to display dimension attributes and their values in the HTML client UI,
    here is how you can retrieve attributes and their values for a dimension:
    (e.g. for Product dimension in BIBDEMO)
    String dimensionID = "MDM!D_BIBDEMO.PRODUCT";
    String hierarchyID = null;
    MDDimension dimension = metadataManager.getDimensionByUniqueID(dimensionID);
    MDHierarchy hierarchy = dimension.getDefaultHierarchy();
    if (hierarchy != null)
    hierarchyID = hierarchy.getUniqueID();
    // Retrieve all the attributes for this dimension
    MDAttribute[] attributes = dimension.getAttributes();
    if (attributes != null && attributes.length > 0)
    String attributeID = null;
    AttributeListStep attrStep = null;
    Selection sel = null;
    MetadataMap map = new MetadataMap(new String[] {MetadataMap.METADATA_VALUE});
    for (int i=0; i<attributes.length; i++)
    // Get the unique ID for the attribute
    attributeID = attributes.getUniqueID();
    // Create and evaluate an AttributeListStep
    attrStep = new AttributeListStep(dimensionID, hierarchyID, attributeID);
    sel = new Selection(dimensionID);
    sel.setHierarchy(hierarchyID);
    sel.addStep(attrStep);
    // Evaluate the AttributeListStep and get the DataAccess
    DataAccess da = query.createQueryAccess().getDataAccess(sel, map);
    // Walk the DataAccess and get the attribute values
    if (da != null)
    int extent = da.getEdgeExtent(DataDirector.COLUMN_EDGE);
    for (int i=0; i<extent; i++)
    // Get the attribute value
    strValue = (String)da.getMemberMetadata(DataDirector.COLUMN_EDGE, 0, i, MetadataMap.METDATA_VALUE);
    // Add the value to a drop down or another UI element...

  • How to use a user defined function in where cluase condition

    Hi,
    I have designed a query by selecting some columns in the tables and some columns are retrieved directly from table and some columns are passing to a user defined function. Now my requirement is i need to use that user defined function result in oracle where condition clause.
    Ex : select marketing_user_id,get_name(marketing_user_id),item_id,get_item_name(item_id),get_country_name(country_id),
    from
    where get_item_name(item_id) in ('x','y','z')
    and get_country_name(country_id) in ('India','America','China');
    When am i trying the query by above format i am getting the wrong resultset.
    BR,
    uma

    I am not sure why your getting the wrong results but you should seriously reconsider the approach your are taking. Using functions like this is very ineffecient and should be avoided at all cost.

  • Item attributes not read by IPC

    Requirement: Pricing in Web Catalog based on Product Master Attributes. (condition records use fields from product master data. These condition record do not get calculated in the Product price displayed in the produdct catalog).
    What we have done so far
    1.     Implemented BAdI CRM_ISA_HDR_PRICING and its method NEW_ITEM_VALUES_READ for passing additional Product Master Attributes  and their values.
    2.     Activated the call of the CRM_ISA_PRICING_ITMDATA_GET function module for additional data at item level by setting the parameter u2018doItemCallsu2019= TRUE.
    This function module calls the NEW_ITEM_VALUES_READ method of the CRM_ISA_HDR_PRICING BAdI. Additional item data is transferred by implementing the NEW_ITEM_VALUES_READ method.
    3.     The NEW_ITEM_VALUES_READ method returns the additional attributes in the structure ET-ITEMATTRIBUTES.
    We have referred the SAP Note: 1004533.
    Issue:
    1.     When debugging, the method NEW_ITEM_VALUES_READ is getting executed and the table structure ET_ITEMATTRIBUTES is populated with all the additional attributes (for e.g. ZZ_VARIETY) and the corresponding values.
    2.     In the Java Session log, when IPC is reading those values from the structure ET_ITEMATTRIBUTES, just after reading the first attribute it throws an exception as shown below and exits the loop that reads the values from the structure. Thus it does not able to read the additional attributes at all.
    <<Snapshot of the error from Session Log>>
    May 22, 2009 9:56:40 AM  SAPEngine_Application_Thread[impl:3]_23 Error   com.sap.isa.backend.crm.webcatalog.pricing.PriceCalculatorCRMIPC       Error occcurred in EAI layer "".
    java.lang.ClassCastException
    java.lang.ClassCastException
                   at com.sap.isa.backend.crm.webcatalog.pricing.PriceCalculatorCRMIPC.readItemDataFromBackend(PriceCalculatorCRMIPC.java:2751)
                   at com.sap.isa.backend.crm.webcatalog.pricing.PriceCalculatorCRMIPC.getDynamicPrices(PriceCalculatorCRMIPC.java:830)
                   at com.sap.isa.backend.crm.webcatalog.pricing.PriceCalculatorCRMIPC.getPrices(PriceCalculatorCRMIPC.java:1217)
                   at com.sap.isa.businessobject.webcatalog.pricing.PriceCalculator.getPrices(PriceCalculator.java:117)
    Any ideas on why even with the parameter 'doITEMcalls=TRUE',  IPC is not able to read the item attributes?
    thanks for any useful replies.

    Is there an adobe accessibility forum where I can check
    for? I could not understand your clue.
    Do you mean if I use Panel, this problem could be solved?

  • Pass Component Name to Generic "Condition" w/o hardcoding it

    Hi, thanks in advance for your help.
    I'd like to create a generic PL/SQL "Condition" statement which references the Component Name of the component executing the Condition - without hardcoding the component name in the query. In other words, a statement which I could plug in to any component's Condition clause without hardcoding the name for each component. Is there a Substitution String, application variable or some other mechanism I can grab which has this value?
    What say ye Oracle... Can I get there from here?

    I'm not sure it does require an enhancement request, since I'm pretty sure you could code that using authorizations right now.
    For example, assuming that you have different levels of users (e.g. level 1, level 2, level 3 etc), where -
    Level 3 is the lowest level
    Level 2 can do everything level 3 can do, plus a bit more
    Level 1 can do everything level 2 can do, plus a bit more
    Then you could define a table mapping users to levels (e.g. "Joe" is level 2).
    Then in your Application you create authorization levels for Level 1, Level 2, Level 3 etc (i.e. you're specifying that a user must be at least Level 2 to see this item etc).
    You create a new item and assign it an authorization level of 'Level 2', therefore only users who are Level 2 and above will be able to see the item.
    Obviously I've missed out a huge chunk of the implementation here ;)

  • How to limit multiple condition records from printing?

    I have one condition record setup for the Ship To (i..e ZDPR) and another condition record setup for the Sold To (i.e. ZDPU).  When the delivery is created both condition records are assigned to the delivery (ZDPR and ZDPU).  Is there config that can be done so that if there is a condition record setup for the Ship To then only the Ship To condition record will be assigned to the delivery?

    HI,
    You could use condition exclusions to select only one condition (in best or worst scenario).
    Even if this does not apply, you could create a conditional clause to activate o deactivate a condition on the pricing procedure.
    Hope this help.
    Regards!

  • BPC7.5NW: Set Filters by Attributes or Hierarchies

    Hi Experts,
    When running the Data Manager Package to import Master Data, under the 'Set Selection', there's a selection "Set Filters by Attributes and Hierarchies" OR "Set Filters by Attributes or Hierarchies". May I know:
    1. What is the functionality of this selection?
    2. What is the difference between these 2 options?
    Please advise. Thanks.
    Best Regards,
    Kenneth

    Hi Kenneth,
    I noticed Attributes & Hierarchy option is working as intersection of those selections while bringing text(descriptions)
    and Attributes or Hierarchy option is working as union of those selections. So with first option there are chances that texts(evdescription) for Text nodes(which does not exist in attributes table but exist in Hierarchy as folders) missing(not transferred to BPC). So Attributes or hierarchy option is pulling everything required with both the selections(attributes condition and Hierarchy condition).
    -Kalyan.
    Edited by: Kalyan.Undavally on Jul 28, 2011 6:17 PM

  • Condition record setup

    Hello,
    Iu2019m trying to set up some pricingcondition records  using a wildcard in a z field, but it appears the search looks for an exact match e.g. if I enter AD* in the z field  then it looks for exactly AD* rather than anything that begins with AD.
    Could some one let me know if the Wildcard can be used as part of the condition record setup.
    Regards,
    Krishna

    HI,
    You could use condition exclusions to select only one condition (in best or worst scenario).
    Even if this does not apply, you could create a conditional clause to activate o deactivate a condition on the pricing procedure.
    Hope this help.
    Regards!

  • Search for description containing non-English chars -- ?

    Hello!
    I've implemented a search class, which allows customers to search folders/documents by name, owner, description, etc.
    And here's the problem: if description contains non-English (Russian, in my case) characters, search does not work! Everything (AS infrastructure, CM SDK DB, etc) was installed using UTF-8 Unicode charset. When I debug the code, I see that when I build AttributeQualification and later compose a comples SearchQualification, value in these is correct, but when I call getSQL(), I see string like this:
    ... ( nls_upper(ALIASDOCUMENT.DESCRIPTION) LIKE nls_upper('????') ) ...
    So it seems as if SQL converted passed UNICODE value into ANSI string, and since server's system language is English, my Russian letters were lost -- ?
    Can anybody shed some light here? Is there a way to search for UNICODE descriptions (and content, for that matter)?
    Thanks,
    Sasha.

    Hi Sasha,
    I want you to try the following code. It should output the file description and query to a text file. Use internet explorer / or notepad to open this file and ****specify that the file encoding is UTF8.*****
    thanks,
    matt.
    java -classpath ...blah blah.. RussianSearch parameterfile=c\cmsdkparameters.txt
    cmsdkparameters.txt contains:
    Username = system
    Password = oracle9i
    SchemaPassword = cmsdk
    Domain = ifs://ifspm-sun2.us.oracle.com:1521:mjs92.us.oracle.com:cmsdk903
    ServiceConfiguration = SmallServiceConfiguration
    Service = TestService
    import oracle.ifs.beans.LibraryService;
    import oracle.ifs.beans.LibrarySession;
    import oracle.ifs.beans.ClassObject;
    import oracle.ifs.beans.Document;
    import oracle.ifs.beans.DocumentDefinition;
    import oracle.ifs.beans.Folder;
    import oracle.ifs.beans.FolderDefinition;
    import oracle.ifs.beans.LibraryObject;
    import oracle.ifs.beans.PublicObject;
    import oracle.ifs.beans.Search;
    import oracle.ifs.beans.SearchResultObject;
    import oracle.ifs.common.IfsException;
    import oracle.ifs.common.AttributeValue;
    import oracle.ifs.common.CleartextCredential;
    import oracle.ifs.common.Credential;
    import oracle.ifs.common.ParameterTable;
    import oracle.ifs.search.AttributeQualification;
    import oracle.ifs.search.AttributeSearchSpecification;
    import oracle.ifs.search.SearchClassSpecification;
    import oracle.ifs.search.SearchSortSpecification;
    import java.io.FileOutputStream;
    import java.io.OutputStreamWriter;
    import java.io.PrintWriter;
    import java.util.Hashtable;
    import java.util.Vector;
    * Copyright (c) 2003 Oracle Corporation. All rights reserved.
    * Matt Shannon.
    * Description:
    *  Test searching in Russian Language
    *  View output file in notepad or IE - make sure to specify character
    *  set of document to be UTF8 when opening.
    public class RussianSearch implements Runnable
      // set to 'false' to prevent the class from freeing objects that it creates
      public static final boolean performCleanup = true;
      protected ParameterTable m_parametertable;
      private Vector m_ObjectsRequiringCleanup; 
      public RussianSearch(String[] args)
        // parameter file is retrieved through command line argument parameterfile=
        m_parametertable = new ParameterTable(args, "parameterfile");
      public static void main(String[] args)
        new Thread(new RussianSearch(args)).start();
       *   This is where you write your test program.
      public void run()
        LibraryService service = startService();
        LibrarySession session = establishSession(service);
        if (session == null)
          return;
        try
          DocumentDefinition ddef = new DocumentDefinition(session);
          ddef.setAttribute(PublicObject.NAME_ATTRIBUTE,
            AttributeValue.newAttributeValue("blah.txt"));
          ddef.setAttribute(PublicObject.DESCRIPTION_ATTRIBUTE,
            AttributeValue.newAttributeValue("&#1071; &#1089;&#1082;&#1091;&#1095;&#1072;&#1102; &#1087;&#1086; &#1088;&#1086;&#1076;&#1080;&#1085;&#1077;"));
          ddef.setEmptyContent();
          Document newdoc = (Document) session.createPublicObject(ddef);
          addObjectRequiringCleanup(newdoc);
          /*  Construct AttributeSearchSpecification.
           *  Attribute based conditions are allowed, context conditions are not!
          AttributeSearchSpecification attrSrchSpec =
            new AttributeSearchSpecification();
          /*  Construct SearchClassSpecification.
           *  This represents the FROM and SELECT clauses of the query.
          SearchClassSpecification srchClsSpec = new SearchClassSpecification();
          srchClsSpec.addSearchClass(Document.CLASS_NAME);      // from clause
          srchClsSpec.addResultClass(Document.CLASS_NAME);      // select clause
          /*  Construct SearchSortSpecification.
           *  This represents the ORDER BY clause of the query.
          SearchSortSpecification srchSortSpec = new SearchSortSpecification();
          //  upper case ascending sort on Name
          srchSortSpec.add(Document.CLASS_NAME, PublicObject.NAME_ATTRIBUTE,
            SearchSortSpecification.ASCENDING, "nls_upper");
          /*  AttributeQualification is a WHERE clause component representing an
           *  attribute condition.
          // scalar AttributeQualification - name like '%.html'
          AttributeQualification aq = new AttributeQualification();
          aq.setAttribute(Document.CLASS_NAME, PublicObject.DESCRIPTION_ATTRIBUTE);
          aq.setOperatorType(AttributeQualification.LIKE);
          aq.setValue("%&#1088;&#1086;&#1076;&#1080;&#1085;&#1077;");
          // set SELECT & FROM clauses
          attrSrchSpec.setSearchClassSpecification(srchClsSpec);
          // set ORDER BY clause
          attrSrchSpec.setSearchSortSpecification(srchSortSpec);
           // set WHERE clause
          attrSrchSpec.setSearchQualification(aq);
          /* Construct Search, supply SearchSpecification */
          Search s = new Search(session,attrSrchSpec);
          System.out.println("File encoding system property: "+System.getProperty("file.encoding"));
          boolean append = false;
          FileOutputStream fos = new FileOutputStream("c:/test.txt",append);
          OutputStreamWriter osw = new OutputStreamWriter(fos);
          System.out.println("Default character encoding: "+osw.getEncoding());
          osw = new OutputStreamWriter(fos,"UTF8");
          System.out.println("New character encoding: "+osw.getEncoding());
          PrintWriter out = new PrintWriter(osw,true);
          out.println(s.getSQL());
          SearchResultObject obj = null;
          // Open Search!
          s.open();
          try
             * A SearchResultObject encapsulates a row of a search result.  It
             * contains 1 or more LibraryObjects (depending on number of result
             * classes specified).
            while ( (obj = s.next()) != null )
              Document d = (Document)(obj.getLibraryObject(Document.CLASS_NAME));
              out.println(d.getName() + " " + d.getDescription());
          catch (Throwable e)
            if  ((e instanceof IfsException) &&
              (((IfsException)e).containsErrorCode(22000)))
            else
              System.out.println("Unexpected exception occurred in selector cursor");
              System.out.println((e instanceof IfsException)
                ? ((IfsException)e).toLocalizedString()
                : e.toString());
          finally
            out.close();
            if (performCleanup)
              cleanup();
            s.close();
            s.dispose();
        catch (Throwable e)
          System.out.println("Fatal exception occurred in run():");
          System.out.println((e instanceof IfsException)
            ? ((IfsException)e).toLocalizedString()
            : e.toString());
        finally
          disconnectSession(session);
      public LibraryService startService()
        String schemapassword = m_parametertable.getString("SchemaPassword");
        String domain = m_parametertable.getString("Domain");
        String servicename = m_parametertable.getString("Service",domain);
        String serviceconfiguration =
          m_parametertable.getString(
            "ServiceConfiguration","SmallServiceConfiguration"
        LibraryService service = null;
        try
          if (servicename != null &&
            LibraryService.isServiceStarted(servicename))
            // The service name was specified, and is already running.
            // So just use it.
            System.out.println("Service already running: "+servicename);
            service = LibraryService.findService(servicename);
            System.out.println("Existing service retrieved");
          else
            service = LibraryService.startService(
              servicename, schemapassword, serviceconfiguration, domain);
            System.out.println("Service started: '"+servicename+
              "' (version: "+service.getVersionString()+")");
        catch (Throwable e)
          System.out.println("Unable to start service:");
          System.out.println((e instanceof IfsException)
            ? ((IfsException)e).toLocalizedString()
            : e.toString());
        return service;
      public LibrarySession establishSession(LibraryService service)
        String username = m_parametertable.getString("Username");
        String password = m_parametertable.getString("Password");
        return establishSession(service, username, password);
      public LibrarySession establishSession
        LibraryService service,
        String username,
        String password
        LibrarySession session = null;
        try
          CleartextCredential cred = new CleartextCredential(username,
            password);
          session = establishSession(service, cred);
        catch (Throwable e)
          System.out.println("Unable to create credential:");
          System.out.println((e instanceof IfsException)
            ? ((IfsException)e).toLocalizedString()
            : e.toString());
        return session;
      public LibrarySession establishSession
        LibraryService service,
        Credential cred
        LibrarySession session = null;
        if (service != null)
          try
            String username = cred.getName();
            session = service.connect(cred, null);
            System.out.println("Session established for " + username);
          catch (Throwable e)
            System.out.println("Unable to create session:");
            System.out.println((e instanceof IfsException)
              ? ((IfsException)e).toLocalizedString()
              : e.toString());
        return session;
      public void disconnectSession(LibrarySession session)
        System.out.println("Disconnecting session");
        try
          session.disconnect();
        catch (Throwable e)
          System.out.println("Error disconnecting session:");
          System.out.println((e instanceof IfsException)
            ? ((IfsException)e).toLocalizedString()
            : e.toString());
      public void addObjectRequiringCleanup(LibraryObject lo)
        Vector v = getObjectsRequiringCleanupVector();
        v.addElement(lo);
      private Vector getObjectsRequiringCleanupVector()
        if (m_ObjectsRequiringCleanup == null)
          m_ObjectsRequiringCleanup = new Vector();
        return m_ObjectsRequiringCleanup;
       * Frees objects that were marked as requiring clean up
      public void cleanup()
        Vector v = getObjectsRequiringCleanupVector();
        System.out.println("Cleanup - delete objects created during the session");
        int count = (v == null) ? 0 : v.size();
        System.out.println("# of objects to free: "+count);
        // Free the objects in reverse order from which they were added
        for (int i = count - 1; i >= 0; i--)
          LibraryObject lo = (LibraryObject)v.elementAt(i);
          try
            discardObject(lo);
          catch (Exception e)
            System.out.println("Unable to discard an object during cleanup - continuing...");
      public void discardObject(LibraryObject lo) throws IfsException
        if (lo != null)
          try
            System.out.println("Attempting to free: "+getDisplayName(lo));
            LibrarySession session = lo.getSession();
            if (lo instanceof Folder)
              System.out.println("Attempting to free Folder with Deep Option!");
              // free Folder using "Deep" option to free
              // all items in the folder, and all of their items, etc.
              Folder folder = (Folder)lo;
              FolderDefinition def = new FolderDefinition(session);
              def.setFolderDepthOption(
                Folder.SYSTEMOPTIONVALUE_FOLDER_DEPTH_DEEPEST);
              folder.free(def); // removes object from the repository, with options
            else
              // just a regular free
              lo.free();
          catch (Exception e)
            System.out.println("Unable to free an object during cleanup - continuing");
            System.out.println((e instanceof IfsException)
              ? ((IfsException)e).toLocalizedString()
              : e.toString());
      public String getDisplayName(LibraryObject lo)
        throws IfsException
        String displayName;
        if (lo != null)
          displayName = lo.getClassObject().getName()
            + " '" + lo.getName() + "'";
        else
          displayName = "<null object>";
        return displayName;
    }

Maybe you are looking for

  • Not able to open a downloaded file - paint??

    I cannot open a file downloaded in Adobe.  This is the error message:  "Paint cannot read this file.  This is not a valid bitmap file, or its format is not currently supported."  I get the same message when I try to open saved adobe files or files th

  • Why can't i sync my music from computer to iPhone4s?

    i download a new music into my itunes library, and when i'm trying to sync the music to my phone it shows "The phone could not be synced because the sync session failed to start". What should i do to fix this??

  • Variable has no value when executing a scenario

    Hi, I have a simple package consists of two steps: 1. Refresh a variable "V_FILENAME_D501" to get the value inputted from user. The refreshing statement is "select '#V_FILENAME_D501' and it is running in a SQLServer environment. 2. Execute an interfa

  • Please i just want to know what i can do

    hey i bought an i pod mini used for 80 bucks from a friend it worked fine for a week then it broke the buttons stopped working so i opened it up because hey its not under waranty any right so i saw that the strip that connects button pad consel to th

  • HTML snippet to make a Page within a Page through link

    I am trying to create a html snippet the opens within one of my pages each time a link on the left side of the page is selected. It's for a team page - each time a user click on an employees name, I want the content to open in within an iframe on tha