Codota Logo
ModelReference
Code IndexAdd Codota to your IDE (free)

How to use
ModelReference
in
org.hippoecm.frontend.model

Best Java code snippets using org.hippoecm.frontend.model.ModelReference (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Dictionary d =
  • Codota Iconnew Hashtable()
  • Codota IconBundle bundle;bundle.getHeaders()
  • Codota Iconnew Properties()
  • Smart code suggestions by Codota
}
origin: org.onehippo.ecm/hst-addon-configuration-editor-frontend

  public FolderTreePlugin(IPluginContext context, IPluginConfig config) {
    super(context, config);
    
    JcrNodeModel model = new JcrNodeModel(config.getString("path", "/"));
    ModelReference<Node> modelService = new ModelReference<Node>(context.getReference(this).getServiceId(), model);
    modelService.init(context);
  }
}
origin: org.onehippo.cms7/hippo-cms-editor-frontend

public void stop() {
  control.stop();
  typeService.destroy();
  modelService.destroy();
}
origin: org.onehippo.cms7/hippo-cms-editor-frontend

public C getModel() {
  return (C) modelRef.getModel();
}
origin: org.onehippo.cms7/hippo-addon-hst-configuration-editor-frontend

protected ViewController(IPluginContext context, IPluginConfig config, String hstContextId, JcrNodeModel rootModel) {
  this.config = config;
  this.context = context;
  this.hstContextId = hstContextId;
  if (config.containsKey(MODEL_ROOT)) {
    this.rootModel = new JcrNodeModel(config.getString(MODEL_ROOT));
  } else {
    this.rootModel = rootModel;
  }
  @SuppressWarnings("unchecked")
  IModelReference<Node> modelService = context.getService(config.getString(MODEL), IModelReference.class);
  if (modelService != null) {
    onModelChanged(modelService.getModel());
  } else {
    final ModelReference<Node> modelRef = new ModelReference<Node>(config.getString(MODEL), this.rootModel);
    modelRef.init(context);
    context.registerService(new IObserver<IModelReference<?>>() {
      private static final long serialVersionUID = 1L;
      public IModelReference<?> getObservable() {
        return modelRef;
      }
      public void onEvent(Iterator<? extends IEvent<IModelReference<?>>> event) {
        onModelChanged(modelRef.getModel());
      }
    }, IObserver.class.getName());
    onModelChanged(modelRef.getModel());
  }
}
origin: org.onehippo.cms7/hippo-cms-api

modelService = new ModelReference<>(modelId, getEditorModel());
modelService.init(context);
  baseService = new ModelReference<>(baseId, getBaseModel());
  baseService.init(context);
  context.unregisterService(this, editorId);
  context.unregisterService(editorContext.getEditorManager(), editorId);
  modelService.destroy();
  throw new EditorException("No IRenderService found");
origin: org.onehippo.cms7/hippo-cms-api

public void updateModel(IModel<Node> model) {
  super.setModel(model);
}
origin: org.onehippo.cms7/hippo-cms-api

public void detach() {
  model.detach();
  if (modelService != null) {
    modelService.detach();
  }
}
origin: org.onehippo.ecm/hst-addon-configuration-editor-frontend

protected ViewController(IPluginContext context, IPluginConfig config, JcrNodeModel rootModel) {
  this.config = config;
  this.context = context;
  if (config.containsKey(MODEL_ROOT)) {
    this.rootModel = new JcrNodeModel(config.getString(MODEL_ROOT));
  } else {
    this.rootModel = rootModel;
  }
  @SuppressWarnings("unchecked")
  IModelReference<Node> modelService = context.getService(config.getString(MODEL), IModelReference.class);
  if (modelService != null) {
    onModelChanged(modelService.getModel());
  } else {
    final ModelReference<Node> modelRef = new ModelReference<Node>(config.getString(MODEL), this.rootModel);
    modelRef.init(context);
    context.registerService(new IObserver<IModelReference<?>>() {
      private static final long serialVersionUID = 1L;
      public IModelReference<?> getObservable() {
        return modelRef;
      }
      public void onEvent(Iterator<? extends IEvent<IModelReference<?>>> event) {
        onModelChanged(modelRef.getModel());
      }
    }, IObserver.class.getName());
    onModelChanged(modelRef.getModel());
  }
}
origin: org.onehippo.cms7/hippo-cms-api

public void updateModel(IModel<Node> model) {
  super.setModel(model);
}
origin: org.onehippo.cms7/hippo-cms-editor-frontend

