Understanding Scope

Hi all,
I'm having a little difficulty understanding scope. In particular take a look at the following example:
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
I understand that ToolKit is an abstract class and that getDefaultToolkit() is a static method. What I don't understand is how you can call the getScreenSize() from the getDefaultToolkit() using the "." notation.
Why can't you just go Toolkit.getScreenSize(); ?
I tried compiling both and in the latter, i got the following error:
SwingingPad.java:32: non-static method getScreenSize() cannot be referenced from
a static context
Dimension screenSize = Toolkit.getScreenSize();
^
1 error
This has kind of given me the idea that I was wrong in thinking that getDefaultToolkit() was a static method, but is actually a static class. Would this be the reason why you could call the getScreenSize() as it is a method within the static inner class?
Can anyone point me in the right direction?
cheers

I understand that ToolKit is an abstract class and
that getDefaultToolkit() is a static method. What I
don't understand is how you can call the
getScreenSize() from the getDefaultToolkit() using the
"." notation. The line Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize() is short for Toolkit tk = Toolkit.getDefaultToolkit();
Dimension screenSize = tk.getScreenSize();You must have an instance of Toolkit to use getScreenSize() and you use getDefaultToolkit() to get the default (for your system) Toolkit instance.
Why can't you just go Toolkit.getScreenSize(); ? Because the screen size is an instance variable of a Toolkit.

