How to restrict the maximum size of a java.awt.ScrollPane

Dear all,
I would like to implement a scroll pane which is resizable, but not to a size exceeding the maximum size of the java.awt.Canvas that it contains.
I've sort of managed to do this by writing a subclass of java.awt.ScrollPane which implements java.awt.event.ComponentListener and has a componentResized method that checks whether the ScrollPane's viewport width (height) exceeds the content's preferred size, and if so, resizes the pane appropriately (see code below).
It seems to me, however, that there ought to be a simpler way to achieve this.
One slightly weird thing is that when the downsizing of the pane happens, the content can once be moved to the left by sliding the horizontal scrollbar, but not by clicking on the arrows. This causes one column of gray pixels to disappear and the rightmost column of the content to appear; subsequent actions on the scrollbar does not have any further effect. Likewise, the vertical scrollbar can also be moved up once.
Also, I would like a java.awt.Frame containing such a restrictedly resizable scrollpane, such that the Frame cannot be resized by the user such that its inside is larger than the maximum size of the scrollpane. The difficulty I encountered with that is that setSize on a Frame appears to set the size of the window including the decorations provided by the window manager (fvwm2, if that matters), and I haven't been able to find anything similar to getViewportSize, which would let me find out the size of the area inside the Frame which is available for the scrollpane which the frame contains.
Thanks in advance for hints and advice.
Here's the code of the componentResized method:
  public void componentResized(java.awt.event.ComponentEvent e)
    java.awt.Dimension contentSize = this.content.getPreferredSize();
    this.content.setSize(contentSize);
    java.awt.Dimension viewportSize = getViewportSize();
    System.err.println("MaxSizeScrollPane: contentSize = " + contentSize);
    System.err.println("MaxSizeScrollPane: viewportSize = " + viewportSize);
    int dx = Math.max(0, (int) (viewportSize.getWidth() - contentSize.getWidth()));
    int dy = Math.max(0, (int) (viewportSize.getHeight() - contentSize.getHeight()));
    System.err.println("MaxSizeScrollPane: dx = " + dx + ", dy = " + dy);
    if ((dx > 0) || (dy > 0))
      java.awt.Dimension currentSize = getSize();
      System.err.println("MaxSizeScrollPane: currentSize = " + currentSize);
      setSize(new java.awt.Dimension(((int) currentSize.getWidth()) - dx, ((int) currentSize.getHeight()) - dy));
    System.err.println();
  }Best regards, Jan

import java.awt.*;
import java.awt.event.*;
import java.awt.geom.*;
public class ScrollPaneTest
    GraphicCanvas canvas;
    CustomScrollPane scrollPane;
    private Panel getScrollPanel()
        canvas = new GraphicCanvas();
        scrollPane = new CustomScrollPane();
        scrollPane.add(canvas);
        // GridBagLayout allows scrollPane to remain at
        // its preferred size during resizing activity
        Panel panel = new Panel(new GridBagLayout());
        GridBagConstraints gbc = new GridBagConstraints();
        panel.add(scrollPane, gbc);
        return panel;
    private WindowListener closer = new WindowAdapter()
        public void windowClosing(WindowEvent e)
            System.exit(0);
    private Panel getUIPanel()
        int w = canvas.width;
        int h = canvas.height;
        int visible = 100;
        int minimum = 200;
        int maximum = 500;
        final Scrollbar
            width  = new Scrollbar(Scrollbar.HORIZONTAL, w,
                                   visible, minimum, maximum),
            height = new Scrollbar(Scrollbar.HORIZONTAL, h,
                                   visible, minimum, maximum);
        AdjustmentListener l = new AdjustmentListener()
            public void adjustmentValueChanged(AdjustmentEvent e)
                Scrollbar scrollbar = (Scrollbar)e.getSource();
                int value = scrollbar.getValue();
                if(scrollbar == width)
                    canvas.setWidth(value);
                if(scrollbar == height)
                    canvas.setHeight(value);
                canvas.invalidate();
                scrollPane.validate();
        width.addAdjustmentListener(l);
        height.addAdjustmentListener(l);
        Panel panel = new Panel(new GridBagLayout());
        GridBagConstraints gbc = new GridBagConstraints();
        gbc.insets = new Insets(2,2,2,2);
        gbc.weightx = 1.0;
        addComponents(new Label("width"),  width,  panel, gbc);
        addComponents(new Label("height"), height, panel, gbc);
        gbc.anchor = GridBagConstraints.CENTER;
        return panel;
    private void addComponents(Component c1, Component c2, Container c,
                               GridBagConstraints gbc)
        gbc.anchor = GridBagConstraints.EAST;
        c.add(c1, gbc);
        gbc.anchor = GridBagConstraints.WEST;
        c.add(c2, gbc);
    public static void main(String[] args)
        ScrollPaneTest test = new ScrollPaneTest();
        Frame f = new Frame();
        f.addWindowListener(test.closer);
        f.add(test.getScrollPanel());
        f.add(test.getUIPanel(), "South");
        f.pack();
        f.setLocation(200,200);
        f.setVisible(true);
        f.addComponentListener(new FrameSizer(f));
