Package com.ibm.xsp

Examples of com.ibm.xsp.FacesExceptionEx


            String ext = null;
            if (dot > -1) {
                ext = name.substring(dot + 1); // add one for the dot!
            }
            if (StringUtil.isEmpty(ext)) {
                throw new FacesExceptionEx(new NullPointerException(), "Extension of file being uploaded may not be null");
            }
            if (authBean != null && !authBean.isAuthenticated()) {
                authBean.authenticate(false);
            }
           
            InputStream is = null;
       
          try {
        is = new FileInputStream(serverFile);
        ContentStream contentFile = new ContentStream(is,serverFile.length(), name);
        SmartCloudService svc = new SmartCloudService(authBean);

        svc.post(SERVICE_URL, params, contentFile);
        
          } catch (ClientServicesException e) {
              e.printStackTrace();
          } catch (FileNotFoundException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
      }
         

        finally {
          if(is != null)
            try {
              is.close();
            } catch (IOException e) {
              e.printStackTrace();
            }
        }
           
        } catch (ClientServicesException e) {
            throw new FacesExceptionEx(e);
        }
    }
View Full Code Here


            ScriptResource configJS = new ScriptResource();
            configJS.setClientSide(true);
            configJS.setContents(b.toString());
            rootEx.addEncodeResource(context,configJS);
        } catch(JsonException ex) {
            throw new FacesExceptionEx(ex);
        }
    }
View Full Code Here

//                    }
                }
                TwitterEntry[] data = entries.toArray(new TwitterEntry[0]);
                return new ArrayBlock(index, data);
            } catch (Exception ex) {
                throw new FacesExceptionEx(ex, "Error calling twitter service with url {0}", statusUrl);
            }
        }
View Full Code Here

                Map<String,String> parameters = getParameters(index, blockSize);
                HandlerXml xml = new HandlerXml();
                Document doc = (Document)svc.get(getServiceUrl(),parameters, xml).getData();
                return new XmlBlock(index,doc);
            } catch(Exception ex) {
                throw new FacesExceptionEx(ex,"Error while reading the XML service entries");
            }
        }
View Full Code Here

            return new ASJsonAccessor(this);
        }
        if(StringUtil.equals(format, "atom")) {
            return new ASXmlAccessor(this);
        }
        throw new FacesExceptionEx(null,"Unknown ActivityStreams format {0}",format);
    }
View Full Code Here

        UIFacebookClient dialog = (UIFacebookClient)component;

        String endpoint = dialog.getEndpoint();
    Endpoint _bean = EndpointFactory.getEndpoint(endpoint, EndpointFactory.SERVER_FACEBOOK);
    if(!(_bean instanceof OAuthEndpoint)) {
        throw new FacesExceptionEx("The Facebook endpopint must be a OAuthEndPoint");
    }
    OAuthEndpoint bean = (OAuthEndpoint)_bean;
   
        writeJSSDK(context, component, bean);
    }
View Full Code Here

           
          try {
            JsonGenerator.toJson(JsonJavaFactory.instance,b,config,true);
          }
          catch(JsonException ex) {
            throw new FacesExceptionEx(ex);
          }
         
            writer.writeText("\nwindow.fbAsyncInit = function() {", null);
          writer.writeText("\nFB.init(" + b + ");};", null);
         
View Full Code Here

                for(int i=0; i<data.length; i++) {
                    data[i] = entry.get(i);
                }
                return new ArrayBlock(index,data);
            } catch(Exception ex) {
                throw new FacesExceptionEx(ex,"Error while reading the Activity Streams");
            }
        }
View Full Code Here

//               Document doc = (Document)svc.get(parameters, ClientService.FORMAT_XML);
               
//                return new XmlBlock(index,doc);
                return null;
            } catch(Exception ex) {
                throw new FacesExceptionEx(ex,"Error while reading the Activity Streams");
            }
        }
View Full Code Here

            ScriptResource configJS = new ScriptResource();
            configJS.setClientSide(true);
            configJS.setContents(b.toString());
            rootEx.addEncodeResource(context,configJS);
        } catch(JsonException ex) {
            throw new FacesExceptionEx(ex);
        }
    }
View Full Code Here

TOP

Related Classes of com.ibm.xsp.FacesExceptionEx

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.