Similar Messages

  • Understanding scope of functions in powershell workflow

    Copy and paste the following into a new Powershell ISE script and hit F5:
    workflow workflow1{
    "in workflow1"
    func1
    function func1 {
    "in func1"
    func2
    function func2 {
    "in func2"
    workflow1
    the error I get is:
    The term 'func2' is not recognized as the name of a cmdlet, function, script file, or operable program
    I don't understand this. Why would func1 be in scope but not func2? Any help much appreciated. TIA.

    Hi guys,
    I had a similar conversation over on SO: Understanding
    scope of functions in powershell workflow
    I'll say here what I said there:
    To vaguely summarise all the responses, don't question why it behaves this way, just accept that it does and deal with it. Fair enough.
    I've written a whole deployment pipeline in none-workflow Powershell and I'd like to optimise it by using workflow's "foreach -parallel" however it seems the tax on doing so is that I'd have to go back and re-write the whole thing in workflow. That's
    too big a tax to pay unfortunately just to get a parallel foreach loop.
    Lesson learned - use Powershell workflow from the get-go.
    Corallary #1 - Understand the technology before using it.  It saves you from future pain.
    ¯\_(ツ)_/¯

  • Upgraded to SP 2013 - Scope Rules are empty

    Hi,
    We upgraded to SP 2013 enterprise from sharepoint 2010 and this involved upgrading the search admin database as well.
    I believe search scopes that was migrated from SP 2010 are available as read-only but the item count in rule shows error. I have run full crawl and there are items in the index but my custom search scopes are failing because the rules has no items.
    Is this a known issue in SP 2010 to SP 2013 migration of search service?
    Regards,
    Manoj
    "The opinions expressed here represent my own and not those of anybody else"

    Thank you for the reply.
    I understand scopes are not supported in 2013 but they are available if your site is in 2010 mode and our sites are upgraded and all are in 2010 mode on our 2013 farm. But I believe scopes that existed in the migrated sites would work if you keep them in
    2010 mode in the 2013 farm?
    Update: I observed that this happens when we have content types in rules and that too not oob content types but the ones we created by deriving from oob content types. There is no custom coding involved in these just that we had content type we created,
    for example, for project type documents. If I create a custom scope on my site in 2013 farm which is in 2010 mode it shows item count in the scope and I have added a rule to a custom library. But if I edit that scope and add a rule to include my content type
    the item count is error and total count also shows error!
    Regards,
    Manoj
    "The opinions expressed here represent my own and not those of anybody else"

  • Passing arraylist between constructors?

    Hi guys,
    I've pretty new to java, and I think i'm having a little trouble
    understanding scope. The program I'm working on is building a jtree
    from an xml file, to do this an arraylist (xmlText) is being built and
    declared in the function Main. It's then called to an overloaded
    constructor which processes the XML into a jtree:
    public Editor( String title, ArrayList xmlText ) throws
    ParserConfigurationException
    Later, in the second constructor which builds my GUI, I try and call
    the same arraylist so I can parse this XML into a set of combo boxes,
    but get an error thrown up at me that i'm having a hard time solving- :
    public Editor( String title ) throws ParserConfigurationException
    // additional code
    // Create a read-only combobox- where I get an error.
    String [] items = (String []) xmlText.toArray (new String[
    xmlText.size () ]);
    JComboBox queryBox = new JComboBox(items);
    JComboBox queryBox2 = new JComboBox(items);
    JComboBox queryBox3 = new JComboBox(items);
    JComboBox queryBox4 = new JComboBox(items);
    JComboBox queryBox5 = new JComboBox(items);
    This is the way I understand the Arraylist can be converted to a string
    to use in the combo boxs. However I get an error thrown up at me here
    at about line 206, which as far as I understand, is because when the
    overloaded constructor calls the other constructor:
    public Editor( String title ) throws ParserConfigurationException -
    It does not pass in the variable xmlText.
    I'm told that the compiler complains because xmlText is not defined
    at that point:
    - it is not a global variable or class member
    - it has not been passed into the function
    and
    - it has not been declared inside the current function
    Can anyone think of a solution to this problem? As I say a lot of this
    stuff is still fairly beyond me, I understand the principles behind the
    language and the problem, but the solution has been evading me so far.
    If anyone could give me any help or a solution here I'd be very
    grateful- I'm getting totally stressed over this.
    The code I'm working on is below, I've highlighted where the error
    crops up too- it's about line 200-206 area. Sorry for the length, I was
    unsure as to how much of the code I should post.
    public class Editor extends JFrame implements ActionListener
    // This is the XMLTree object which displays the XML in a JTree
    private XMLTree XMLTree;
    private JTextArea textArea, textArea2, textArea3;
    // One JScrollPane is the container for the JTree, the other is for
    the textArea
    private JScrollPane jScroll, jScrollRt, jScrollUp,
    jScrollBelow;
    private JSplitPane splitPane, splitPane2;
    private JPanel panel;
    // This JButton handles the tree Refresh feature
    private JButton refreshButton;
    // This Listener allows the frame's close button to work properly
    private WindowListener winClosing;
    private JSplitPane splitpane3;
    // Menu Objects
    private JMenuBar menuBar;
    private JMenu fileMenu;
    private JMenuItem newItem, openItem, saveItem,
    exitItem;
    // This JDialog object will be used to allow the user to cancel an exit
    command
    private JDialog verifyDialog;
    // These JLabel objects will be used to display the error messages
    private JLabel question;
    // These JButtons are used with the verifyDialog object
    private JButton okButton, cancelButton;
    private JComboBox testBox;
    // These two constants set the width and height of the frame
    private static final int FRAME_WIDTH = 600;
    private static final int FRAME_HEIGHT = 450;
    * This constructor passes the graphical construction off to the
    overloaded constructor
    * and then handles the processing of the XML text
    public Editor( String title, ArrayList xmlText ) throws
    ParserConfigurationException
    this( title );
    textArea.setText( ( String )xmlText.get( 0 ) + "\n" );
    for ( int i = 1; i < xmlText.size(); i++ )
    textArea.append( ( String )xmlText.get( i ) + "\n" );
    try
    XMLTree.refresh( textArea.getText() );
    catch( Exception ex )
    String message = ex.getMessage();
    System.out.println( message );
    }//end try/catch
    } //end Editor( String title, String xml )
    * This constructor builds a frame containing a JSplitPane, which in
    turn contains two
    JScrollPanes.
    * One of the panes contains an XMLTree object and the other contains
    a JTextArea object.
    public Editor( String title ) throws ParserConfigurationException
    // This builds the JFrame portion of the object
    super( title );
    Toolkit toolkit;
    Dimension dim, minimumSize;
    int screenHeight, screenWidth;
    // Initialize basic layout properties
    setBackground( Color.lightGray );
    getContentPane().setLayout( new BorderLayout() );
    // Set the frame's display to be WIDTH x HEIGHT in the middle of
    the screen
    toolkit = Toolkit.getDefaultToolkit();
    dim = toolkit.getScreenSize();
    screenHeight = dim.height;
    screenWidth = dim.width;
    setBounds( (screenWidth-FRAME_WIDTH)/2,
    (screenHeight-FRAME_HEIGHT)/2, FRAME_WIDTH,
    FRAME_HEIGHT );
    // Build the Menu
    // Build the verify dialog
    // Set the Default Close Operation
    // Create the refresh button object
    // Add the button to the frame
    // Create two JScrollPane objects
    jScroll = new JScrollPane();
    jScrollRt = new JScrollPane();
    // First, create the JTextArea:
    // Create the JTextArea and add it to the right hand JScroll
    textArea = new JTextArea( 200,150 );
    jScrollRt.getViewport().add( textArea );
    // Next, create the XMLTree
    XMLTree = new XMLTree();
    XMLTree.getSelectionModel().setSelectionMode(
    TreeSelectionModel.SINGLE_TREE_SELECTION
    XMLTree.setShowsRootHandles( true );
    // A more advanced version of this tool would allow the JTree to
    be editable
    XMLTree.setEditable( false );
    // Wrap the JTree in a JScroll so that we can scroll it in the
    JSplitPane.
    jScroll.getViewport().add( XMLTree );
    // Create the JSplitPane and add the two JScroll objects
    splitPane = new JSplitPane( JSplitPane.HORIZONTAL_SPLIT, jScroll,
    jScrollRt );
    splitPane.setOneTouchExpandable(true);
    splitPane.setDividerLocation(200);
    jScrollUp = new JScrollPane();
    jScrollBelow=new JScrollPane();
    // Here is were the error is coming up
    String [] items = (String []) xmlText.toArray (new String[
    xmlText.size () ]);
    JComboBox queryBox = new JComboBox(items);
    JComboBox queryBox2 = new JComboBox(items);
    JComboBox queryBox3 = new JComboBox(items);
    JComboBox queryBox4 = new JComboBox(items);
    JComboBox queryBox5 = new JComboBox(items);
    * I'm adding the scroll pane to the split pane,
    * a panel to the top of the split pane, and some uneditible
    combo boxes
    * to them. Then I'll rearrange them to rearrange them, but
    unfortunately am getting an error thrown up above.
    panel = new JPanel();
    panel.add(queryBox);
    panel.add(queryBox2);
    panel.add(queryBox3);
    panel.add(queryBox4);
    panel.add(queryBox5);
    jScrollUp.getViewport().add( panel );
    // Now building a text area
    textArea3 = new JTextArea(200, 150);
    jScrollBelow.getViewport().add( textArea3 );
    splitPane2 = new JSplitPane(JSplitPane.VERTICAL_SPLIT,
    jScrollUp, jScrollBelow);
    splitPane2.setPreferredSize( new Dimension(300, 200) );
    splitPane2.setDividerLocation(100);
    splitPane2.setOneTouchExpandable(true);
    // in here can change the contents of the split pane
    getContentPane().add(splitPane2,BorderLayout.SOUTH);
    // Provide minimum sizes for the two components in the split pane
    minimumSize = new Dimension(200, 150);
    jScroll.setMinimumSize( minimumSize );
    jScrollRt.setMinimumSize( minimumSize );
    // Provide a preferred size for the split pane
    splitPane.setPreferredSize( new Dimension(400, 300) );
    // Add the split pane to the frame
    getContentPane().add( splitPane, BorderLayout.CENTER );
    //Put the final touches to the JFrame object
    validate();
    setVisible(true);
    // Add a WindowListener so that we can close the window
    winClosing = new WindowAdapter()
    public void windowClosing(WindowEvent e)
    verifyDialog.show();
    addWindowListener(winClosing);
    } //end Editor()
    * When a user event occurs, this method is called. If the action
    performed was a click
    * of the "Refresh" button, then the XMLTree object is updated using
    the current XML text
    * contained in the JTextArea
    public void actionPerformed( ActionEvent ae )
    if ( ae.getActionCommand().equals( "Refresh" ) )
    try
    XMLTree.refresh( textArea.getText() );
    catch( Exception ex )
    String message = ex.getMessage();
    ex.printStackTrace();
    }//end try/catch
    else if ( ae.getActionCommand().equals( "OK" ) )
    exit();
    else if ( ae.getActionCommand().equals( "Cancel" ) )
    verifyDialog.hide();
    }//end if/else if
    } //end actionPerformed()
    // Program execution begins here. An XML file (*.xml) must be passed
    into the method
    public static void main( String[] args )
    String fileName = "";
    BufferedReader reader;
    String line;
    ArrayList xmlText = null;
    Editor Editor;
    // Build a Document object based on the specified XML file
    try
    if( args.length > 0 )
    fileName = args[0];
    if ( fileName.substring( fileName.indexOf( '.' ) ).equals(
    ".xml" ) )
    reader = new BufferedReader( new FileReader( fileName )
    xmlText = new ArrayList();
    while ( ( line = reader.readLine() ) != null )
    xmlText.add( line );
    } //end while ( ( line = reader.readLine() ) != null )
    // The file will have to be re-read when the Document
    object is parsed
    reader.close();
    // Construct the GUI components and pass a reference to
    the XML root node
    Editor = new Editor( "Editor 1.0", xmlText );
    else
    help();
    } //end if ( fileName.substring( fileName.indexOf( '.' )
    ).equals( ".xml" ) )
    else
    Editor = new Editor( "Editor 1.0" );
    } //end if( args.length > 0 )
    catch( FileNotFoundException fnfEx )
    System.out.println( fileName + " was not found." );
    exit();
    catch( Exception ex )
    ex.printStackTrace();
    exit();
    }// end try/catch
    }// end main()
    // A common source of operating instructions
    private static void help()
    System.out.println( "\nUsage: java Editor filename.xml" );
    System.exit(0);
    } //end help()
    // A common point of exit
    public static void exit()
    System.out.println( "\nThank you for using Editor 1.0" );
    System.exit(0);
    } //end exit()
    class newMenuHandler implements ActionListener
    public void actionPerformed( ActionEvent ae )
    textArea.setText( "" );
    try
    // Next, create a new XMLTree
    XMLTree = new XMLTree();
    XMLTree.getSelectionModel().setSelectionMode(
    TreeSelectionModel.SINGLE_TREE_SELECTION );
    XMLTree.setShowsRootHandles( true );
    // A more advanced version of this tool would allow the JTree
    to be editable
    XMLTree.setEditable( false );
    catch( Exception ex )
    String message = ex.getMessage();
    ex.printStackTrace();
    }//end try/catch
    }//end actionPerformed()
    }//end class newMenuHandler
    class openMenuHandler implements ActionListener
    JFileChooser jfc;
    Container parent;
    int choice;
    openMenuHandler()
    super();
    jfc = new JFileChooser();
    jfc.setSize( 400,300 );
    jfc.setFileFilter( new XmlFileFilter() );
    parent = openItem.getParent();
    }//end openMenuHandler()
    public void actionPerformed( ActionEvent ae )
    // Displays the jfc and sets the dialog to 'open'
    choice = jfc.showOpenDialog( parent );
    if ( choice == JFileChooser.APPROVE_OPTION )
    String fileName, line;
    BufferedReader reader;
    fileName = jfc.getSelectedFile().getAbsolutePath();
    try
    reader = new BufferedReader( new FileReader( fileName ) );
    textArea.setText( reader.readLine() + "\n" );
    while ( ( line = reader.readLine() ) != null )
    textArea.append( line + "\n" );
    } //end while ( ( line = reader.readLine() ) != null )
    // The file will have to be re-read when the Document
    object is parsed
    reader.close();
    XMLTree.refresh( textArea.getText() );
    catch ( Exception ex )
    String message = ex.getMessage();
    ex.printStackTrace();
    }//end try/catch
    jfc.setCurrentDirectory( new File( fileName ) );
    } //end if ( choice == JFileChooser.APPROVE_OPTION )
    }//end actionPerformed()
    }//end class openMenuHandler
    class saveMenuHandler implements ActionListener
    JFileChooser jfc;
    Container parent;
    int choice;
    saveMenuHandler()
    super();
    jfc = new JFileChooser();
    jfc.setSize( 400,300 );
    jfc.setFileFilter( new XmlFileFilter() );
    parent = saveItem.getParent();
    }//end saveMenuHandler()
    public void actionPerformed( ActionEvent ae )
    // Displays the jfc and sets the dialog to 'save'
    choice = jfc.showSaveDialog( parent );
    if ( choice == JFileChooser.APPROVE_OPTION )
    String fileName;
    File fObj;
    FileWriter writer;
    fileName = jfc.getSelectedFile().getAbsolutePath();
    try
    writer = new FileWriter( fileName );
    textArea.write( writer );
    // The file will have to be re-read when the Document
    object is parsed
    writer.close();
    catch ( IOException ioe )
    ioe.printStackTrace();
    }//end try/catch
    jfc.setCurrentDirectory( new File( fileName ) );
    } //end if ( choice == JFileChooser.APPROVE_OPTION )
    }//end actionPerformed()
    }//end class saveMenuHandler
    class exitMenuHandler implements ActionListener
    public void actionPerformed( ActionEvent ae )
    verifyDialog.show();
    }//end actionPerformed()
    }//end class exitMenuHandler
    class XmlFileFilter extends javax.swing.filechooser.FileFilter
    public boolean accept( File fobj )
    if ( fobj.isDirectory() )
    return true;
    else
    return fobj.getName().endsWith( ".xml" );
    }//end accept()
    public String getDescription()
    return "*.xml";
    }//end getDescription()
    }//end class XmlFileFilter
    } //end class Editor
    Sorry if this post has been a bit lengthy, any help you guys could give
    me solving this would be really appreciated.
    Thanks,
    Iain.

    Hey. Couple pointers:
    When posting, try to keep code inbetween code tags (button between spell check and quote original). It will pretty-print the code.
    Posting code is good. Usually, though, you want to post theminimum amount of code which runs and shows your problem.
    That way people don't have to wade through irrelevant stuff and
    they have an easier time helping.
    http://homepage1.nifty.com/algafield/sscce.html
    As for your problem, this is a scope issue. You declare an
    ArrayList xmlText in main(). That means that everywhere after
    the declaration in main(), you can reference your xmlText.
    So far so good. Then, inside main(), you call
    Editor = new Editor( "Editor 1.0", xmlText );Now you've passed the xmlText variable to a new method,
    Editor(String title, ArrayList xmlText) [which happens to be a
    constructor, but that's not important]. When you do that, you
    make the two variables title and xmlText available to the whole
    Editor(String, ArrayList) method.
    This is where you get messed up. You invoke another method
    from inside Editor(String, ArrayList). When you call
    this(title);you're invoking the method Editor(String title). You aren't passing
    in your arraylist, though. You've got code in the Editor(String) method
    which is trying to reference xmlText, but you'd need to pass in
    your ArrayList in order to do so.
    My suggestion would be to merge the two constructor methods into
    one, Editor(String title, ArrayList xmlText).

  • Problem with checkbox on table component

    Hello i am having a problem with checkbox in table component
    i am developing something like a shopping cart app and i have a checkbox in my table component , i want users to select items from the checkbox to add to thier cart, They can select the items from cartegory combobox , my problem is when they select the items from the checkbox if they select another category the alread selected once do not display in my collection opbject please how can i maintain the state of the already selected items in my collection object

    Hi,
    Please go through the tutorial "Understanding scope and managed beans". This is available at:
    http://developers.sun.com/prodtech/javatools/jscreator/learning/tutorials/2/scopes.html
    The details of the selected items need to be stored in an object that is in session scope.
    Hope this helps
    Cheers
    Girish

  • Passing Parameters and Retrieving them

    Hi,
    I am trying to learn the JSC2 IDE.Would like to pass a parameter from all my JSP pages.I will have to retrieve this parameter and use it for further processing.I have two things here.
    1.How to pass parameters from say from a hyperlink.
    2.How to retrieve them and use it fro further processing.
    Hope to hear from you.
    Thanks.
    ramdsp.

    Hi,
    Go through the tutorials "Sharing Data Between Two
    Pages" and "Understanding Scope and Managed Beans".
    These are available at:
    http://developers.sun.com/prodtech/javatools/jscreator
    /learning/tutorials/index.jsp
    These should be of help to you
    Cheers
    GirishI do understand how to share data between two pages!
    I just don�t know (the best way) to keep request variables between multiple requests (without using session variables).
    Question: What would happen if I had one button on the last page of the tutorial "Sharing Data between Two Pages". I mean, that button would make a post on the same page and would try to get data from the request bean (which does not exist anymore).
    Best regards,
    Nuno Ferreira

  • Comparing two variables with if statements

    I'm working with 2 global variables and I need to compare them on 6 different button function clicks for a lot of different scenarios.
    Here is an example of what I have for 1 button:
    my Btn.onPress = function() {
    _global.firstVar = 19;
    _global.firstYear =2009;
    _root.checkAll();
    My function is starting to look like this;
    if ((_global.firstVar == 19) && (_global.firstYear == 2009)){     (first...is this the correct way to write this statement with the && to compare?)
      gotoAndStop(8);
      trace("itworks")
      loadMovie("mymovie.swf", 1);
    else if..........
    only problem i see is that there are many different scenarios and this if statement could get very long.
    Is there a way to combine it somehow so there wouldn't be that many else if's?

    That is most likely the way to write it, but I have the feeling that you are making it much more complex than it needs to be. What are you actually trying to do?
    How are firstVar and firstYear being set? Can they be any number at all or just some specific ones?
    Using _global variables isn't really a best practice and should only be done the most unusual of circumstances. There are some tricky things about the _global object. Generally they are just a shortcut for getting around scope problems, but if you have those problems it is better to work them out and understand scope that to just put everything in _global. In AS3, the _global object has gone away—unless you make your own....
    Also depending upon what you are doing with the loading of the swf, you probably should look into using the MovieClipLoader instead of a loadMovie. With loadMovie there is no easy way to know when the clip has finished loading, unless you write your own preloader code. With the MovieClipLoader class there is a nice simple event called onInit. You can also use the onLoadProgress event to know how much of your external asset has loaded.
    Also using gotoAndStop(8) or some other number is likely to become confusing later down the line. You might want to use labels and names. If you have a lot of different scenarios then maybe give them names. That way if the timeline changes or you come back in 3 months it will generally be easier to track down:
    gotoAndStop('midYearReviewScenario")
    rather than
    gotoAndStop(14);
    Just a suggestion from years' of experiences.
    And finally I'm with Ned. Generally for buttons onRelease is a better event to do navigation and other results things that happen upon a click. onPress is really for things where you need to press and hold the button.

  • Regarding SAP EH & S Module (Environment Health & Safety)

    Helo All.
    Can anyone guide me about the EH & S module with respect to
    Scope, opportunities, information resources.

    There is documentation about this in SAP Help
    [EH&S|http://help.sap.com/saphelp_ehs27b/helpdata/en/A5/3ADD4643BE11D188FE0000E8322F96/frameset.htm]
    The [business map |https://www.sdn.sap.com/irj/sdn/bpx-miningmetal?rid=/business_maps/guid/eg1slxvyat1odhrwoi8vzxn3b3jrcgxhy2uuc2fwlmnvbs9zb2nvdmlldy9ty3bnzxquyxnw%0d%0ap3bhy2thz2vpzd0mdmlldz1zbwnyzw5kzxiyjmlkptmzreu3qkjcqtuwnjrfmtfbquiyrtk4rjew%0d%0aqjg0mzrfjiz4c2wtymfzzt1odhrwoi8vzxn3b3jrcgxhy2uuc2fwlmnvbs9zb2nvdmlldy9ty3bn%0d%0azxrfbwltzs5hc3a/dxjspxnkbl9uzxcvjiz3zwitdxjspwh0dhbzoi8vzxn3b3jrcgxhy2uuc2fw%0d%0almnvbs9zb2nvdmlldy9ty3bnzxrfbwltzs5hc3a/dxjspsymehnslwxpc3q9c2rux2dlbmvyywxf%0d%0acmvuzgvylnhzbhq7c2rux2xpbmtyzxdyaxrpbmcuehnsddtnzw5lcmf0zuhutuxfu0rolnhzbhqm%0d%0ajnbhy2thz2utawq9jizyzxnvdxjjzxr5cgu9c2rux3nvbhv0aw9ux2nvbxbvc2vyx2z1bgxwywdl%0d%0ajizwyxjlbnrssuq9l2j1c2luzxnzx21hchmvnkjfody2rjk5oeiwney4njlbnzc4mzm4mungqtcx%0d%0anzavnzzcrtrfrjm3ruq3nde0mefenemymtm0qtzdody3njevrjvbrtm5mjc4mue1ndjgqujfqzi3%0d%0amjheouiyrtrfntyvrjazqtm4qtyzm0rdndnfm0iwnzu3ruu0qkfeotyyn0yvn0uymzk4oeferddd%0d%0anei5mjg5mdjeouzcoumwreyzq0mueg1sjiz0axrszt1db21wbglhbmnlie1hbmfnzw1lbnqgkevi%0d%0ajlmpwqamjnzpcnr1yww9dhj1zq==&prtmode=default]is also helpful in understanding scope.
    You can also get a good overview on the [Techidata website for EH&S|http://www.technidata-america.com/sap_us/iisstart.php]
    Lastly from an SAP perspective of solutions you might want to check out info [here|http://www.sap.com/solutions/business-suite/erp/environment-health-and-safety-software/index.epx]

  • Understanding SharePoint Security Scope

    What is a Security scope in Sharepoint?
    a) Number of times we break inheritance
    or
    b) each time you grant access to a new principal (user account or group) then you are creating a new Security Scope?

    Sonal
    Security Scope is just a term used to describe a situation - it has no physical significance, meaning, it is not a specific setting that you configure. 
    For example, if I create new security groups for a site, and grant them some permission level (eg, Contribute, Read, etc), then I have effectively configured the "Security Scope" for that site.  If I create a subsite off of this
    one, break its permissions inheritance, and configure new groups for it, I have effectively configured its "Security Scope".  If I now create a list in this subsite, add some items, break the list's permissions inheritance from the subsite,
    and configure some users or groups for accessing this list, I have effectively configured the list's "Security Scope." Thus, "Security Scope" is a term that describes boundaries, so to speak.
    The key thing here is how the "Scope" of a security configuration, such as granting a user or group some permission, narrows as you go from doing this for a site down to doing this for a list or even a list item.  A user or group that is granted
    permission to read only a single item in a list can only see that one item in the list and cannot see anything else.  Nor does that permission enable the user or group to read list items in other lists.  Thus, the "Scope"
    of that security settings is very narrow.

  • Help understanding Global scope

    I have a formula "Access plus modified"-
    Global recordcount;
    whilereadingrecords;
    recordcount = recordcount+1;
    if {SRMFILE.ACCESSTIME} < {?Last accessed } AND
    {SRMFILE.WRITETIME} < {?Last Modified}
    AND
    {SRMFILESYSTEM.FILESYSTEMDEVICE} IN filesystemdevice
    THEN
    (parentdir := {SRMFILE.PARENTDIR};
    accesstime := {SRMFILE.ACCESSTIME};
    writetime := {SRMFILE.WRITETIME};
    currentfilename := {SRMFILE.FILENAME};
    fileactualsize := {SRMFILE.ACTUALSIZE}/1024/1024;
    thisfilesystemdevice := {SRMFILESYSTEM.FILESYSTEMDEVICE};
    In a following formula i want to display the number of records (recordcount)
    Evaluateafter ({@Access plus Modified});
    recordcount;
    But in formula editor i get an error unless i define recordcount again as
    Global numbervar recordcount;
    and then the count is zero.
    I thought Global forces a variable to be visible throughout the report?

    Carl, the fields on m y report are the ones calculated in the IF logic :-
    parentdir := {SRMFILE.PARENTDIR};
    accesstime := {SRMFILE.ACCESSTIME};
    writetime := {SRMFILE.WRITETIME};
    currentfilename := {SRMFILE.FILENAME};
    fileactualsize := {SRMFILE.ACTUALSIZE}/1024/1024;
    thisfilesystemdevice := {SRMFILESYSTEM.FILESYSTEMDEVICE};
    recordcount := recordcount+1;
    Each variable in the IF logic is further defined by another formula i.e. :-
    EvaluateAfter ({@Access plus Modified});
    StringVar currentfilename;
    currentfilename;
    The formulas for each varioable are then  defined in the details section.
    This is a small sample of the report :-
    FilesystemDevice     Actual size(GB)     Access      ParentDir     Recordcount
    /dev/vx/dsk/dvgy322/db2     0.00     7/15/2006  9:36:30 PM     /db2/pdid322/sqllib/     1.00
    /dev/vx/dsk/dvgy322/db2     0.00     7/15/2006  9:36:30 PM     /db2/pdid322/sqllib/     1.00
    /dev/vx/dsk/dvgy322/db2     0.00     7/15/2006  9:36:30 PM     /db2/pdid322/sqllib/     1.00
    /dev/vx/dsk/dvgy322/db2     0.00     7/15/2006  9:36:30 PM     /db2/pdid322/sqllib/     1.00
    /dev/vx/dsk/dvgy322/db2     0.00     7/15/2006  9:36:30 PM     /db2/pdid322/sqllib/     1.00
    /dev/vx/dsk/dvgy322/db2     0.00     7/15/2006  9:36:30 PM     /db2/pdid322/sqllib/     1.00
    /dev/vx/dsk/dvgy322/db2     0.00     7/15/2006  9:36:30 PM     /db2/pdid322/sqllib/     1.00
    /dev/vx/dsk/dvgy322/db2     0.00     7/15/2006  9:36:30 PM     /db2/pdid322/sqllib/     1.00
    /dev/vx/dsk/dvgy322/db2     0.00     7/19/2006  8:08:08 PM     /db2/pdid322/piris00q/dbbackup/     2.00
    /dev/vx/dsk/dvgy322/db2     0.00     7/15/2006  9:38:48 PM     /db2/pdid322/sqllib/hmonCache/pdid322/     3.00
    /dev/vx/dsk/dvgy322/db2     0.00     7/15/2006  9:38:48 PM     /db2/pdid322/sqllib/hmonCache/pdid322/     3.00
    /dev/vx/dsk/dvgy322/db2     0.00     7/15/2006  9:38:48 PM     /db2/pdid322/sqllib/hmonCache/pdid322/     3.00
    /dev/vx/dsk/dvgy322/db2     0.00     7/15/2006  9:38:48 PM     /db2/pdid322/sqllib/hmonCache/pdid322/     3.00
    /dev/vx/dsk/dvgy322/db2     0.00     7/15/2006  9:38:48 PM     /db2/pdid322/sqllib/hmonCache/pdid322/     3.00
    You will see that "recordcount" stays at 1 for many of the "duplicate" entries. Then moves to 2 for a single record, then 3 for many.
    Thanks John

  • Problem with beans in session scope

    Hello,
    I developped a website using JSP/Tomcat and I can't figure out how to fix this problem.
    I am using beans in session scope to know when a user is actualy logged in or not and to make some basic informations about him avaible to the pages. I then add those beans to an application scope bean that manages the users, letting me know how many are logged in, etc... I store the user beans in a Vector list.
    The problem is that the session beans never seem to be destroyed. I made a logout page which use <jsp:remove/> but all it does is to remove the bean from the scope and not actualy destroying it. I have to notify the application bean that the session is terminated so I manualy remove it from its vector list.
    But when a user just leave the site without using the logout option, it becomes a problem. Is there a way to actualy tell when a session bean is being destroyed ? I tried to check with my application bean if there are null beans in the list but it never happens, the user bean always stays in memory.
    Is there actualy a way for me to notify the application bean when the user quits the website without using the logout link ? Or is the whole design flawed ?
    Thanks in advance.
    Nicolas Jaccard

    I understand I could create a listener even with my current setup Correct, you configure listeners in web.xml and they are applicable to a whole web application irrespective of whether you use jsp or servlets or both. SessionListeners would fire when a session was created or when a session is about to be dropped.
    but I do not know how I could get a reference of the application bean in >question. Any hint ?From your earlier post, I understand that you add a UserBean to a session and then the UserBean to a vector stoed in application scope.
    Something like below,
    UserBean user = new UserBean();
    //set  bean in session scope.
    session.setAttribute("user", user);
    //add bean to a Vector stored in application scope.
    Vector v = (Vector)(getServletContext().getAttribute("userList"));
    v.add(user);If you have done it in the above fashion, you realize, dont you, that its the same object that's added to both the session and to the vector stored in application scope.
    So in your sessionDestroyed() method of your HttpSessionListener implementation,
    void sessionDestroyed(HttpSessionEvent event){
         //get a handle to the session
         HttpSession session = event.getSession();
          //get a handle to the user object
          UserBean user = (UserBean)session.getAttribute("user");
           //get a handle to the application object
          ServletContext ctx = session.getServletContext();
           //get a handle to the Vector storing the user objs in application scope
            Vector v = (Vector)ctx.getAttribute("userList");
           //now remove the object from the Vector passing in the reference to the object retrieved from the Session.
            v.removeElement(user);
    }That's it.
    Another approach would be to remove the User based on a unique identifier. Let's assume each User has a unique id (If your User has no such feature, you could still add one and set the user id to the session id that the user is associated with)
    void sessionDestroyed(HttpSessionEvent event){
         //get a handle to the session
         HttpSession session = event.getSession();
          //get a handle to the user object
          UserBean user = (UserBean)session.getAttribute("user");
           //get the unique id of the user object
           String id = user.getId();
           //get a handle to the application object
          ServletContext ctx = session.getServletContext();
           //get a handle to the Vector storing the user objs in application scope
            Vector v = (Vector)ctx.getAttribute("userList");
           //now iterate all user objects in the Vector
           for(Iterator itr = v.iterator(); itr.hasNext()) {
                   User user = (User)itr.next();               
                    if(user.getId().equals(id)) {
                           //if user's id is same as id of user retrieved from session
                           //remove the object
                           itr.remove();
    }Hope that helps,
    ram.

  • How to understand the strange parameter values shown by 'pstack core'

    I encounterred a problem that led to a core dump. I use 'pstack core' to shown the calling stack.
    However I could hardly understand some of the parameter values below:
    core 'core.150108' of 5016:     cmcfun
    ff1e1370 __1cLComEndPointFsendv6MpnFiovec_i_i_ (c, ffbfedf8, 2, 2, c, 0) + 4
    Why did the 'this' pointer of the instance of class ComEndPoint become 0xc? I don't think it is a valid value of pointer. Does anybody have any idea about this problem?
    ff1e5b00 __1cYComTransaction_Icallback6FpnPpdo_transaction_pcii_v_ (6ab90, 0, 0, 0, ffbff1b8, 0) + dc
    According to the source code, the 3rd parameter in the function below, which value is 0x66, was not changed in the scope of the function. However it became 0x0 when it was used as the 4th parameter to call the function above. What't the matter?
    ff1528e8 pdo_dispatch (6ab90, ad, 66, 0, 0, 0) + dc
    I heard that Sun C++ uses 'register windows' to pass the parameters, i0~i5 are used for the first 6 ones. Somebody told me that what I saw in the pstack might not be creditable because the registers might be changed within the function. Is that so? Would anybody plz tell me more details?
    Thanks in advance.
    Edited by: DirtyBear on Feb 15, 2008 1:17 AM

    Register windows are a property of the SPARC computer architecture, not a property of a compiler. SPARC has multiple sets of registers. The function call instruction advances the "register window" to reveal the next set of registers, if there is one. If not, the registers are spilled to the stack to free up a window. The function return instruction moves the window back. (It's a purely hardware feature.) Eight of the registers in adjacent windows overlap, the origin of the "window" term. Registers %o0 thorugh %o7 in the caller become registers %i0 through %i7 in the called function.
    On SPARC and x64, some function arguments are passed in registers, depending on how many arguments there are and their types. (The x86 architecture has no registers available for passing arguments.) On entry to a function, the parameters passed in registers might be saved on the stack, but do not necessarily need to be saved on SPARC. The Solaris ABI requires that space for the registers be allocated, but the space is not necessarily used.
    In a core dump, the actual registers, particularly for functions other than the current one, are not available. The pstack operation doesn't know how many parameters a function has or what type they are. It shows the contents of the first 6 words on the stack that would hold arguments, if there were arguments, and if they were actually saved on the stack.
    In optimized code on any platform, the stack area for a variable or argument is not kept up to date. Computations are kept in registers to the extent possible, and saved in memory only when necessary.
    On SPARC in particular, the argument values shown in a stack trace need not be accurate.

  • How to get detailStamp working in an af:table when using request scope ?

    <af:table var="row" id="t1" value="#{listUsers.users}" summary="Userlist" binding="#{listUsers.ATable}" [...]
    <af:column sortable="false" headerText="Username" id="c13" filterable="true">
    <af:outputText value="#{row.username}" id="ot13"/>
    </af:column>
    <f:facet name="detailStamp">
    <af:panelFormLayout rows="4" labelWidth="33%" fieldWidth="67%" inlineStyle="width:795px" id="pfl1" labelAlignment="start" >
    <af:group id="g1">
    <af:panelLabelAndMessage id="plamNumber" label="Number" for="number">
    <af:outputText value="#{row.address.number}" id="number"/>
    </af:panelLabelAndMessage>
    I feel there is nothing special with this.
    But I've tested with 2 rows in my table and when I disclose rows, I get random results :
    sometimes I get the details related to the row disclosed, but sometimes I get the details of the other row.
    I've read several posts on the subject but none really helpful.
    Another problem ; I've noticed that when I disclose or close a row, getUsers() is called, this method fetch the data from the DB, any way to prevent it ?
    For the second problem, the solution I see would be to : change scope of listUsers to session instead of request, fetch from the DB only when "refresh", not when "detailStamp",
    but I've no clue on how to actually do the "only when part"
    Thanks in advance,
    JP

    Ok when I change the scope of ListUsers to session it's "ok" since I only load the list from the DB once (just like the demo that does not have this problem since the demo does not use the DB)
    When I change the scope for request and that the page is refreshed then the object ListUsers is "recreated" and the data reloaded : that's the expected behavior
    So I prefer to have the scope sets to request
    The problem is that when a user disclose/close a detailstamp and that the scope is set to request,
    then the data is reloaded from the DB
    because apparently this event acts like a "refresh"
    because this event (disclose/close) cause the destruction of what is in the request scope ...
    That's my understanding, probably few mistakes, I'm beginning with ADF/JSF
    It seems that when I load the data from the DB, it's not always in the same order, causing the problem itself probably, which is not ADF related BUT ;
    what I would like to know is how to (elegantly) prevent the event of "disclose/close" to act like a "refresh" ?
    Because even if I fix the "not ADF related problem" (if there is one), loading the list from the DB each time, appears really useless and the DBA won't like me !
    A solution could be to leave the session scope, but then my question would be ;
    *how to know I've to reload from the DB ?"
    I could just "reload it on page load", seems ok to me but
    I'm not sure it's the best, I would like to have your opinion, I've found this article for the "on page load" part ;
    http://groundside.com/blog/DuncanMills.php?title=adf_executing_code_on_page_load&more=1&c=1&tb=1&pb=1
    Thanks,
    JP

  • Search scopes taking long time to load SharePoint 2010

    Hi!
    It takes very long time (more than 5-10 mins) for the Search Scopes page to load. This is very annoying and proves to be very much NON-productive while working on search related tasks.
    Please help if you came across any such issue.
    Thanks,
    Owens G. Jesse

    Hi Owens ,
    According to your description, my understanding is that only your Search Scopes page loads very slowly.
    For your issue , you can enable Developer Dashboard for SharePoint 2010 with PowerShell first.
    With Developer Dashboard, you can find out where the Search Scopes page loading  time was spent at server side.
    Reference:
    http://blogs.technet.com/b/patrick_heyde/archive/2009/11/16/sharepoint-2010-enable-using-developer-dashboard.aspx
    Please inform me freely if you have any questions.
    Thanks

  • Validation error while trying to change a value in a request scope bean

    - JBoss 4.2.3.GA
    - JSF 1.2_09-b01-BETA1 (Mojarra)
    - Java 5 Update 17
    Hello, everybody!
    I'm having the following problem in my JSF web application:
    I have a request scope backing bean. The first time this bean is loaded (I check
    this with the ResponseStateManager.isPostBack() method) I fill a list of SelectItem
    instances that are to be displayed in the JSF page in a +<h:selectOneMenu>+ component.
    The list goes, of course, to the +<h:selectOneMenu>+'s +<f:selectItems>+ facet child
    component. In the constructor I also define the value that goes to the value property
    of the +<h:selectOneMenu>+ component. This value is a property in the backing bean, as
    is the list of SelectItem instances. Until now we have something like this:
    The backing bean declaration in faces-config.xml:
    <managed-bean>
        <managed-bean-name>solicitacaoGeral</managed-bean-name>
        <managed-bean-class>br.urca.solicitacoes.web.PaginaSolicitacaoGeral</managed-bean-class>
        <managed-bean-scope>request</managed-bean-scope>
    </managed-bean>
    The relevant parts of the JSF page:
    <h:form id="form">
        <h:selectOneMenu value="#{solicitacaoGeral.setorOrigem}" id="foco">
            <f:selectItems value="#{solicitacaoGeral.setoresOrigem}" />
        </h:selectOneMenu>
    </h:form>
    The relevant parts of the backing bean class:
    public class PaginaSolicitacaoGeral
        private final List<SelectItem> fSetoresOrigem = new ArrayList<SelectItem>();
        private Setor fSetorOrigem;
        public PaginaSolicitacaoGeral()
            if (primeiraExibicao()) // First load (!ResponseStateManager.isPostBack())
                // Fill fSetoresOrigem...
                fSetorOrigem = ...
            else // Page submitted
                // Read below...
        public List<SelectItem> getSetoresOrigem()
            return fSetoresOrigem;
        public Setor getSetorOrigem()
            return fSetorOrigem;
        public void setSetorOrigem(Setor setorOrigem)
            fSetorOrigem = setorOrigem;
        private boolean primeiraExibicao()
            String idFerramentaExibicao =
                FacesContext.getCurrentInstance().getViewRoot().getRenderKitId();
            ResponseStateManager gerenciadorEstadoResposta =
                RenderKitUtils.getResponseStateManager(
                FacesContext.getCurrentInstance(), idFerramentaExibicao);
            return !gerenciadorEstadoResposta.isPostback(
                FacesContext.getCurrentInstance());
    }But when the user submits the form and the bean constructor is called again
    (this time the method ResponseStateManager.isPostBack() returns true ),
    in the else block in the constructor above, I need to fill fSetoresOrigem with
    other values and also the fSetorOrigem field because, of course, the fSetorOrigem
    field has to be a valid value that exists in the new fSetoresOrigem list.
    JSF is not complaining about the change to the list items, but it is complaining
    to the change to the fSetorOrigem field (the list value), even though it is a
    valid value present in the list. So I'm getting this error message:
    08:23:54,312 INFO  [lifecycle] WARNING: FacesMessage(s) have been enqueued, but may not have been displayed.
    sourceId=form:foco[severity=(ERROR 2), summary=(form:foco: Validation Error: Value is not valid), detail=(form:foco: Validation Error: Value is not valid)]I suppose that JSF is comparing the new value of the field fSetorOrigem with the value
    it has in the view state. As the value is different it is raising the error. That's
    what I suppose. But am I not able the change the value in the postback? I've already
    checked and the value is valid. It corresponds to a value that exists in the list.
    I really need a solution to this problem as I'm stuck with this and can't proceed until
    I find a solution to this. What I am doing wrong and how can I solve this?
    Thank you very much.
    Marcos

    BalusC wrote:
    It is comparing the selected value against the List<SelectItem> returned by getSetoresOrigem() as it is during the apply request values phase of the form submit request.Ok. That's what I supposed JSF was doing.
    BalusC wrote:
    If the selected value isn't in there, then you will get this error.I can understand this, but is this right? As I said, the old value isn't really there because I changed the list values to new ones. But the new value (the value of fSetorOrigem ) corresponds to a value that exist in the new list items, so a valid value. So JSF is not considering that I also changed the list, not just the value. It is comparing the new value with the old list, not the new one. Acting like this JSF is making the page looks like a static HTML page, not a dynamic one. If I can't change the list and the value, what's the point of that? In my point of view I'm not doing anything wrong, I'm not violating any JSF rules.
    Marcos

Maybe you are looking for

  • Shelf life from material master not flowing into purchase order

    Hai friend I have set a shelf life value in material master ( both minimum & Total shelf life).  But while creating purchase order, values are not flowing from material master to purchase order. The field is empty. How to configure, please help. Rega

  • Lightning Connector won't dock with 32 g Touch

    5th Gen Ipod Touch, never dropped. Lightning connector won't dock with Ipod. I tried three different cables.

  • Forms Builder 6i Application Error

    Hi! I'm just creating a Record Group when this error shows up: The instruction at "0x634c052b" referenced memory at "0x000000000" the memory could not be written. It's not a FRM nor an ORA error, it just says "ifbld60 Application error" then shut dow

  • How do I make the photos in timeline the same timeframe?

    I have finished my movie and I have a ton of photos and they are 10 -14 secs long... to long.  They are all different.  How can I make them all the same time?  How can I figure out exactly how much time each of them is also? Thank you, Valorie

  • Updating CS3 to CS6

    What is involved in updating an older version of Illustrator (and the rest of the suite) to the newest version?