org.apache.sling.models.factory.ModelFactory Java Examples

The following examples show how to use org.apache.sling.models.factory.ModelFactory. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ExportServlet.java    From sling-org-apache-sling-models-impl with Apache License 2.0 6 votes vote down vote up
public ExportServlet(BundleContext bundleContext, ModelFactory modelFactory,
                     BindingsValuesProvidersByContext bindingsValuesProvidersByContext, SlingModelsScriptEngineFactory scriptFactory,
                     Class<?> annotatedClass, String registeredSelector, String exporterName, ExportedObjectAccessor accessor,
                     Map<String, String> baseOptions) {
    this.bundleContext = bundleContext;
    this.modelFactory = modelFactory;
    this.bindingsValuesProvidersByContext = bindingsValuesProvidersByContext;
    this.scriptEngineFactory = scriptFactory;
    this.registeredSelector = registeredSelector;
    this.exporterName = exporterName;
    this.accessor = accessor;
    this.baseOptions = baseOptions;

    String loggerName = ExportServlet.class.getName() + "." + annotatedClass.getName();
    this.logger = LoggerFactory.getLogger(loggerName);
}
 
Example #2
Source File: ExportServlet.java    From sling-org-apache-sling-models-impl with Apache License 2.0 4 votes vote down vote up
@Override
public String getExportedString(SlingHttpServletRequest request, Map<String, String> options, ModelFactory modelFactory, String exporterName) throws ExportException, MissingExporterException {
    Object adapter = modelFactory.createModel(request.getResource(), adapterClass);
    return modelFactory.exportModel(adapter, exporterName, String.class, options);
}
 
Example #3
Source File: ExportServlet.java    From sling-org-apache-sling-models-impl with Apache License 2.0 4 votes vote down vote up
@Override
public String getExportedString(SlingHttpServletRequest request, Map<String, String> options, ModelFactory modelFactory, String exporterName) throws ExportException, MissingExporterException {
    Object adapter = modelFactory.createModel(request, adapterClass);
    return modelFactory.exportModel(adapter, exporterName, String.class, options);
}
 
Example #4
Source File: Helper.java    From aem-ide-tooling-4-intellij with Apache License 2.0 4 votes vote down vote up
public void activate() {
    model = getSlingScriptHelper().getService(ModelFactory.class).getModelFromResource(getResource()); 
}
 
Example #5
Source File: Helper.java    From aem-ide-tooling-4-intellij with Apache License 2.0 4 votes vote down vote up
public void activate() {
    model = getSlingScriptHelper().getService(ModelFactory.class).getModelFromResource(getResource()); 
}
 
Example #6
Source File: ExportServlet.java    From sling-org-apache-sling-models-impl with Apache License 2.0 votes vote down vote up
String getExportedString(SlingHttpServletRequest request, Map<String, String> options, ModelFactory modelFactory, String exporterName) throws ExportException, MissingExporterException;