SlideShare uma empresa Scribd logo
1 de 34
ZINRO
A Eclipse / OSGI based Framework for
Information Management Systems
ZINRO is an OSGI/RCP based framework for developing Information Management
Systems in a Client / Server Architecture with a simplified approach towards handling
Business Entities. It provides application developers with a rich set of OSGI Services, UI
Elements, Eclipse Extensions and functions to focus on business logic while minimizing
labor intensive recurring tasks.
Some of the “Out of the box” features provided by Zinro are
•Entity Relationship Management
•Entity Validation
•Cross Bundle Transactions
•Annotation based Controlling
•UI Creation
•Widgets
•Report Infrastructure
•User and Group Management
•Resource and Access Control Management
•Login and Session Management
•License Management
•Server Side Spring Integration
•Client / Server Messaging
•Scheduled Job Publication
•RMI Publication
•Database Update mechanism on bundle
updates
Zinro Base Models
At the heart of the Zinro Framework are the base model classes
extending JPA entities. All Zinro Models must extend from one of the
base model class
AbstractView
AbstractIdView
AbstractModel
RelationalModel StatefulModel
…
…
…
Basic view Zinro Model Hierarchy
*Not all classes included
Relationships
Zinro provides its own relationship handling mechanism. Relationships are defined on Model
Classes using Annotations.
•Association - All classes extending AbstractModel can have 1-1 relationships with other
model classes defined using @ModelAssociation annotation
•One to Many (Parent – Child) – All classes extending AbstractRelationModel can map
multiple 1-N relationships to classes extending AbtractDependentModel using the
@OneToManyMap annotation. AbtractDependentModels objects are not instantiated
with “new” rather created using Framework Services
•Many to Many - All classes extending AbstractRelationModel can map multiple N-N
relationships to classes extending AbstractRelationModel using the @ManyToManyMap
annotation. The framework provides an internal class (and a corresponding table) for
holding the N-N relationship therefore no other object is required
•All primary and foreign keys are managed by Zinro
Zinro Client Services
Model Management / Handling is achieved through Zinro client services, a set of OSGI services,
published by the framework. Most methods of the services are type safe
Model Service
public <A extends AbstractModel> A loadModel(Class<A> type, Long id) throws ZfmException;
e.g. MyClass myClass = modelService.loadModel(MyClass.class,10000010L);
...
public <A extends AbstractView> List<A> getList(Class<A> modelClass,ListParam listParam) throws ZfmException;
e.g. List<MyClass> myClassList = modelService.getList(MyClass.class, new ListParam(“m.name=?1”, Collections.singletonList(“john”)));
...
public <A extends AbstractModel> A getAssociation(AbstractModel model, Class<A> clazz) throws ZfmException;
Relational Service
public <A extends IDependent> A createChild(AbstractRelationalModel arModel,Class<A> childClass) throws ZfmException;
e.g. MyChild child = relationalService.createChild(myClass,MyChild.class);
...
public void removeChild(AbstractRelationalModel arModel, AbstractModel rel);
...
public <A extends AbstractModel> List<A> fillRelationList(AbstractRelationalModel arModel, Class<A> relationClass)throws ZfmException;
Used for both 1-N and N-N relationships (loads from DB)
public <A extends AbstractModel> List<A> getCurrentRelationList(AbstractRelationalModel arModel, Class<A> relationClass);
Used for both 1-N and N-N relationships for already loaded objects
Transaction Service
Classes implementing the interface <IPersistant> (i.e. RelationalModel & StatefuleModel) can only be
directly saved or deleted. Dependent relational objects are automatically saved, deleted accordingly
public void execute(IPersistant model) throws ZfmException;
...
Objects from different independent bundles can take part in a transaction
public void execute(List<IPersistant> modelList) throws ZfmException;
e.g. list.add(myObjectFromBundleA);
list.add(myObjectFromBundleB);
transactionService.execute(list);
// either will commit all or rollback with exception
Other Services
Framework Service – Service for accessing user session, RMI registry, scheduled jobs, messages
and other resources
Security Service – Service for checking resource access against users / groups. This service is used
for all operations of Model, Relational and Transaction Services
Preferences Service – A service for handling DB persisted preferences provided by Zinro
Model Dialog
Model Dialog facilitates developers by implicitly providing features like
Saving, Deleting, Traversing, Searching and Filtering for Zinro Model
Class
The example used in the presentation is a “Question” model from an Examination System
To create a model dialog, an entry is added to the “com.bnv.zinro.ui.dialogs” extension provided
by the Zinro Framework
The Dialog Composite
Toolbar provided by Model Dialog
@Override
public Composite
createContents(Composite parent);
// creating UI
@Override
public void inputChanged(final IDialogInput
input);
// Called during traversing
Show dialog function
ZinroUI.showDialog(“com.bnv.zinro.caalic.question”,ne
w DialogInput());
The dialog composite implements IDialogComposite (from Zinro)
@ReportElement Annotation
@Entity
@Table(name="CAA_QUESTION")
@BundleLink("caamodel")
@OneToManyMaps({
@OneToManyMap(mapClass=McqAnswer.class),
@OneToManyMap(mapClass=FitbAnswer.class),
@OneToManyMap(mapClass=BoolAnswer.class),
@OneToManyMap(mapClass=ModelBlob.class),
})
@SecurityContext(Question.class)
public class Question extends RelationalModel {
@Column(name="TITLE",length=4000)
@Validation(alias="Question Text",required=true,max=4000)
@ReportElement(name="Question Text”,zlist=true,index=0,width=400)
protected String title;
@Column(name="MARKS")
@Validation(alias="Marks",required=true)
@ReportElement(name="Marks”,zlist=true,index=2)
protected Short marks;
@Column(name="REF",length=100)
@Validation(alias="Ref",max=100)
@ReportElement(name="Ref”,zlist=true,index=1)
protected String ref;
...
@ReportElement annotation is used to control the attribute listing in different UI elements. In the
model dialog context it controls the list view and search filter.
List of @ReportElement attributes
• The list provides navigation control like next, previous,
first, last page, Page Size and displays total records and
current pointer
Model List and Filter
• Clicking the Apply button will filter the list.
Double clicking on a element would close the list
and populate Model Dialog with the selected
model.
• The filter would also hold its state when re-
opened next time
List and Filter implicitly created by annotating member variables with @ReportElement
Reports
Reports in Zinro are designed as Jasper Reports and a backing class
extending JREditorInput (Zinro) is required for providing content
Reports are viewed in the editor
area of the workbench.
JREditorInput implements
IEditorInput from og.eclipse.ui.
The Zinro Report UI interface uses
SWT Jasper Viewer for showing
reports with a few additions such as
filter, clear and refresh buttons
The method that needs to be
overridden in JREditorInput is
@Override
protected JRDataSource
getDataSource(JRModifier
jrModifier, boolean refresh) throws
ZfmException
...
<report name="Question List" category="Exam">
<file>paper/question.jasper</file>
<provider>com.bnv.zinro.caalic.paper.reports.QuestionInput</provider>
<security-context></security-context>
<description>Question List</description>
</report>
<report name="Question Group List" category="Exam">
<file>paper/question-group.jasper</file>
<provider>com.bnv.zinro.caalic.paper.reports.QuestionGroupInput</provider>
<security-context></security-context>
<description>Question Group List</description>
</report>
<report name="Question Detail List" category="Exam">
<file>paper/question-detail.jasper</file>
<provider>com.bnv.zinro.caalic.paper.reports.QuestionDetailInput</provider>
<security-context></security-context>
<description>Question Detail List</description>
</report>
...
Reports Dialog
In addition to linking reports to Menu Items, Zinro provides an All Reports dialog with proper
categorization and description of reports
Config.xml excerpt ( Reports Dialog
populates from this content )
Report Filter
Report filter is provided by Zinro reading the same @ReportElement annotation. Values from the
filter are passed to the JREditorInput class as an argument
More Zinro Widgets
StructuredCombo
Provides a combo like control with multiple columns and is filtered on key stroke. If a Zinro Model is
used a content provider, the control is generated on the fly using @ReportElement annotation
Masked TextBox
A Key validated text box. The key is validated against the mask provided. E.g. the mask below is
NNN-NNNN-NNN-NNN
N as Number, A as character, Z as alphanumeric and S as symbol are implemented by default. Users
can extend their own types of masks
Grids
Zinro Grids populated with different providers and cell editors
Access Control
Zinro provides “out of the box” access control for models and other
resources as a combination of functions, UI Elements and services
Defining a Security Context
•Models can explicitly be annotated with @SecurityContext defining a security class which
extends AbstractView
•If no @SecurityContext is provided, the class itself is considered the security context class
•Other attributes of @SecurityContext are bypassRead, bypassModify and embeddable
@Entity
@Table(name=”CATL_AIRLINE")
@BundleLink(”catalyst")
@Audit(alias="Airline",storeState=true)
@SecurityContext(value=Airline.class,bypassRead=true)
public class Airline extends Vendor {
Publishing a Security Context
Security Context is published using the “com.bnv.zinro.core.security” extension. A friendly
for the resources is defined. The extension also caters for grouping of security contexts.
Class Resource
A security context class based resource
Configuration Resource
The other type of is the Configuration Resource. It takes a String based code as an
identifier
Published Resource View
User and Group Management
Zinro provides User and Group Management. User can belong to any number of groups.
Groups have a Priority Level which is unique and inverse i.e. higher the number lower the
priority. The system access policy is deny allow (whitelist)
Brining it all together - Resource Access
Access Control Dialog
provided by Zinro provides a
list of Users and Groups
assigned to a Resource
Users and Groups could be
added and removed from a
resource
Selected User / Group on a
Access Control Dialog displays
the corresponding permissions
in the bottom area
Create + View is allowed
whereas Modify + Remove is
denied
Zinro Login Dialog
A DES encrypted Token is generated and returned by the server for login which is passed and
validated in every called made to the server by the client application
Access Controlled Menu and Toolbar Items
A Command Handler created by extending ZinroSecureHandler class, manages
the enabling and disabling of menu items (and commands) according to the user
rights
Security Service
All Zinro services internally call Zinro Security Service for user access and permissions. If there is an
error, the user is notified. Below is the exception thrown by the framework after the user tried to delete
an entity from Model Dialog without appropriate permissions
License Management
Zinro also provides license management on model bundles separately. A bundle could
choose whether or not to be licensed.
If there are licensed bundles and the license is missing or invalid, a registration window is
popped. For registration, a MAC Address is bound to a license so that a license could be
revalidated on the same machine. A Zinro License Server Application is required to validate
the licenses
Installed Version
License Version
Installed License Details
Server Side Zinro
Zinro Server is an OSGI application running with Spring, JPA and Zinro
Model bundles. The server manages all database activity and provides
services to other Zinro bundles
Sample Server Arguments
-Dosgi.noShutdown=true
-Declipse.ignoreApp=true
-Dosgi.parentClassloader=app
-javaagent:${workspace_loc}/TargetPlatforms/agents/spring-agent-
2.5.4.jar
-Dzinro.product=catalyst
-Dzinro.conf=/Users/farooq/Reference/zinro/h2d.conf
-Dzinro.log4jPath=../log4j.properties
-Dosgi.install.area=${workspace_loc}/../tmp
A typical zinro.conf file looks like
Url=jdbc:h2:tcp://192.168.0.2:9092/../CATALYST_5;CIPHER=XTEA
User=sa
#Password=
PoolSize=4
Dialect=org.hibernate.dialect.H2Dialect
NodeId=8
NodeName=SRV-CATALYST
Uri=192.168.0.15
Port=27879
NodeDescription=Test Machine for Catalyst Server
TimeDifference=0
Typical Zinro Model Bundle Structure
Publishing RMI Objects
RMI objects are published on the same registry simply by creating a Spring Bean of class
implementing Remote and adding to Zinro’s RMI publisher
<!–- bean implementing java.rmi.Remote 
<bean name="searchManager" class="com.bnv.zinro.catalyst.remote.SearchManager"/>
<!–- OSGI service reference to Zinro RMI Manager -
<osgi:reference id="rmiManager"
interface="com.bnv.zinro.core.nodelayer.IRmiManager"/>
<!–- Zinro RMI Publisher bean instance publishing Remote items in Map -
<bean name="rmiPublisher" class="com.bnv.zinro.core.nodelayer.RmiPublisher"
init-method="publish">
<constructor-arg ref="rmiManager"/>
<property name="rmiObjectMap">
<map>
<entry key="searchManager" value-ref="searchManager"/>
</map>
</property>
</bean>
Client Side Zinro
ISearchManager searchManager = frameworkService().
getRegistry.lookup("searchManager");
Scheduled Jobs
Zinro Schedule Jobs wrap Quarts jobs to be easily used in the Zinro’s client / server environment.
In order to create a job, the class must extend Zinro AbstractJob and override
@Override
protected Object execute(JobDataMap jobDataMap, int monitorId, SealedObject token)
throws ZfmException
Jobs are published as by creating a Spring Bean of the job and publish it with Zinro’s Job Publisher
<!–- Bean extending AbstractJob -
<bean id="openingBalanceJob" class="com.bnv.zinro.catalyst.remote.OpeningBalanceJob”/>
<!–- OSGI service reference to Zinro Job Manager -
<osgi:reference id="jobManager" interface="com.bnv.zinro.core.nodelayer.IJobManager"/>
<!–- Zinro Job Publisher -
<bean name="jobPublisher" class="com.bnv.zinro.core.nodelayer.JobPublisher"
init-method="publish">
<constructor-arg ref="jobManager"/>
<property name="jobList">
<list>
<ref bean="openingBalanceJob"/>
</list>
</property>
</bean>
There are 3 ways to call a Zinro Schedule Job from the client
Immediate
public int scheduleJob(String jobClass, Map<String,Object> dataMap)
Delayed
public void scheduleJob(String jobClass, Map<String,Object> dataMap,long start)
Cron
public void scheduleJob(String jobClass, Map<String,Object> dataMap,String cronSpecs)
The framework handles the persistence of delayed and cron jobs to the database
Database Updates
Zinro provides an extension “com.bnv.zinro.core.dbUpdate” for updates to the database when a
newer version of the bundle is installed.
The basic element of the extension is a update version number. It sequential executes the 4 types of
operations SQL, TABLE, UPDATE_CLASS and VIEW. The framework stores the last db update version.
Optionally, Zinro Model bundles store VIEW and default data SQL in xml files
• Live application DEMO

Mais conteúdo relacionado

Semelhante a Zinro Eclipsecon 2011

Dialogs in Android MVVM (14.11.2019)
Dialogs in Android MVVM (14.11.2019)Dialogs in Android MVVM (14.11.2019)
Dialogs in Android MVVM (14.11.2019)Vladislav Ermolin
 
Rapid web application development using django - Part (1)
Rapid web application development using django - Part (1)Rapid web application development using django - Part (1)
Rapid web application development using django - Part (1)Nishant Soni
 
Angular workshop - Full Development Guide
Angular workshop - Full Development GuideAngular workshop - Full Development Guide
Angular workshop - Full Development GuideNitin Giri
 
MongoDB.local Atlanta: Introduction to Serverless MongoDB
MongoDB.local Atlanta: Introduction to Serverless MongoDBMongoDB.local Atlanta: Introduction to Serverless MongoDB
MongoDB.local Atlanta: Introduction to Serverless MongoDBMongoDB
 
Android apps development
Android apps developmentAndroid apps development
Android apps developmentMonir Zzaman
 
Net framework session03
Net framework session03Net framework session03
Net framework session03Vivek chan
 
Architectural Patterns and Software Architectures: Client-Server, Multi-Tier,...
Architectural Patterns and Software Architectures: Client-Server, Multi-Tier,...Architectural Patterns and Software Architectures: Client-Server, Multi-Tier,...
Architectural Patterns and Software Architectures: Client-Server, Multi-Tier,...Svetlin Nakov
 
C# .NET Developer Portfolio
C# .NET Developer PortfolioC# .NET Developer Portfolio
C# .NET Developer Portfoliocummings49
 
Understanding angular js
Understanding angular jsUnderstanding angular js
Understanding angular jsAayush Shrestha
 
Design Patterns in ZK: Java MVVM as Model-View-Binder
Design Patterns in ZK: Java MVVM as Model-View-BinderDesign Patterns in ZK: Java MVVM as Model-View-Binder
Design Patterns in ZK: Java MVVM as Model-View-BinderSimon Massey
 
Web development with django - Basics Presentation
Web development with django - Basics PresentationWeb development with django - Basics Presentation
Web development with django - Basics PresentationShrinath Shenoy
 
The Magic of WPF & MVVM
The Magic of WPF & MVVMThe Magic of WPF & MVVM
The Magic of WPF & MVVMAbhishek Sur
 
Developing maintainable Cordova applications
Developing maintainable Cordova applicationsDeveloping maintainable Cordova applications
Developing maintainable Cordova applicationsIvano Malavolta
 
important struts interview questions
important struts interview questionsimportant struts interview questions
important struts interview questionssurendray
 

Semelhante a Zinro Eclipsecon 2011 (20)

Dialogs in Android MVVM (14.11.2019)
Dialogs in Android MVVM (14.11.2019)Dialogs in Android MVVM (14.11.2019)
Dialogs in Android MVVM (14.11.2019)
 
Rapid web application development using django - Part (1)
Rapid web application development using django - Part (1)Rapid web application development using django - Part (1)
Rapid web application development using django - Part (1)
 
Angular workshop - Full Development Guide
Angular workshop - Full Development GuideAngular workshop - Full Development Guide
Angular workshop - Full Development Guide
 
MongoDB.local Atlanta: Introduction to Serverless MongoDB
MongoDB.local Atlanta: Introduction to Serverless MongoDBMongoDB.local Atlanta: Introduction to Serverless MongoDB
MongoDB.local Atlanta: Introduction to Serverless MongoDB
 
Android apps development
Android apps developmentAndroid apps development
Android apps development
 
Net framework session03
Net framework session03Net framework session03
Net framework session03
 
Struts
StrutsStruts
Struts
 
Struts
StrutsStruts
Struts
 
Jsf presentation
Jsf presentationJsf presentation
Jsf presentation
 
MVC
MVCMVC
MVC
 
Basic Python Django
Basic Python DjangoBasic Python Django
Basic Python Django
 
Architectural Patterns and Software Architectures: Client-Server, Multi-Tier,...
Architectural Patterns and Software Architectures: Client-Server, Multi-Tier,...Architectural Patterns and Software Architectures: Client-Server, Multi-Tier,...
Architectural Patterns and Software Architectures: Client-Server, Multi-Tier,...
 
C# .NET Developer Portfolio
C# .NET Developer PortfolioC# .NET Developer Portfolio
C# .NET Developer Portfolio
 
Java server faces
Java server facesJava server faces
Java server faces
 
Understanding angular js
Understanding angular jsUnderstanding angular js
Understanding angular js
 
Design Patterns in ZK: Java MVVM as Model-View-Binder
Design Patterns in ZK: Java MVVM as Model-View-BinderDesign Patterns in ZK: Java MVVM as Model-View-Binder
Design Patterns in ZK: Java MVVM as Model-View-Binder
 
Web development with django - Basics Presentation
Web development with django - Basics PresentationWeb development with django - Basics Presentation
Web development with django - Basics Presentation
 
The Magic of WPF & MVVM
The Magic of WPF & MVVMThe Magic of WPF & MVVM
The Magic of WPF & MVVM
 
Developing maintainable Cordova applications
Developing maintainable Cordova applicationsDeveloping maintainable Cordova applications
Developing maintainable Cordova applications
 
important struts interview questions
important struts interview questionsimportant struts interview questions
important struts interview questions
 

Último

Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 

Último (20)

Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 

Zinro Eclipsecon 2011

  • 1. ZINRO A Eclipse / OSGI based Framework for Information Management Systems
  • 2. ZINRO is an OSGI/RCP based framework for developing Information Management Systems in a Client / Server Architecture with a simplified approach towards handling Business Entities. It provides application developers with a rich set of OSGI Services, UI Elements, Eclipse Extensions and functions to focus on business logic while minimizing labor intensive recurring tasks. Some of the “Out of the box” features provided by Zinro are •Entity Relationship Management •Entity Validation •Cross Bundle Transactions •Annotation based Controlling •UI Creation •Widgets •Report Infrastructure •User and Group Management •Resource and Access Control Management •Login and Session Management •License Management •Server Side Spring Integration •Client / Server Messaging •Scheduled Job Publication •RMI Publication •Database Update mechanism on bundle updates
  • 3. Zinro Base Models At the heart of the Zinro Framework are the base model classes extending JPA entities. All Zinro Models must extend from one of the base model class AbstractView AbstractIdView AbstractModel RelationalModel StatefulModel … … … Basic view Zinro Model Hierarchy *Not all classes included
  • 4. Relationships Zinro provides its own relationship handling mechanism. Relationships are defined on Model Classes using Annotations. •Association - All classes extending AbstractModel can have 1-1 relationships with other model classes defined using @ModelAssociation annotation •One to Many (Parent – Child) – All classes extending AbstractRelationModel can map multiple 1-N relationships to classes extending AbtractDependentModel using the @OneToManyMap annotation. AbtractDependentModels objects are not instantiated with “new” rather created using Framework Services •Many to Many - All classes extending AbstractRelationModel can map multiple N-N relationships to classes extending AbstractRelationModel using the @ManyToManyMap annotation. The framework provides an internal class (and a corresponding table) for holding the N-N relationship therefore no other object is required •All primary and foreign keys are managed by Zinro
  • 5. Zinro Client Services Model Management / Handling is achieved through Zinro client services, a set of OSGI services, published by the framework. Most methods of the services are type safe Model Service public <A extends AbstractModel> A loadModel(Class<A> type, Long id) throws ZfmException; e.g. MyClass myClass = modelService.loadModel(MyClass.class,10000010L); ... public <A extends AbstractView> List<A> getList(Class<A> modelClass,ListParam listParam) throws ZfmException; e.g. List<MyClass> myClassList = modelService.getList(MyClass.class, new ListParam(“m.name=?1”, Collections.singletonList(“john”))); ... public <A extends AbstractModel> A getAssociation(AbstractModel model, Class<A> clazz) throws ZfmException; Relational Service public <A extends IDependent> A createChild(AbstractRelationalModel arModel,Class<A> childClass) throws ZfmException; e.g. MyChild child = relationalService.createChild(myClass,MyChild.class); ... public void removeChild(AbstractRelationalModel arModel, AbstractModel rel); ... public <A extends AbstractModel> List<A> fillRelationList(AbstractRelationalModel arModel, Class<A> relationClass)throws ZfmException; Used for both 1-N and N-N relationships (loads from DB) public <A extends AbstractModel> List<A> getCurrentRelationList(AbstractRelationalModel arModel, Class<A> relationClass); Used for both 1-N and N-N relationships for already loaded objects
  • 6. Transaction Service Classes implementing the interface <IPersistant> (i.e. RelationalModel & StatefuleModel) can only be directly saved or deleted. Dependent relational objects are automatically saved, deleted accordingly public void execute(IPersistant model) throws ZfmException; ... Objects from different independent bundles can take part in a transaction public void execute(List<IPersistant> modelList) throws ZfmException; e.g. list.add(myObjectFromBundleA); list.add(myObjectFromBundleB); transactionService.execute(list); // either will commit all or rollback with exception Other Services Framework Service – Service for accessing user session, RMI registry, scheduled jobs, messages and other resources Security Service – Service for checking resource access against users / groups. This service is used for all operations of Model, Relational and Transaction Services Preferences Service – A service for handling DB persisted preferences provided by Zinro
  • 7. Model Dialog Model Dialog facilitates developers by implicitly providing features like Saving, Deleting, Traversing, Searching and Filtering for Zinro Model Class The example used in the presentation is a “Question” model from an Examination System To create a model dialog, an entry is added to the “com.bnv.zinro.ui.dialogs” extension provided by the Zinro Framework
  • 8. The Dialog Composite Toolbar provided by Model Dialog @Override public Composite createContents(Composite parent); // creating UI @Override public void inputChanged(final IDialogInput input); // Called during traversing Show dialog function ZinroUI.showDialog(“com.bnv.zinro.caalic.question”,ne w DialogInput()); The dialog composite implements IDialogComposite (from Zinro)
  • 9. @ReportElement Annotation @Entity @Table(name="CAA_QUESTION") @BundleLink("caamodel") @OneToManyMaps({ @OneToManyMap(mapClass=McqAnswer.class), @OneToManyMap(mapClass=FitbAnswer.class), @OneToManyMap(mapClass=BoolAnswer.class), @OneToManyMap(mapClass=ModelBlob.class), }) @SecurityContext(Question.class) public class Question extends RelationalModel { @Column(name="TITLE",length=4000) @Validation(alias="Question Text",required=true,max=4000) @ReportElement(name="Question Text”,zlist=true,index=0,width=400) protected String title; @Column(name="MARKS") @Validation(alias="Marks",required=true) @ReportElement(name="Marks”,zlist=true,index=2) protected Short marks; @Column(name="REF",length=100) @Validation(alias="Ref",max=100) @ReportElement(name="Ref”,zlist=true,index=1) protected String ref; ... @ReportElement annotation is used to control the attribute listing in different UI elements. In the model dialog context it controls the list view and search filter. List of @ReportElement attributes
  • 10. • The list provides navigation control like next, previous, first, last page, Page Size and displays total records and current pointer Model List and Filter • Clicking the Apply button will filter the list. Double clicking on a element would close the list and populate Model Dialog with the selected model. • The filter would also hold its state when re- opened next time List and Filter implicitly created by annotating member variables with @ReportElement
  • 11. Reports Reports in Zinro are designed as Jasper Reports and a backing class extending JREditorInput (Zinro) is required for providing content Reports are viewed in the editor area of the workbench. JREditorInput implements IEditorInput from og.eclipse.ui. The Zinro Report UI interface uses SWT Jasper Viewer for showing reports with a few additions such as filter, clear and refresh buttons The method that needs to be overridden in JREditorInput is @Override protected JRDataSource getDataSource(JRModifier jrModifier, boolean refresh) throws ZfmException
  • 12. ... <report name="Question List" category="Exam"> <file>paper/question.jasper</file> <provider>com.bnv.zinro.caalic.paper.reports.QuestionInput</provider> <security-context></security-context> <description>Question List</description> </report> <report name="Question Group List" category="Exam"> <file>paper/question-group.jasper</file> <provider>com.bnv.zinro.caalic.paper.reports.QuestionGroupInput</provider> <security-context></security-context> <description>Question Group List</description> </report> <report name="Question Detail List" category="Exam"> <file>paper/question-detail.jasper</file> <provider>com.bnv.zinro.caalic.paper.reports.QuestionDetailInput</provider> <security-context></security-context> <description>Question Detail List</description> </report> ... Reports Dialog In addition to linking reports to Menu Items, Zinro provides an All Reports dialog with proper categorization and description of reports Config.xml excerpt ( Reports Dialog populates from this content )
  • 13. Report Filter Report filter is provided by Zinro reading the same @ReportElement annotation. Values from the filter are passed to the JREditorInput class as an argument
  • 14. More Zinro Widgets StructuredCombo Provides a combo like control with multiple columns and is filtered on key stroke. If a Zinro Model is used a content provider, the control is generated on the fly using @ReportElement annotation Masked TextBox A Key validated text box. The key is validated against the mask provided. E.g. the mask below is NNN-NNNN-NNN-NNN N as Number, A as character, Z as alphanumeric and S as symbol are implemented by default. Users can extend their own types of masks
  • 15. Grids Zinro Grids populated with different providers and cell editors
  • 16. Access Control Zinro provides “out of the box” access control for models and other resources as a combination of functions, UI Elements and services Defining a Security Context •Models can explicitly be annotated with @SecurityContext defining a security class which extends AbstractView •If no @SecurityContext is provided, the class itself is considered the security context class •Other attributes of @SecurityContext are bypassRead, bypassModify and embeddable @Entity @Table(name=”CATL_AIRLINE") @BundleLink(”catalyst") @Audit(alias="Airline",storeState=true) @SecurityContext(value=Airline.class,bypassRead=true) public class Airline extends Vendor {
  • 17. Publishing a Security Context Security Context is published using the “com.bnv.zinro.core.security” extension. A friendly for the resources is defined. The extension also caters for grouping of security contexts. Class Resource A security context class based resource
  • 18. Configuration Resource The other type of is the Configuration Resource. It takes a String based code as an identifier
  • 20. User and Group Management Zinro provides User and Group Management. User can belong to any number of groups. Groups have a Priority Level which is unique and inverse i.e. higher the number lower the priority. The system access policy is deny allow (whitelist)
  • 21. Brining it all together - Resource Access Access Control Dialog provided by Zinro provides a list of Users and Groups assigned to a Resource
  • 22. Users and Groups could be added and removed from a resource
  • 23. Selected User / Group on a Access Control Dialog displays the corresponding permissions in the bottom area Create + View is allowed whereas Modify + Remove is denied
  • 24. Zinro Login Dialog A DES encrypted Token is generated and returned by the server for login which is passed and validated in every called made to the server by the client application
  • 25. Access Controlled Menu and Toolbar Items A Command Handler created by extending ZinroSecureHandler class, manages the enabling and disabling of menu items (and commands) according to the user rights
  • 26. Security Service All Zinro services internally call Zinro Security Service for user access and permissions. If there is an error, the user is notified. Below is the exception thrown by the framework after the user tried to delete an entity from Model Dialog without appropriate permissions
  • 27. License Management Zinro also provides license management on model bundles separately. A bundle could choose whether or not to be licensed. If there are licensed bundles and the license is missing or invalid, a registration window is popped. For registration, a MAC Address is bound to a license so that a license could be revalidated on the same machine. A Zinro License Server Application is required to validate the licenses Installed Version License Version
  • 29. Server Side Zinro Zinro Server is an OSGI application running with Spring, JPA and Zinro Model bundles. The server manages all database activity and provides services to other Zinro bundles Sample Server Arguments -Dosgi.noShutdown=true -Declipse.ignoreApp=true -Dosgi.parentClassloader=app -javaagent:${workspace_loc}/TargetPlatforms/agents/spring-agent- 2.5.4.jar -Dzinro.product=catalyst -Dzinro.conf=/Users/farooq/Reference/zinro/h2d.conf -Dzinro.log4jPath=../log4j.properties -Dosgi.install.area=${workspace_loc}/../tmp A typical zinro.conf file looks like Url=jdbc:h2:tcp://192.168.0.2:9092/../CATALYST_5;CIPHER=XTEA User=sa #Password= PoolSize=4 Dialect=org.hibernate.dialect.H2Dialect NodeId=8 NodeName=SRV-CATALYST Uri=192.168.0.15 Port=27879 NodeDescription=Test Machine for Catalyst Server TimeDifference=0 Typical Zinro Model Bundle Structure
  • 30. Publishing RMI Objects RMI objects are published on the same registry simply by creating a Spring Bean of class implementing Remote and adding to Zinro’s RMI publisher <!–- bean implementing java.rmi.Remote  <bean name="searchManager" class="com.bnv.zinro.catalyst.remote.SearchManager"/> <!–- OSGI service reference to Zinro RMI Manager - <osgi:reference id="rmiManager" interface="com.bnv.zinro.core.nodelayer.IRmiManager"/> <!–- Zinro RMI Publisher bean instance publishing Remote items in Map - <bean name="rmiPublisher" class="com.bnv.zinro.core.nodelayer.RmiPublisher" init-method="publish"> <constructor-arg ref="rmiManager"/> <property name="rmiObjectMap"> <map> <entry key="searchManager" value-ref="searchManager"/> </map> </property> </bean> Client Side Zinro ISearchManager searchManager = frameworkService(). getRegistry.lookup("searchManager");
  • 31. Scheduled Jobs Zinro Schedule Jobs wrap Quarts jobs to be easily used in the Zinro’s client / server environment. In order to create a job, the class must extend Zinro AbstractJob and override @Override protected Object execute(JobDataMap jobDataMap, int monitorId, SealedObject token) throws ZfmException Jobs are published as by creating a Spring Bean of the job and publish it with Zinro’s Job Publisher <!–- Bean extending AbstractJob - <bean id="openingBalanceJob" class="com.bnv.zinro.catalyst.remote.OpeningBalanceJob”/> <!–- OSGI service reference to Zinro Job Manager - <osgi:reference id="jobManager" interface="com.bnv.zinro.core.nodelayer.IJobManager"/> <!–- Zinro Job Publisher - <bean name="jobPublisher" class="com.bnv.zinro.core.nodelayer.JobPublisher" init-method="publish"> <constructor-arg ref="jobManager"/> <property name="jobList"> <list> <ref bean="openingBalanceJob"/> </list> </property> </bean>
  • 32. There are 3 ways to call a Zinro Schedule Job from the client Immediate public int scheduleJob(String jobClass, Map<String,Object> dataMap) Delayed public void scheduleJob(String jobClass, Map<String,Object> dataMap,long start) Cron public void scheduleJob(String jobClass, Map<String,Object> dataMap,String cronSpecs) The framework handles the persistence of delayed and cron jobs to the database
  • 33. Database Updates Zinro provides an extension “com.bnv.zinro.core.dbUpdate” for updates to the database when a newer version of the bundle is installed. The basic element of the extension is a update version number. It sequential executes the 4 types of operations SQL, TABLE, UPDATE_CLASS and VIEW. The framework stores the last db update version. Optionally, Zinro Model bundles store VIEW and default data SQL in xml files