Contenu connexe Similaire à Apache Felix Web Console (20) Plus de Felix Meschberger (6) Apache Felix Web Console1. Apache Felix Web Console
Felix Meschberger, Principal Scientist, Adobe
© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. 1
2. Problem
Manage an OSGi Framework
Remote Access
Ease of Use
Extensibility
Offline Support
© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. 2
3. Solutions
Text based
Apache Felix Shell
Apache Felix Gogo
Knopflerfish Shell
Equinox Console (built-in)
OSGi RFC 147 (Command Line Interface)
GUI based
Apache Felix Web Console
Knopflerfish Desktop (Swing)
© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. 3
4. Features
Rich Set of Core Functionality
JQuery UI based GUI
REST API
Pluggable Authentication
Extensible
Light-weight
Manage Bundles
List Services
Configuration
System Information
Configuration Status
© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. 4
5. Installations
Dependencies:
OSGi Http Service
Commons IO 1.4
Commons File Upload 1.2
org.json (e.g. Apache Geronimo Bundles: json-20090211)
© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. 5
6. Extension Points
Plugins
Configuration Printer
Branding
Security Provider
Translations
© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. 6
7. Plugins
javax.servlet.Servlet services
Extend AbstractWebConsolePlugin (optional)
Service Properties
felix.webconsole.label
felix.webconsole.title
© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. 7
8. Sample Plugin #1
@Component
@Service(Servlet.class)
@Properties({
@Property(name="felix.webconsole.label",
value="sample"),
@Property(name="felix.webconsole.title",
value="Sample Plugin #1")
})
public class Sample extends HttpServlet {
public void service(HttpServletRequest req,
HttpServletResponse res)
throws IOException {
res.getWriter().println("Hi There...");
}
}
© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. 8
9. Sample Plugin #2
public class Sample2 extends SimpleWebConsolePlugin {
public Sample2(BundleContext ctx) {
super("sample2", "Sample Plugin #2", null);
register(ctx);
}
@Override
protected void renderContent(
HttpServletRequest req,
HttpServletResponse res)
throws IOException {
res.getWriter().println("Hi There ...")
}
}
© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. 9
10. Configuration Printer
Information Dump for Offline Use
Selective Destination: implements
ModeAwareConfigurationPrinter
Screen Only
All-in-one Text
ZIP File
Optional Attachements: implements AttachmentProvider
© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. 10
11. Branding
Service Interface: BrandingPlugin
Default Branding: DefaultBrandingPlugin
Branding Fragment
/META-INF/webconsole.properties
webconsole.brand.name = Apache Sling Web Console
webconsole.product.name = Apache Sling
webconsole.product.url = http://sling.apache.org
webconsole.product.image = /res/sling/logo.png
webconsole.favicon = /res/sling/favicon.ico
Sample
Sling Web Console Branding Plugin
© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. 11
12. Security Provider
Service interface: WebConsoleSecurityProvider
HTTP Basic Authentication Based
Validates Username / Password
Access Control (hook only)
Service Interface: WebConsoleSecurityProvider2
Extends WebConsoleSecurityProvider
Flexible Authentication (implementing HttpContext.handleSecurity)
Implementations
Default: Single configurable User
Karaf: JAAS based authentication
Sling
Authenticates against JCR Repository
Supports Sling Authentication Setup
© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. 12
13. Translations
Out-of-the-box
Bulgarian, English, German, Russian
Extensible
Fragment to the Web Console
Based on Standard Bundle Localization
OSGI-INF/l10n/bundle*.properties
© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. 13
14. Maven Sling Plugin
install
Install a Bundle after a build
Similar to deploy:deploy
install-file
Install a Bundle independent of a build
Similar to deploy:deploy-file
uninstall
Uninstall a Bundle
See: http://sling.apache.org/site/sling.html
© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. 14
Notes de l'éditeur \n Day (before being acquired by Adobe) started using OSGi in 2007. Except for a handful of people actively working on this, OSGi was still a new technology and there was fear, that we will not be able to manage and administer the frameworks. Providing text based consoles was not an option. Because our application is a Web application based on a framework today known as Apache Sling it is reasonable to use the same mechanism for administration\n \n \n \n \n \n \n \n \n \n \n \n \n