Package org.ogce.expbuilder.context

Examples of org.ogce.expbuilder.context.ApplicationGlobalContext


    String gfacFactoryUrl = null;
    String notifBrokerUrl = null;
    String dscUrl = null;
    String myleadAgentUrl = null;
     
    ApplicationGlobalContext context;
    try {
      context = new ApplicationGlobalContext();
      xRegistryUrl = context.getXRegistryUrl();
      gfacFactoryUrl = context.getGfacFactoryUrl();
      notifBrokerUrl = context.getNotifBrokerUrl();
      dscUrl = context.getDscUrl();
      myleadAgentUrl = context.getMyleadAgentUrl();
    } catch (Exception e) {
      log.error("Error fetching properties", e);
    }
   
        LeadContextHeader lh = new LeadContextHeader(workflow.getExperimentID(), workflow.getUserID());
View Full Code Here


    ODEWorkflowManager odeWorkflowManager = new ODEWorkflowManager();
    XBayaWorkflowUtil xRegistryUtil = new XBayaWorkflowUtil();
   
    String xRegistryUrl = "";
    String workflowID = "Public_NAM_Initialization_WRF_Forecasting";
    ApplicationGlobalContext context;
    try {
      context = new ApplicationGlobalContext();
      context.getCredentials().setMyproxyUserName("");
      context.getCredentials().setMyproxyPassword("");
      context.login();
     
      xRegistryUrl = context.getXRegistryUrl();
      ExpBldrWorkflow expBldrWorkflow  =  xRegistryUtil.getWorkflowFromRegistry(workflowID, context);
     
      odeWorkflowManager.invokeWorkflow(expBldrWorkflow, context);
     
//     
View Full Code Here

    XBayaWorkflowUtil xRegistryUtil = new XBayaWorkflowUtil();
    String xRegistryUrl = "";
    String workflowID = "http://extreme.indiana.edu/lead/workflow/Public_NAM_Initialization_WRF_Forecasting";
   
    //String workflowID = "http://extreme.indiana.edu/lead/workflow/NCL_workflow_to_plot_precipitation";
    ApplicationGlobalContext context;
      try {
        context = new ApplicationGlobalContext();
        context.getCredentials().setMyproxyUserName("");
        context.getCredentials().setMyproxyPassword("");
        context.login();
       
        xRegistryUrl = context.getXRegistryUrl();
        ExpBldrWorkflow expBldrWorkflow  =  xRegistryUtil.getWorkflowFromRegistry(workflowID, context);
        System.out.println(expBldrWorkflow.getId());
        System.out.println(expBldrWorkflow.getName());
            System.out.println(expBldrWorkflow.getDescription());
            LinkedList<Pair<WSComponentPort, String>> workflowInputExtensionPairs = expBldrWorkflow.getWorkflowInputExtensionPairs();
View Full Code Here

      if (log.isDebugEnabled()) {
        log.debug("query string = " + request.getQueryString());
      }
      String workflowId = request.getParameter(WORKFLOW_ID);
        try {
      ApplicationGlobalContext context = new ApplicationGlobalContext();
     
        FileInputStream fis = new FileInputStream(context.getCredentials().getHostcertsKeyFile());
              GlobusCredential globusCred = new GlobusCredential(fis);
              context.setGssCredential(new GlobusGSSCredentialImpl(globusCred, GSSCredential.INITIATE_AND_ACCEPT));
        XBayaWorkflowUtil xRegistryUtil = new XBayaWorkflowUtil();
        this.workflow =  xRegistryUtil.getWorkflowFromRegistry(workflowId, context);
       
   
//        WorkflowWebResource workflowWebResource = null;
View Full Code Here

              Map userInfo = (Map) portletRequest.getAttribute(PortletRequest.USER_INFO);
              username = (userInfo!=null) ? (String) userInfo.get("user.name") : null;
              if (username == null) {
                  username = portletRequest.getRemoteUser();
              }
              ApplicationGlobalContext context = new ApplicationGlobalContext();
              Application application = facesContext.getApplication();
             
              if(ProxyManager.getDefaultProxy(username) == null){
                HttpServletResponse response = (HttpServletResponse) facesContext.getExternalContext().getResponse();
                PrintWriter out = response.getWriter();
                  out.println("<h3>Login to My Proxy server using your credentials!</h3><br>");
                  out.close();
                throw new Exception("Login to My Proxy server using your credentials!");
              }
              GSSCredential gssCredential = ProxyManager.getDefaultProxy(username);
              context.setGssCredential(gssCredential);
            if(context.getXmcCatTestUser() == null ){
              context.setXmcCatTestUser(gssCredential.getName().toString());
          }
            context.setPortalUserName(username);
            System.out.println("Getting Grid credential form Proxy worked for " + username);
             // to  create RegistryService instance
              ValueBinding binding = application.createValueBinding("#{applicationGlobalContext}");
          binding.setValue(facesContext, context);
          this.setContext(context);
          checkStatus = true;
            }else{
              UserInfo userInfo =  (UserInfo) facesContext.getExternalContext().getSessionMap().get("userInfo");
              String userName = userInfo.getUserName();
               GSSCredential credential = ProxyManager.getDefaultProxy(userName);
          if(credential != null){
            context = new ApplicationGlobalContext();
            context.setGssCredential(credential);
            context.load();
            facesContext.getExternalContext().getSessionMap().put("applicationGlobalContext", context);
            this.setContext(context);
              checkStatus = true;
          }else{
            FacesContext.getCurrentInstance().getExternalContext().redirect("proxyconfigure.jsf");
View Full Code Here

    public String getProjectName() {
      return projectName;
    }
    public static void main(String[] args) {
      try {
        ApplicationGlobalContext context = new ApplicationGlobalContext();
        context.login();
//        ProjectBean bean = new ProjectBean(context);
//        bean.projectList();
      } catch (Exception e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
View Full Code Here

        .getExternalContext().getResponse();
    HttpServletRequest request = (HttpServletRequest) context
        .getExternalContext().getRequest();
    response.setContentType("image/jpeg");
    Application application = context.getApplication();
    ApplicationGlobalContext appContext = (ApplicationGlobalContext) application
        .createValueBinding("#{applicationGlobalContext}").getValue(
            context);
    if (appContext == null) {
      String message = "<h1>Your tomcat server.xml must have emptySessionPath=\"true\", please set the property at your non-SSL HTTP/1.1 Connector</h1>";
      try {
        response.getWriter().write(message);
      } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
      }
      return;
    }
    String workflowID = request.getParameter("id");
    // String workflowID =
    // "http://extreme.indiana.edu/lead/workflow/Public_NAM_Initialization_WRF_Forecasting";

    // String workflowUrlType =
    // request.getParameter(WORKFLOW_URL_CONTEXT_TYPE);
    // String workflowId = request.getParameter(WORKFLOW_ID);
    try {
      WorkflowBean bean = new WorkflowBean();
      this.workflow = appContext.getExpBuilderManager().getWorkflow(workflowID);
      bean.setWorkflow(workflow);
      ValueBinding valueBinding = application.createValueBinding("#{workflow}");
      valueBinding.setValue(context, bean);
       
      BufferedImage buffer = workflow.getWorkflowImage();
View Full Code Here

TOP

Related Classes of org.ogce.expbuilder.context.ApplicationGlobalContext

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.