ADF-BC/JSF How to restrict the size of an ordImage

Hi all
I have a table containing two columns with type ordsys.OdImage. One is a small resolution icon and the other the image itself.
Using Steve Muench s example mo 69, I was able to create a ADF-BC/JSF application that loads images to the database.
Now my next step is to reject images whose size in pixels is other than the one defined for thumbnails, which is 100x100, I thought that I could do this by tampering with the getter methods of the ViewRowImpl Java class but it didn't work. It appears to me that the framework creates an empty image first and then loads the contents from a file.
Can anybody give me a clue about how to accomplish this ?
Thanks in advance
Thanassis

Just finished testing the validateEntity() approach and it failed.
I think that I must be doing something wrong here.
I use the OrdImageDomain.getHeight() and getWidth() functions and they both return 0 wheither invoked during attribute setter method or during the validateEntity().
Anybody out there with a clue ....
Thanassis

Similar Messages

  • 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 to restrict the size of a km repository

    Hi all,
        How can i restrict the size of a KM repository/folder ?
    Thanks & Regards
      DD

    Hi,
    Please check these link:-
    1.[https://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/3219]
    2.https://www.sdn.sap.com/irj/scn/thread?messageID=601915
    3.https://www.sdn.sap.com/irj/scn/thread?messageID=135202
    Best Regards,
    Atul Bhatia

  • How to restrict the size of Buffer data object

    Hi everyone.
    How do you restrict the size of the Buffer data object. The byte array that you get by calling getData(). I want to restrict the size to be at most X nbr of bytes. I'm 'filling' the buffer like this:
    Buffer readBuffer;
    PushBufferStream stream;
    stream.read(readBuffer);

    This is my code:
    class DataSourceHandler implements DataSink, BufferTransferHandler {
              private int MAX_DATA_PACKET_SIZE = 2000;
              private DataSource source;
              private PullBufferStream pullStrms[] = null;
              private PushBufferStream pushStrms[] = null;
              // Data sink listeners.
              private Vector listeners = new Vector(1);
              // Stored all the streams that are not yet finished (i.e. EOM
              // has not been received.
              private SourceStream unfinishedStrms[] = null;
              // Loop threads to pull data from a PullBufferDataSource.
              // There is one thread per each PullSourceStream.
              private Loop loops[] = null;
              private Buffer readBuffer;
               * Sets the media source this <code>MediaHandler</code> should use to
               * obtain content.
              public void setSource(DataSource source)
                        throws IncompatibleSourceException {
                   // Different types of DataSources need to handled differently.
                   if (source instanceof PushBufferDataSource) {
                        System.out.println("source instanceof PushBufferDataSource");
                        pushStrms = ((PushBufferDataSource) source).getStreams();
                        unfinishedStrms = new SourceStream[pushStrms.length];
                        // Set the transfer handler to receive pushed data from
                        // the push DataSource.
                        for (int i = 0; i < pushStrms.length; i++) {
                             pushStrms.setTransferHandler(this);
                             unfinishedStrms[i] = pushStrms[i];
                   } else if (source instanceof PullBufferDataSource) {
                        System.out.println("source instanceof PullBufferDataSource");
                        pullStrms = ((PullBufferDataSource) source).getStreams();
                        unfinishedStrms = new SourceStream[pullStrms.length];
                        // For pull data sources, we'll start a thread per
                        // stream to pull data from the source.
                        loops = new Loop[pullStrms.length];
                        for (int i = 0; i < pullStrms.length; i++) {
                             loops[i] = new Loop(this, pullStrms[i]);
                             unfinishedStrms[i] = pullStrms[i];
                   } else {
                        // This handler only handles push or pull buffer datasource.
                        throw new IncompatibleSourceException();
                   this.source = source;
                   readBuffer = new Buffer();
                   byte[] data = new byte[MAX_DATA_PACKET_SIZE];
                   readBuffer.setData(data);
              * For completeness, DataSink's require this method. But we don't need
              * it.
              public void setOutputLocator(MediaLocator ml) {
              public MediaLocator getOutputLocator() {
                   return null;
              public String getContentType() {
                   return source.getContentType();
              * Our DataSink does not need to be opened.
              public void open() {
              public void start() {
                   try {
                        source.start();
                   } catch (IOException e) {
                        System.err.println(e);
                   // Start the processing loop if we are dealing with a
                   // PullBufferDataSource.
                   if (loops != null) {
                        for (int i = 0; i < loops.length; i++)
                             loops[i].restart();
              public void stop() {
                   try {
                        source.stop();
                   } catch (IOException e) {
                        System.err.println(e);
                   // Start the processing loop if we are dealing with a
                   // PullBufferDataSource.
                   if (loops != null) {
                        for (int i = 0; i < loops.length; i++)
                             loops[i].pause();
              public void close() {
                   stop();
                   if (loops != null) {
                        for (int i = 0; i < loops.length; i++)
                             loops[i].kill();
              public void addDataSinkListener(DataSinkListener dsl) {
                   if (dsl != null)
                        if (!listeners.contains(dsl))
                             listeners.addElement(dsl);
              public void removeDataSinkListener(DataSinkListener dsl) {
                   if (dsl != null)
                        listeners.removeElement(dsl);
              protected void sendEvent(DataSinkEvent event) {
                   if (!listeners.isEmpty()) {
                        synchronized (listeners) {
                             Enumeration list = listeners.elements();
                             while (list.hasMoreElements()) {
                                  DataSinkListener listener = (DataSinkListener) list
                                            .nextElement();
                                  listener.dataSinkUpdate(event);

  • 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 limit the size of the connection method parameter

    I connected an FMS server like var nc = new NetConnection ();
                                                      nc.connect ("rtmfp :/ / localhost: 61018/zy/1", a);
    But how to restrict the size of the parameter a, assuming that this a set to a 10GB object, or a very large byte, I found that the server received. This allows the hacker attacks, Is there any way to limit the size of this a, I hope that does not exceed 100KB.

    RTMFP encodes low-level messages in a manner compatible with RTMP messages. RTMP messages are length-field limited to 16MB (24 bits), and there is an artificial software limit somewhat less than that (approximately 10MB if i recall correctly).
    it should not be possible to send a connect message to an RTMFP or RTMP server exceeding about 10MB.
    ByteArray is limited to 4GB, and can't be serialized to AMF beyond 512MB (29 bits).
    also keep in mind that for an RTMFP or RTMP server to receive such a large message, that many bytes must be sent to it from somewhere (you).

  • How to restrict the Number of attachments

    Hi All,
    I would like to restrict the Number of Attachments,
    I found many threads on how to restrict the size on the attachments.
    Is there any standard way(profile or setup) to restrict the number of attachments
    Other Option is
    When the user try to add attachments, I need to get the Entity, PRIMARY key and
    query FND_ATTACHED_DOCUMENTS count and through an error message.
    Not sure how easy it is.
    If anybody tried this requirement please share the logic to achieve the same.
    Thanks,
    With Regards,
    Kali.

    Hi All,
    I have achieved using the below logic, in the ProcessFormRequest,
    String eventParam = pageContext.getParameter(EVENT_PARAM);
    if("oaAddAttachment".equals(eventParam))
    String pkValue = pageContext.getParameter("PKEYID");
    String attachmentCountQry = "SELECT count(*) FROM fnd_attached_documents WHERE entity_name = <EONAME> AND pk1_value = "+pkValue ;
    //Execute the query and get the count,
    int attachmentsCountInt = executeQuery(attachmentCountQry );
    if(attachmentsCountInt >=2)
    throw new OAException("Add only 2 attachments");
    With Regards,
    Kali.

  • How to restrict the decimal entry on dynamic table in adf 11 .6

    Hi All,
      JDev version 11.6
      I have a usecase based on dynamic VO. How to restrict the decimal numbers on table columns . When user enter the decimal number .I have to show error message.
      In order to achieve above requirement .I have added value change listener on table column .its not working as expected
    <af:table rows="#{bindings.EmployeeDynamicVO.rangeSize}"
                      fetchSize="#{bindings.EmployeeDynamicVO.rangeSize}"
                      emptyText="#{bindings.EmployeeDynamicVO.viewable ? 'No data to display.' : 'Access Denied.'}"
                      var="row" rowBandingInterval="0"
                      value="#{bindings.EmployeeDynamicVO.collectionModel}"
                      selectedRowKeys="#{bindings.EmployeeDynamicVO.collectionModel.selectedRow}"
                      selectionListener="#{bindings.EmployeeDynamicVO.collectionModel.makeCurrent}"
                      rowSelection="single" id="t1"
                      styleClass="AFStretchWidth" autoHeightRows="-1"
                      columnStretching="last" contentDelivery="immediate" >
              <af:forEach items="#{bindings.EmployeeDynamicVO.attributeDefs}"
                          var="def">
                <af:column headerText="#{bindings.EmployeeDynamicVO.labels[def.name]}"
                           sortProperty="#{def.name}" id="c1">
                  <af:inputText value="#{row[def.name]}" id="ot1"
                                valueChangeListener="#{backingBeanScope.EmployeeBean.validateINputs}"
                                autoSubmit="true">
                    </af:inputText>
                  <af:outputText value="#{row[def.name]}" id="ot6"
                                 visible="#{def.name eq 'Dummy'}"/>
                </af:column>
              </af:forEach>
            </af:table>
    So appriciate if any alternatives on above usecase. Thanks in advance

    HI
    Expected :as soon as user enter the decimal values in table column , it should throw the error message in new small new window
    Getting the value change listener and validating , but its working only tab out (Because VO is dynamic )
    please suggest us any reg expression and Validators to achieve the above scenario ?

  • How do I restrict the size of Time Machine Back ups?

    I have a WD 500GB FW external drive which I use to store Sample Libraries for Logic Pro. I also use the same drive for Time Machine.
    I now realise that I really needed to set up a partition to restrict the size of Time Machine BackUp's.
    Is there any way of doing this now without having to reformat the drive and then setting up partitions, as this would delete my sample audio files.
    I was thinking of getting a second 500GB hard drive & daisy chaining them then creating alias's and moving my sample audio files to the new drive and leaving the existing one purely for TM backup's.
    Is, as I think it may be, this second option the better method?

    Disk Utility in Leopard can create a new partition without erasing the disk (of course you can't expect to make the existing partition smaller than the files it currently contains). You would then have the existing files on one partition and the new one would be blank, so you would have to move either the Libraries or the TM backup (I'm not sure whether you can do the latter without confusing TM).
    Two separate drives would give you more overall space, and should work fine.

  • How to find the size of an arrayList through Expression Builder.

    Hai OTN,
    How to find the size of an arrayList through Expression. I have a managed bean in View Scope.I am using Jdeveloper 11.1.1.2 with ADF Faces components.
    Managed Bean :
    ArrayList<IllnessEmployeesObj> employeeGridList =
    new ArrayList<IllnessEmployeesObj>();
    JSPX :
    Value="#{viewScope.PandIVH.employeeGridList.size}"
    Error : java.lang.NumberFormatException: For input string: "size"

    Hi Dinil,
    I have provided you with a sample that would show you the how you can get the size of an arraylist
    the sample has a page untitled1 and a bean named test.
    I have run in on jdev 11.1.2 and it is ok, it will be ok on 11.1.3
    after running the sample you will see the 2.
    please remember that you must add the JSTL taglib on the viewcontroller.
    just right click on viewcontroller, go to tag lib select the jstl.
    page
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <%@ page contentType="text/html;charset=UTF-8"%>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
    <f:view>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <title>untitled1</title>
    </head>
    <body>
    <h:form>
    <h:outputText value="#{fn:length(test.a)}"/>
    </h:form>
    </body>
    </html>
    </f:view>
    bean
    import java.util.ArrayList;
    public class Test {
    public Test() {
    a= new ArrayList();
    Object o=new Object();
    a.add(o);
    a.add(o);
    ArrayList a;
    public void setA(ArrayList a) {
    this.a = a;
    public ArrayList getA() {
    return a;
    I hope this sample came handy.
    regards,

  • 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 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 restrict the changes in Relesed PO?.

    Hi all,
    How to restrict the users to make a changes in the Released PO?. User should make the changes only if it is unreleased by the respective codes.
    1. Is there any user parameters like functional authorisation?
    2. I have already suggested two solutions to the clients that
        1. To restrict the authorisation of TCodes ME22n at the user level, but it's not a suitable solution, if user want to make any changes before releasing, then system is not allow to do the changes.
        2. I have made release indicator as a 1 - not changeable if it is released, in release strategy settings. But the system is not allowing the all the users including release codes to make the changes?.
    If there is any solution, please reply immediately.
    with regards,
    Raja.

    hi,
    if u set release indicator 1, after release is taken place, for any changes, u need to revoke the release. and then change the PO.
    even u cant directly block the changes to already released PO, because, in future if at all qty or some changes is required to change, it should allow u to change!

  • How to initilize the size of rows in an jtable in run time

    i am trying to retrieve data from a oracle database and display them in an jtable ,but i could not figure out how to increase the size of the table based on the number of records fetched in runtime. i also want to add checkbox for each enrty made in the jtable such that by cheching the box ,i could select the data and process it in futher frames. i use an netbean5 version for design.kindly give me giudence.

    Best thing to do is write your own table model and a Cell Renderer for the check box.
    Please follow the "How to use tables" tutorial.
    http://java.sun.com/docs/books/tutorial/uiswing/components/table.html

  • How to restrict the job start conditions (only "Immediate" type) ?

    Hi,
    We allow our users to schedule and execute in background mode transactions (example IP19, IW38). We gave them for that authorizations (object S_BTCH_JOB with LIST, PROT, RELE and SHOW - objetct S_PROGRAM with BTCSUBMIT).
    We would like that users can schedule and execute their jobs only with the u201CImmediateu201D job start condition (in the Start Time screen for the type of start condition : Immediate, Date/Time, After job, After event, or At operation mode).
    Another solution: prohibit the scheduling and the execution background job in a certain time interval ...
    How can restrict the job start conditions ?
    Thank you.
    Patrice.

    Hi Jan,
    Yes, sa38 makes it possible indeed to execute in background into immediate mode a job but
    the user have to know the name of the program to be carried out ...
    The user knows only the name of these transactions trade. For example, IW38.
    In the menu of this transaction, SAP gives the possibility to execute in background :
    Program --> Execute in Background --> display of Start Time screen for the type of start condition :
    Immediate, Date/Time, After job, After event, or At operation mode).
    It is at this time there that we want that the user can only choose the "immediate" mode.
    We must thus prohibit the other choices (Date/Time, After job, After event, or At operation mode) ... and
    and we don't know how to restrict these other options in this screen "Start Time screen for the type of start condition".
    Thank you.
    By.

Maybe you are looking for