class GraphicCanvas extends Canvas
    int width, height;
    public GraphicCanvas()
        width = 300;
        height = 300;
    public void paint(Graphics g)
        super.paint(g);
        Graphics2D g2 = (Graphics2D)g;
        g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                            RenderingHints.VALUE_ANTIALIAS_ON);
        int dia = Math.min(width, height)*7/8;
        g2.setPaint(Color.blue);
        g2.draw(new Rectangle2D.Double(width/16, height/16, width*7/8, height*7/8));
        g2.setPaint(Color.green.darker());
        g2.draw(new Ellipse2D.Double(width/2 - dia/2, height/2 - dia/2, dia-1, dia-1));
        g2.setPaint(Color.red);
        g2.draw(new Line2D.Double(width/16, height*15/16-1, width*15/16-1, height/16));
    public Dimension getPreferredSize()
        return new Dimension(width, height);
    public Dimension getMaximumSize()
        return getPreferredSize();
    public void setWidth(int w)
        width = w;
        repaint();
    public void setHeight(int h)
        height = h;
        repaint();
class CustomScrollPane extends ScrollPane
    Dimension minimumSize;
    public Dimension getPreferredSize()
        Component child = getComponent(0);
        if(child != null)
            Dimension d = child.getPreferredSize();
            if(minimumSize == null)
                minimumSize = (Dimension)d.clone();
            Insets insets = getInsets();
            d.width  += insets.left + insets.right;
            d.height += insets.top + insets.bottom;
            return d;
        return null;
    public Dimension getMinimumSize()
        return minimumSize;
    public Dimension getMaximumSize()
        Component child = getComponent(0);
        if(child != null)
            return child.getMaximumSize();
        return null;
class FrameSizer extends ComponentAdapter
    Frame f;
    public FrameSizer(Frame f)
        this.f = f;
    public void componentResized(ComponentEvent e)
        Dimension needed = getSizeForViewport();
        Dimension size = f.getSize();
        if(size.width > needed.width || size.height > needed.height)
            f.setSize(needed);
            f.pack();
     * returns the minimum required frame size that will allow
     * the scrollPane to be displayed at its preferred size
    private Dimension getSizeForViewport()
        ScrollPane scrollPane = getScrollPane(f);
        Insets insets = f.getInsets();
        int w = scrollPane.getWidth() + insets.left + insets.right;
        int h = getHeightOfChildren() + insets.top + insets.bottom;
        return new Dimension(w, h);
    private ScrollPane getScrollPane(Container cont)
        Component[] c = cont.getComponents();
        for(int j = 0; j < c.length; j++)
            if(c[j] instanceof ScrollPane)
                return (ScrollPane)c[j];
            if(((Container)c[j]).getComponentCount() > 0)
                return getScrollPane((Container)c[j]);
        return null;
    private int getHeightOfChildren()
        Component[] c = f.getComponents();
        int extraHeight = 0;
        for(int j = 0; j < c.length; j++)
            int height;
            if(((Container)c[j]).getComponent(0) instanceof ScrollPane)
                height = ((Container)c[j]).getComponent(0).getHeight();
            else
                height = c[j].getHeight();
            extraHeight += height;
        return extraHeight;
}

