congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
FormEditorContextManager
Code IndexAdd Tabnine to your IDE (free)

How to use
FormEditorContextManager
in
org.jbpm.formModeler.api.client

Best Java code snippets using org.jbpm.formModeler.api.client.FormEditorContextManager (Showing top 9 results out of 315)

origin: org.jbpm/jbpm-form-modeler-editor-backend

@Override
public void changeContextPath( String ctxUID, Path path ) {
  if ( StringUtils.isEmpty( ctxUID ) ) return;
  formEditorContextManager.getFormEditorContext( ctxUID ).setPath( Paths.convert( path ).toUri().toString() );
}
origin: org.jbpm/jbpm-form-modeler-editor-backend

@Override
public Form getForm( String ctxUID ) {
  FormEditorContext context = formEditorContextManager.getRootEditorContext( ctxUID );
  if ( context != null ) return context.getForm();
  return null;
}
origin: org.jbpm/jbpm-form-modeler-editor-backend

@Override
public void removeEditingForm( String ctxUID ) {
  formEditorContextManager.removeEditingForm( ctxUID );
}
origin: org.jbpm/jbpm-form-modeler-editor-backend

@Override
protected FormModelerContent constructContent( Path path, Overview overview ) {
  try {
    org.uberfire.java.nio.file.Path kiePath = Paths.convert( path );
    Form form = findForm( kiePath );
    FormEditorContextTO contextTO = new FormEditorContextTO();
    if (form == null) {
      contextTO.setLoadError( true );
      form = formManager.createForm(path.getFileName());
    }
    String formPath = kiePath.toUri().toString();
    FormEditorContext context = formEditorContextManager.newContext(form, formPath);
    contextTO.setCtxUID( context.getUID() );
    FormModelerContent result = new FormModelerContent();
    result.setContextTO( contextTO );
    result.setPath( path );
    result.setOverview( overview );
    resourceOpenedEvent.fire(new ResourceOpenedEvent( path, sessionInfo ));
    return result;
  } catch (Exception e) {
    log.warn("Error loading form " + path.toURI(), e);
  }
  return null;
}
origin: org.jbpm/jbpm-form-modeler-editor-backend

@Override
public Form getFormByPath( String ctxUID, String formPath ) {
  FormEditorContext editorContext = formEditorContextManager.getRootEditorContext( ctxUID );
  if ( editorContext != null ) {
    try {
      Path currentForm = Paths.convert( ioService.get( new URI( editorContext.getPath() ) ) );
      org.uberfire.java.nio.file.Path path = Paths.convert( currentForm ).getParent().resolve( formPath );
      String xml = ioService.readAllString( path ).trim();
      return formSerializationManager.loadFormFromXML( xml, path.toUri().toString() );
    } catch ( Exception e ) {
      log.warn( "Error getting form {} from context {}: {}", formPath, ctxUID, e );
    }
  }
  return null;
}
origin: org.jbpm/jbpm-form-modeler-editor-backend

@Override
public FormEditorContextTO reloadContent( Path path, String ctxUID ) {
  try {
    Form form = findForm( Paths.convert( path ) );
    FormEditorContext context = formEditorContextManager.getFormEditorContext( ctxUID );
    context.setForm( form );
    return new FormEditorContextTO( context.getUID() );
  } catch ( Exception e ) {
    log.warn( "Error loading form " + path.toURI(), e );
    return null;
  }
}
origin: org.jbpm/jbpm-form-modeler-editor-backend

TreeMap treeMap = new TreeMap<String, String>();
FormEditorContext context = formEditorContextManager.getRootEditorContext( namespace );
origin: org.jbpm/jbpm-form-modeler-editor-backend

@Override
public Path save( Path path, FormEditorContextTO content, Metadata metadata, String comment ) {
  FormEditorContext ctx = formEditorContextManager.getFormEditorContext( content.getCtxUID() );
  ioService.write( Paths.convert( path ), formSerializationManager.generateFormXML( ctx.getForm() ), metadataService.setUpAttributes( path, metadata ), commentedOptionFactory.makeCommentedOption( comment ) );
  return path;
}
origin: org.jbpm/jbpm-form-modeler-editor-backend

@Override
public Form getFormById( String ctxUID, long formId ) {
  FormEditorContext editorContext = formEditorContextManager.getRootEditorContext( ctxUID );
  if ( editorContext != null ) {
    try {
      if ( editorContext.getForm().getId().equals( new Long( formId ) ) ) {
        return editorContext.getForm();
      }
      Path currentForm = Paths.convert( ioService.get( new URI( editorContext.getPath() ) ) );
      Project project = projectService.resolveProject( currentForm );
      FileUtils utils = FileUtils.getInstance();
      List<org.uberfire.java.nio.file.Path> nioPaths = new ArrayList<org.uberfire.java.nio.file.Path>();
      nioPaths.add( Paths.convert( project.getRootPath() ) );
      Collection<FileUtils.ScanResult> forms = utils.scan( ioService, nioPaths, "form", true );
      String header = formSerializationManager.generateHeaderFormFormId( formId );
      for ( FileUtils.ScanResult form : forms ) {
        org.uberfire.java.nio.file.Path formPath = form.getFile();
        org.uberfire.java.nio.file.Path path = Paths.convert( project.getRootPath() ).resolve( MAIN_RESOURCES_PATH ).resolve( formPath );
        String xml = ioService.readAllString( path ).trim();
        if ( xml.startsWith( header ) ) {
          return formSerializationManager.loadFormFromXML( xml );
        }
      }
    } catch ( Exception e ) {
      log.warn( "Error getting form {} from context {}: {}", formId, ctxUID, e );
    }
  }
  return null;
}
org.jbpm.formModeler.api.clientFormEditorContextManager

Most used methods

  • getFormEditorContext
  • getRootEditorContext
  • newContext
  • removeEditingForm

Popular in Java

  • Updating database using SQL prepared statement
  • getApplicationContext (Context)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • Component (java.awt)
    A component is an object having a graphical representation that can be displayed on the screen and t
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • DecimalFormat (java.text)
    A concrete subclass of NumberFormat that formats decimal numbers. It has a variety of features desig
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now