Hooks revisited (5) - create access to the meta-data model
Technical Blogs April 28, 2014 By Peter Breuer
Create a service jar on the global path
We need to build and deploy our new Hook plug-in which was created in the previous segment. Usually we would make use of the Liferay IDE ant build files to start the Service Builder. This would compile the generated code, build and deploy the access services library jar for our new entity in the lib folder of the plug-in package.
Unfortunately that would not do this time. For one thing, we will need to include the modified wrapper class in the library jar, not the one generated by the Service Builder. But there is more than that. Normally, the access services library is part of the plug-in package and will be deployed in its own application context. So the access services are not visible from the portal application where we would actually need them. Please remember that the Asset Publisher portlet is part of the framework's core.
So we need a little hack in the supplied build file. First, we separate the code generation of the Service Builder from the actual build of the service library jar. Second, we deploy the library jar file somewhere on the global classpath, e.g. in the application server's lib/ext folder.
Now let's make a quick inventory, what we have done until now:
modified parts of the view component, i.e. some jsp(f) files
created an entity description with the authorName attribute
generated the entity's model and persistence interfaces, their implementation classes and manipulated the model wrapper
built the access service library jar and deployed it on the global classpath
Please note that all the code above will be executed in the portal application's context. In the next section we will create the custom finder implementation in the Hook plug-in.