Similar Messages

  • How to determine the maximum size of JFrame?

    I am using JDK1.2 to develop an application. I have
    a problem to handle the maximum size of of JFrame.
    If the user clicks the maximum icon or double-clicks
    the title bar from the JFrame, the JFrame becomes
    maximum. How can I determine the state of maximization? I need to bring different views if the
    JFrame is maximum or minimum. I knew JDK1.4 can
    handle this problem. Or using JNI, either. Does
    anyone know other ways to handle this?
    Thanks,
    Peter

    So that you won't have to wait forever:
    Sorry, pal, the only way is JNI. I researched this earlier for 1.2, but can't find it right now in the database. They finally added it to 1.4.
    Good luck.

  • How to calcalate the maximum size occupied by a table/row

    Hi,
    I am using the below query to find the maximum size occupied by a table per a row of data.
    SQL> desc t2
    Name Null? Type
    NO NUMBER(1)
    CH VARCHAR2(10)
    SQL> select sum(data_length) from user_tab_columns where table_name='T2';
    SUM(DATA_LENGTH)
    32
    Is this correct? Does oracle takes 22 bytes of space to store a column of Number(1) per a row as it shows below !?
    1* select data_length from user_tab_columns where table_name='T2'
    SQL> /
    DATA_LENGTH
    22
    10
    Please give your comments/suggestions
    Thanks and Regards
    Srikanth

    If you are trying to do this for an existing table, you can get the actual number of bytes stored per column by:
    SELECT VSIZE(column_name)
    FROM tableSo, to get the largest row you could:
    SELECT MAX(VSIZE(col1) + VSIZE(col2) ... + VSIZE(coln))
    FROM tableIf you want to get the theoretical largest possible row size, then you can use something like:
    SELECT SUM(DECODE(data_type,'NUMBER', ROUND((data_precision/2)+.1,0) +1,
                                'DATE',   7,
                                'LONG',   2147483648,
                                'BLOB',   4000,
                                'CLOB',   4000,
                                data_length)) max_length
    FROM user_tab_columns
    WHERE table_name = 'MY_TABLE'This works because:
    For a number, Oracle stores two digits in each byte, and uses one byte for the mantissa. Note, if you are expecting negative numbers in your numeric columns then add one additional byte).
    For a date, Oracle always requires 7 bytes.
    A long is at most 2 GB in size.
    Both Blobs and Clobs will be stored out-of-line when they are larger than about 4,000 bytes.
    For other data types you specify bytes of storage when you define the column, and that is stored in data_length.
    I'm not sure at this point what sort of sizes you would get for object type columns or nested tables.
    HTH
    John

  • How to control the maximum size of a component in a GridBagLayout

    Here is a small program that demonstrates my issue (it's originally from a big program that I couldn't attach here).
    I have a GridBagLayout with some components in it. Some of the components are JEditorPane (displaying some HTML) within JPanel and are individally scrollable.
    Here we go:
    - when I resize the main panel, every components will resize accordingly to their weight (which is here the same for all of them): fine
    - when I reduce the size of the main panel until it reaches all the preferred size of each component, the scrollPane of the main panel appears so that the user can scroll: not fine
    The behaviour I'm looking for is: when I reduce the size of the main panel, when it reaches the preferred size of the components, I would like that the JEditorPane (which are in JPanel with BorderLayout/CENTER) display their individual scrollbars so that I can see all the JEditor panes at the same time without having to scroll the main window.
    If the user continues to reduce the size of the main panel, then, at one point, display the scrollpane of the main panel.
    See what I mean? How to control this?
    Here is the code:
    @SuppressWarnings("serial")
    public final class CGridBagLayout2 extends JFrame {
         JPanel mainPanel;
         private final JScrollPane scrollPane;
         private JPanel panelize(Component component, String localization) {
              JPanel output = new JPanel(new BorderLayout());          
              output.add(component, localization);
              return output;
        public void addComponentsToMainPanel() {
              mainPanel.setLayout(new GridBagLayout());
              GridBagConstraints c = new GridBagConstraints();
              c.weightx = 1.0;
              c.fill = GridBagConstraints.BOTH;
              String TEST_BIGTEXT = "<html><body><h2>Path</h2>toto/tutu/tata/TestN<h2>Prerequisites</h2>blah blah blah blah<br/><b>blah blah</b> blah blah\nblah blah <u>blah</u> blahblah blah blah<h2>Description</h2>blah blah blah blah<br/><b>blah blah</b> blah blah\nblah blah <u>blah</u> blahblah blah blah blah\nblah blah blah <br/>lah blah blah <br/>lah blah blah blah blah blah blah blah FIN</body></html>";
              for (int index=0; index<10; index++) {
                   c.gridheight = 5; // nb Testcases for this test
                   c.anchor = GridBagConstraints.FIRST_LINE_START; // align all the components top-left aligned
                   c.gridy = index;
                   JLabel a = new JLabel("AAAAA");
                   c.gridx = 0;
                   mainPanel.add(panelize(a, BorderLayout.NORTH), c);
                   JLabel b = new JLabel("BBBBB");
                   c.gridx = 1;
                   mainPanel.add(panelize(b, BorderLayout.NORTH), c);
                   JEditorPane d = new JEditorPane("text/html", TEST_BIGTEXT);               
                   c.gridx = 2;
                   mainPanel.add(panelize(d, BorderLayout.CENTER), c);
                   JEditorPane e = new JEditorPane("text/html", TEST_BIGTEXT);               
                   c.gridx = 3;
                   mainPanel.add(panelize(e, BorderLayout.CENTER), c);
                   index++;
         public CGridBagLayout2() {
              super("GridBagLayout");
              mainPanel = new JPanel();
              addComponentsToMainPanel();
              scrollPane = new JScrollPane(mainPanel);
              setContentPane(scrollPane);
         public static void main(String[] args) {
              Frame frame;
              WindowListener exitListener;
              exitListener = new WindowAdapter() {
                   @Override
                   public void windowClosing(WindowEvent e) {
                        Window window = e.getWindow();
                        window.setVisible(false);
                        window.dispose();
                        System.exit(0);
              frame = new CGridBagLayout2();
              frame.addWindowListener(exitListener);
              frame.setPreferredSize(new Dimension(1000, 800));
              frame.pack();
              frame.setVisible(true);
    }Many thanks in advance, I'm getting crazy on this one :)

    Ok, thanks for this information, I thought I had seen this happening in the past when embedding a component in the center area of a JPanel with BorderLayout.
    Anyway, as I said I tested with JScrollPane as well and it does not change anything.
    Here is the code modified:
    @SuppressWarnings("serial")
    public final class CGridBagLayout2 extends JFrame {
         JPanel mainPanel;
         private final JScrollPane scrollPane;
         private JPanel panelize(Component component, String localization) {
              JPanel output = new JPanel(new BorderLayout());          
              output.add(component, localization);
              return output;
        public void addComponentsToMainPanel() {
              mainPanel.setLayout(new GridBagLayout());
              GridBagConstraints c = new GridBagConstraints();
              c.weightx = 1.0;
              c.fill = GridBagConstraints.BOTH;
              String TEST_BIGTEXT = "<html><body><h2>Path</h2>toto/tutu/tata/TestN<h2>Prerequisites</h2>blah blah blah blah<br/><b>blah blah</b> blah blah\nblah blah <u>blah</u> blahblah blah blah<h2>Description</h2>blah blah blah blah<br/><b>blah blah</b> blah blah\nblah blah <u>blah</u> blahblah blah blah blah\nblah blah blah <br/>lah blah blah <br/>lah blah blah blah blah blah blah blah FIN</body></html>";
              for (int index=0; index<10; index++) {
                   c.gridheight = 5; // nb Testcases for this test
                   c.anchor = GridBagConstraints.FIRST_LINE_START; // align all the components top-left aligned
                   c.gridy = index;
                   JLabel a = new JLabel("AAAAA");
                   c.gridx = 0;
                   mainPanel.add(panelize(a, BorderLayout.NORTH), c);
                   JLabel b = new JLabel("BBBBB");
                   c.gridx = 1;
                   mainPanel.add(panelize(b, BorderLayout.NORTH), c);
                   JEditorPane d = new JEditorPane("text/html", TEST_BIGTEXT);               
                   c.gridx = 2;
                   mainPanel.add(panelize(new JScrollPane(d), BorderLayout.CENTER), c);
                   JEditorPane e = new JEditorPane("text/html", TEST_BIGTEXT);               
                   c.gridx = 3;
                   mainPanel.add(panelize(new JScrollPane(e), BorderLayout.CENTER), c);
         public CGridBagLayout2() {
              super("GridBagLayout");
              mainPanel = new JPanel();
              addComponentsToMainPanel();
              scrollPane = new JScrollPane(mainPanel);
              setContentPane(scrollPane);
         public static void main(String[] args) {
              Frame frame;
              WindowListener exitListener;
              exitListener = new WindowAdapter() {
                   @Override
                   public void windowClosing(WindowEvent e) {
                        Window window = e.getWindow();
                        window.setVisible(false);
                        window.dispose();
                        System.exit(0);
              frame = new CGridBagLayout2();
              frame.addWindowListener(exitListener);
              frame.setPreferredSize(new Dimension(1000, 800));
              frame.pack();
              frame.setVisible(true);
    }Edited by: eric_gavaldo on Sep 15, 2010 2:18 PM

  • How to restrict the Copying/printing of the file from document

    Hi..
    Case:
    1. I have a document number it has three files in it.I want to locked the files from priniting and copying but not from opening/displaying.
    2. I am using content server for storing the DMS documents.How to restrict the number of attachments that can be uploaed in one document number?
    3.How to restrict the maximum size that can be uploaded against one document number?
    Sandip

    Hi Sandip,
    1. I have a document number it has three files in it.I want to locked the files from priniting and copying but not from opening/displaying.
    In DC30 transaction,in Workstation application for network,disable the print option.Will ensure users will not be able to print the originals.
    2. I am using content server for storing the DMS documents.How to restrict the number of attachments that can be uploaed in one document number?
    See if your ABAPer can use the BADI  'DOCUMENT_MAIN01' with method 'BEFORE_SAVE' to handle this check.
    3.How to restrict the maximum size that can be uploaded against one document number?
    Believe you are using kPro as a storage option.If this is the case,then there is no setting available to limit the file size for upload.See if your Basis guy can set an upper limit for file size in IIS setting for your content server.
    If you are using SAP DB as a storage option(not recommended though),then use the field File Size in DC10 transaction,Define Document Types to effect a file size limit.
    P.S. Would appreciate incase you could close the threads which have been answered satisfactorily.
    Regards,
    Pradeepkumar Haragoldavar

  • How to set the heap size of JVM

    please let me know that how to set the heap size of JVM

    C:\>java -X
        -Xmixed           mixed mode execution (default)
        -Xint             interpreted mode execution only
        -Xbootclasspath:<directories and zip/jar files separated by ;>
                          set search path for bootstrap classes and resources
        -Xbootclasspath/a:<directories and zip/jar files separated by ;>
                          append to end of bootstrap class path
        -Xbootclasspath/p:<directories and zip/jar files separated by ;>
                          prepend in front of bootstrap class path
        -Xnoclassgc       disable class garbage collection
        -Xincgc           enable incremental garbage collection
        -Xbatch           disable background compilation
        -Xms<size>        set initial Java heap size
        -Xmx<size>        set maximum Java heap size
        -Xss<size>        set java thread stack size
        -Xprof            output cpu profiling data
        -Xrunhprof[:help]|[:<option>=<value>, ...]
                          perform JVMPI heap, cpu, or monitor profiling
        -Xdebug           enable remote debugging
        -Xfuture          enable strictest checks, anticipating future default
        -Xrs              reduce use of OS signals by Java/VM (see documentation)look at the -Xm? lines
        -Xms<size>        set initial Java heap size
        -Xmx<size>        set maximum Java heap sizeThis can be used e.g. like this:java -Xms8M -Xmx32M MyProgwhich runs MyProg in a java VM with the initial heap size of 8 MB and a maximum heap size of 32 MB.
    - Marcus

  • Maximum size of a Java String

    Hello
    Can anyone please tell me what would be the maximum size for a java string....
    Thanks
    Tapan

    You are asking the wrong questions. If you are going to have a really, really big string then the chances are you shouldn't be using strings.
    If you are trying to parse a file then you want to be reading it in chunks at a time.
    Tell us what you are trying to do and maybe we can suggest a better solution.
    See, I am a nice person. I just don't like people who are too lazy to writepublic static void main(String args[]) {
      System.out.println(Integer.MAX_VALUE);
    } That took me around 10 seconds.
    Ted.

  • How can i increase the maximum size of a text column in Access

    hello,
    i am inserting data in the MS-Access database through my servlet and am getting the exception whenever the length of the text data is more than 255 characters as in Access the maximum size for character data column is 255 can anyone tell me if there is any way by which i can increase the maximum limit of the column size in Access ,i.e. to make it more than 255.

    A text field in Access has a maximum size of 255 characters. If you want to store text information in Access larger than 255, you need to use the memo rather than text data type. There are special considerations for using an Access memo data type and accessing it through JDBC. Specifically, I believe it must be accessed as a binary object (BLOB), rather than text when using the JDBC-ODBC bridge. There are lots of discussions within these forums regarding how to manage, and the issues with using the Access memo data type.
    Good luck!

  • How to restrict the upload file size in me21n/me22n/me23n?

    Hi Guru's,
    I have a requirement to restrict the user from attaching a local file more than 20MB in Purchase Order.
    In standard SAP system, the user can attach a file of any size in PO. How to restrict the size of the file?
    I have no clue how to achieve this? Any kind of help would be great...
    Thanks in Advance...
    Regards,
    Satyam

    Hi Guru's,
    The file size is now restricted in function GUI_UPLOAD. But this function module is used at many places. I want to restrict it only for Tcode: ME22n and ME23n.
    I thought of restricting it by sy-tcode field but sy-tcode value  is not passed to this function module in the run time.
    Could anyone help me on this how to restrict it for the above mentioned tcodes??
    Regards,
    Satyam

  • How to restrict the size of folder in KM?

    Hi All,
    How to restrict the size of folder in KM?
    Suppose I allocated 1 personal folder to every SAP KM Folder. Can I restrict the size of folder with do not allowed the uploaded file to be exceeded certain capacity?
    Thanks & Regards,
    zhixuen.

    Hi,
    Refer this [http://help.sap.com/saphelp_nw70/helpdata/en/62/468698a8e611d5993600508b6b8b11/content.htm]
    Also chk.
    https://forums.sdn.sap.com/thread.jspa?threadID=80571
    https://forums.sdn.sap.com/thread.jspa?threadID=80326
    https://forums.sdn.sap.com/thread.jspa?threadID=80145
    http://weblogs.sdn.sap.com/pub/wlg/3219
    Regards
    Baby

  • How Do You Set the Maximum Size of a JFrame?

    Can someone show me a quick example? The JFrame can be empty, I just want to know how to set it's maximum size. I tried using setMaximumSize() and it doesn't work for some reason but setMinimumSize() works fine.
    I tried it using a BoxLayout and even using null as a layout manager and can't get it to work. I heard that the other layout managers don't allow you to set the maximum size of a JFrame so that is why I tried it with the layouts that I did.
    I tried the following code (imported the necessary classes), but it does not work...
    public class MyFrame extends JFrame
        public MyFrame()
            super("TestFrame");
            setLayout( new BoxLayout(getContentPane(), BoxLayout.X_AXIS)  );       
            setMaximumSize( new Dimension(400,200));
            setSize(300,150);
            setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            setVisible( true );                
    }// end class

    Reposted from
    {color:#0000ff}http://forum.java.sun.com/thread.jspa?threadID=5236259{color}
    @OP:
    When you repost a topic, please always provide a link to the previous post so people can check what suggestions were already offered (and didn't solve the problem).
    Better still, give a short summary of the advice you have already tried.
    I suggested setBackground(...) so you can see whether your MyFrame is actually occupying the entire real estate of the window. Looks as if trying it out (which I would have done for you if I'd been at home, where my JDK is) would have been too much effort for you.
    I'm pretty much a novice in Swing, but I can tell you this: setLayout controls the layout of components added to the JFrame, not the layout of the frame with respect to its parent container.
    Luck, Darryl

  • What is the maximum size limit for a KM document to be uploaded?

    Hi,
    1.  I have a requirement, wherein the user wants to upload a document which is more than 448MB in KM.
    I am not sure what is the maximum limit that standard SAP provides by default, which I can advice the user at the first place.
    2. what if we want to increase the max limit of the size?Where do we do that, can you suggest me the path for the same?
    Thanks in advance.
    Regards
    DK

    Hello,
    CM Repository in DB Mode:
    If there is a large number of write requests in your CM usage scenario, set up the CM repository in database mode. Since all documents are stored in the database, this avoids unintentional
    external manipulation of the data.
    CM Repository in FSDB Mode:
    In this mode, the file system is predominant. If files are removed from or added to the file system, the database is updated automatically.
    If you mainly have read requests, choose a mode in which content is stored in the file system. If this is the case, make sure that access to the relevant part of the file system is denied or
    restricted to other applications.
    What is the maximum size of the document that we can upload in a CM (DB) and CM (FSDB) without compromising the performance ?
    There are the following restrictions for the databases used:
    ·  Maximum number of resources (folders, documents) in a repository instance
       FSDB: No restriction (possibly limited by file system restrictions)
       DBFS and DB: 2,147,483,648
    ·  Maximum size of an individual resource:
       FSDB: No restriction (possibly limited by file system restrictions)
       DBFS: 8 exabytes (MS SQL Server 2000), 2 GB (Oracle)
       DB: 2 GB
    Maximum length of large property values (string type):2,147,583,647 byte
    What is the impact on the performance of Knowledge Management Platform and on Portal Platform when there are large number of documents that are in sizes somewhere from 100 MB to 500 MB or more.
    The performance of the KM and Portal platform is dependent on the type of activity the user is trying to perform. That is a heavy number of retrievals of the large documents stored in the repository for
    read/write mode decreases the performance of the patform. Searching and indexing in the documents will also take a propertionate amount of time.
    For details, please refer to,
    http://help.sap.com, Goto "KM Platform" and then,
    Knowledge Management Platform   > Administration Guide
    System Administration   > System Configuration
    Content Management Configuration   > Repositories and Repository
    Managers    > Internal Repositories   > CM Repository Manager
    Technically speaking the VM has a restriction according to plattform.  W2k is somewhere around 1,2G and Solaris, I believe, 4G.
    Say for instance I was on a W2k box I allotted 500+ for my J2EE Engine that would leave me with the possiblity to upload close to 600mb documents max.
    See if the attached documents (610134, 634689, 552522) can provide you some guidance for setting your VM to meet your needs.
      SUN Documentation
      Java HotSpot VM Options
            http://java.sun.com/docs/hotspot/VMOptions.html
      How to tune Garbage collection on JVM 1.3.1
            http://java.sun.com/docs/hotspot/gc/index.html
      Big Heaps and Intimate Shared Memory (ISM)
            http://java.sun.com/docs/hotspot/ism.html
    Kind Regards,
    Shabnam.

  • How to restrict the number of Records into the Table?

    Is there any way that I can restrict the number of records can be entered into the table?
    For example I have created a table TAB1 with size category 0( zero).
    User dont want to enter more than 100 values, How to restrict the number entries? Whether Basis can do it?
    Regards,
    Prathap

    Hi Prathap,
    You can write a code in table maintenance events to restrict the number of Records added into the Table to constant.
    Solution:
    Se11 -> enter table name (TAB1) -> F6 -> Utlities -> Table maint. generator -> Envirnment -> modification -> events -> write here the form routine name.
    Double click on routine name. You will get into include section of the code. Write here code like:
    IF current_rec_num > 100.
       messgae error 'Entry restriceted to 100'
    ENDIF.
    Somewhat this way you can achieve your target.
    Regards,
    Sachin

  • How to control the maximum time that a dynamic sql can execute

    Hi,
    I want to restrict the maximum time that a dynamic sql can execute in a plsql block.
    If the execution is not completed, the execution should be terminated and a exception should be raised.
    Please let me know, if there is any provision for the same in Oracle 10g.
    I was reading about Oracle Resource Database Resource Manager, which talks about restricting the maximum time of execution for Oracle session for a user.
    However I am not sure, if this can be used to control the execution of dynamic sql in a plsql block.
    Please provide some pointers.
    Thank you,
    Warm Regards,
    Navin Srivastava

    navsriva wrote:
    We are building a messaging framework, which is used to send time sensitive messages to boundary system.I assume this means across application/database/server boundaries? Or is the message processing fully localised in the Oracle database instance?
    Every message has a time to live. if the processing of message does not occurs within the specified time, we have to rollback this processing and mark the message in error state.This is a problematic requirement.. Time is not consistent ito data processing on any platform (except real-time ones). For example, messageFoo1 has a TTL (time to live) of 1 sec. It needs to read a number of rows from a table. The mere factor of whether those rows are cached in the database buffer cache, or still residing on disk, will play a major role in execution time. Physical I/O is significantly slower that logical I/O.
    As a result, with the rows on disk, messageFoo1 exceeds the 1s TTL and fails. messageFoo2 is an identical message. It now finds most of the rows that were read by messageFoo1 in the buffer cache, enabling it to complete its processing under 1s.
    What is the business logic behind the fact that given this approach, messageFoo1 failed, and the identical messageFoo2 succeeded? The only difference was physical versus logical I/O. How can that influence the business validation/requirement model?
    If it does, then you need to look instead at a real-time operating system and server platform. Not Windows/Linux/Unix/etc. Not Oracle/SQL-Server/DB2/etc.
    TTL is also not time based in other s/w layers and processing. Take for example the traceroute and ping commands for the Internet Protocol (IP) stack. These commands send an ICMP (Internet Control Message Protocol) packet.
    This packet is constructed with a TTL value too. When TTL is exceeded, the packet expires and the sender receives a notification packet to that regard.
    However, this TTL is not time based, but "+hop+" based. Each server's IP stack that receives an ICMP packet as it is routed through the network, subtracts 1 from the TTL and the forwards the packet (with the new TTL value). When a server's IP stack sees that TTL is zero, it does not forward the packet (with a -1 TTL), but instead responds back to the sender with an ICMP packet informing the sender that the packet's TTL has expired.
    As you can see, this is a very sensible and practical implementation of TTL. Imagine now that this is time based.. and the complexities that will be involved for the IP stack s/w to deal with it in that format.
    Making exact response/execution times part of the actual functional business requirements need to be carefully considered.. as this is very unusual and typically only found in solutions implemented in real-time systems.

  • How to increase the attachment size of a portal

    Hi,
    We have a portal developed using JSP.
    We have an option for attaching files. Now the maximum limit is only 5 MB. So we thought of using FTP so that we can increase the attachment limit. But we are not able to attach files more than 1 MB.
    Could you please help us in resolving this. Any idea how to increase the attachment size limit?
    Thanks in advance

    Hi,
    See what Patrick Yee has posted.
    how to create own page format in smartforms immmedia
    Svetlin

Maybe you are looking for

  • How to add a character at the end of an array element that meets certain criteria.

    Hi. I am using CF 9.2.1. I started learning CF yesterday, and I am trying to figure out a way to add a special character (like "?", "!"," & ") to an array row if the first row element (say, element [1][1]) has a specific letter like " t" in the word

  • Error in AR_INVOICE_UTILS.validate_tax_exemption ORA-01403: no data found

    Hi All,, --API - AR Invoice (Transaction) Creation CREATE OR REPLACE procedure APPS.xxx_ar_invoice_api is l_return_status varchar2(1); l_msg_count number; l_msg_data varchar2(2000); l_batch_source_rec ar_invoice_api_pub.batch_source_rec_type; l_trx_h

  • OEM Version of Windows 7

    So I'm purchasing Windows 7 64-Bit OEM version. I had a pervious thread, but it was getting lost and off topic so I am starting over. I hate to be a pain. Just please answer yes, or no. Can I run the OEM version of Windows 7 64-Bit on BootCamp 4.0 on

  • MM01 Error - Accounting View

    Hi All When i create a Raw Material in Industry Sector      :      Mechanical Engineering Material Type        :       Raw Material(ROH) System throws an error " Please Enter Moving average for this material" Please Suggest Regards Jagadish

  • Forms 10g rel 1( 9.0.4 ) vs SUN JVM 1.5

    Hello: From SUN site you can read : "Changes in 1.5.0_06 The full internal version number for this update release is 1.5.0_06-b05 (where "b" means "build"). The external version number is 5.0u6. Security Enhancements Prior to this update, an applet o