@Override
protected void onDetach() {
  IModel<Node> model = this.getModel();
  if (model != null) {
    model.detach();
  }
  engineFactory.detach();
  if (modelService != null) {
    modelService.detach();
  }
  super.onDetach();
}
origin: org.onehippo.cms7/hippo-addon-hst-configuration-editor-frontend

  public FolderTreePlugin(IPluginContext context, IPluginConfig config) {
    super(context, disableIfNoPathPresent(config));

    JcrNodeModel model = new JcrNodeModel(config.getString("path"));
    ModelReference<Node> modelService = new ModelReference<Node>(context.getReference(this).getServiceId(), model);
    modelService.init(context);
  }
}
origin: org.onehippo.cms7/hippo-cms-workflowmenu

  void stop() {
    control.stop();
    modelService.destroy();
  }
}
origin: org.onehippo.cms7/hippo-cms-editor-frontend

@Override
public void setObject(final String object) {
  selectedPluginService.setModel(new Model<String>(object));
}
origin: org.onehippo.cms7/hippo-cms-editor-frontend

@Override
public String getObject() {
  if (selectedPluginService.getModel() != null) {
    return selectedPluginService.getModel().getObject();
  }
  return null;
}
origin: org.onehippo.cms7/hippo-cms-workflowmenu

public IRenderService startRenderer(IPluginConfig config, WorkflowDescriptorModel wdm) {
  if (config == null) {
    return null;
  }
  String wicketModelId = baseServiceName + "." + "model" + clusters.size();
  ModelReference modelRef = new ModelReference(wicketModelId, wdm);
  modelRef.init(context);
  JavaClusterConfig childClusterConfig = new JavaClusterConfig();
  IPluginConfig childPluginConfig = new JavaPluginConfig(new InheritingPluginConfig(config, this.config));
  String wicketRenderId = baseServiceName + "." + "id" + clusters.size();
  childPluginConfig.put(RenderService.WICKET_ID, wicketRenderId);
  childPluginConfig.put(RenderService.MODEL_ID, wicketModelId);
  childClusterConfig.addPlugin(childPluginConfig);
  IClusterControl control = context.newCluster(childClusterConfig, null);
  control.start();
  clusters.add(new Cluster(control, modelRef));
  return context.getService(wicketRenderId, IRenderService.class);
}
origin: org.onehippo.cms7/hippo-cms-editor-frontend

@Override
public void onModelChanged() {
  super.onModelChanged();
  if (cluster != null) {
    cluster.stop();
    modelService.destroy();
  }
  createTemplate();
}
origin: org.onehippo.cms7/hippo-addon-publication-workflow-frontend

if (historicDocument == null) {
  infoComponent.setDefaultModel(new Model("There was no document published during this period"));
  subModel.setModel(null);
} else {
  infoComponent.setDefaultModel(new Model(""));
  subModel.setModel(new JcrNodeModel(document.getSession().getNodeByUUID(
      historicDocument.getIdentity())));
origin: org.onehippo.cms7/hippo-addon-hst-configuration-editor-frontend

public void onEvent(Iterator<? extends IEvent<IModelReference<?>>> event) {
  onModelChanged(modelRef.getModel());
}
origin: org.onehippo.cms7/hippo-addon-publication-workflow-frontend

  subModel = new ModelReference(config.getString("wicket.submodel"), null);
  subModel.init(context);
} else {
  log.warn("");
origin: org.onehippo.cms7/hippo-cms-editor-frontend

public void destroy() {
  if (cluster != null) {
    cluster.stop();
    modelService.destroy();
  }
  context.unregisterTracker(fieldTracker, engineId + ".wicket.root");
  context.unregisterService(engineFactory, ITemplateEngine.class.getName());
  validation.stop();
}
org.hippoecm.frontend.modelModelReference

Javadoc

The default implementation of the IModelReference service interface.

After a model service is created, it can be made to register it self under the provided service id using the ModelReference#init method.

When model services are no longer needed, e.g. because the cluster that need it is no longer active, be sure to unregister the service using ModelReference#destroy.

Most used methods

  • <init>
    Construct a model service with a given service id and initial model.
  • init
    Register the service with the specified service id.
  • destroy
    Unregister the service with the specified service id.
  • getModel
  • setModel
  • detach

Popular in Java

  • Reading from database using SQL prepared statement
  • getContentResolver (Context)
  • orElseThrow (Optional)
  • scheduleAtFixedRate (Timer)
    Schedules the specified task for repeated fixed-rate execution, beginning after the specified delay.
  • FileInputStream (java.io)
    A FileInputStream obtains input bytes from a file in a file system. What files are available depends
  • Dictionary (java.util)
    The Dictionary class is the abstract parent of any class, such as Hashtable, which maps keys to valu
  • Hashtable (java.util)
    Hashtable is a synchronized implementation of Map. All optional operations are supported.Neither key
  • Locale (java.util)
    A Locale object represents a specific geographical, political, or cultural region. An operation that
  • AtomicInteger (java.util.concurrent.atomic)
    An int value that may be updated atomically. See the java.util.concurrent.atomic package specificati
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now