How to retrieve custom associations configured in governance.xml in WSO2 Enterprise Store - wso2

I created a custom association for type 'Schema' in governance.xml as below:
<Association type="schema">
<critical reverseAssociation ="isCriticalTo" iconClass="">service</critical>
</Association>
I created some associations using the Greg Publisher for the same. The custom associations are not retrieved in the default payload of WSO2 Store for the specific artifact.
How can I customize WSO2 Enterprise Store View to retrieve and display the custom association details (critical/isCriticalTo)?

Your governance.xml entry looks fine, however please remove the iconClass attribute if your not using it. Please find the rectified governance.xml entry,
<Association type="service">
<isCriticalTo reverseAssociation ="critical" iconClass="fw-store">schema</critical>
</Association>
Note: I presume you have deployed service.rxt in admin console and made it enable in publisher and store(if you can view assets then fine.)
Please find the association page look a like after adding above xml code.
Please find this this useful blog post. This blog post is about G-Reg 5.2.0. however it is compatible with G-Reg 5.1.0 as well except reverseAssociation, iconClass.
For WSDLs if users want to view all the "depends" and "usedBy" users can view them by extending the WSDL asset.js file as per their needs. In order to view all the "depends" and "usedBy" associations for WSDL find the below code snippet from asset.js file,
GREG_HOME/repository/deployment/server/jaggeryapps/store/extensions/assets/wsdl/asset.js
if(deps.associationType == "soapservice") {
associations.push(deps);
}
and comment out the below code,
//if(deps.associationType == "soapservice") {
associations.push(deps);
//}
Then user can view all the "depends" and "usedBy" associations.
WSO2 developers have fixed this correctly in their git repo, Please find the PR from here.

Related

How to create a custom asset-attributes.hbs for each new artifact for the STORE?

Im using WSO2 Governance Registry 5.2.0.
When I create a new artifact type, it containt a lot of new fields (You create and define this XML in the CARBON ADMIN CONSOLE). So in the PUBLISHER you can see the new fields, create and consult a new item of the artifact.
But the problem is in the STORE, I cannot see the this new fields. So in order to do this, I made the custom fields available by modifying
GREG_HOME>/repository/deployment/server/jaggeryapps/store/extensions/app/greg-store-defaults/themes/store/partials/asset-attributes.hbs file. Thanks to Malintha's Blog,
This is perhaps an answer, but it will get much worse if for each artifact I have to edit the file to add the fields, editing this file will get a lot worse over the time...
So my question is: Is there a way to create a custom theme (*.hbs, etc) for each new artifact I create?
THANKS!
As far as I understand your in the development phase of the project that you have to create registry extensions(RXTs) and showing up the data in G-Reg Store. As far as I know there is no easy dynamic way that you can do this, either you have to extend the default hbs files. Like you have done using Malintha's blog. This is okay if there is a minor change to be done, However this is not the recommended way because if there is a migration to do such as moving to all new WSO2 G-Reg 5.3.0 you might face lot of trouble if you updated the out of the box files in G-Reg 5.2.0, Therefore I suggest you to write asset extensions(GREG_HOME/repository/deployment/server/jaggeryapps/store/extensions/assets) for each and every rxt that you are going to introduce. There is plenty of blog posts that can help you.
Please find the below list of blog posts(I will update the list if I found any).
Adding a New Asset Type
How to view the json payload sent to the Store UI in GREG 5.1.0
How to extend an asset's store view in WSO2 GREG 5.1.0
WSO2GREG-5.2.0- WRITING EXTENSION TO REPLICATE MORE ARTIFACT
METADATA IN STORE
Overriding default "look and feel" of GREG - 5.3.0
Note:
There is no much difference between 5.1.0 and 5.2.0.(5.2.0 is more stable)
You can start(learn) creating a new extension by simply extending restservice.rxt and the relevant asset extension(GREG_HOME/repository/deployment/server/jaggeryapps/store/extensions/assets/restservice), I prefer you to use this blog post and start from there.
If there is a lot of development to be done I prefer you to seek help from WSO2 experts from they're official portal, if not you can always stick to stackoverflow.

File browser with Django and Alfresco

I have a Django site and a local install of Alfresco (community edition). One of my model contains a file reference which maps to a document in Alfresco. The view should have a field that spawns a file browser that can access the repository structure within Alfresco so that the user can pick whichever file they want at whichever version.
I looked at the CMSIlib module and it seems to be providing all the interaction I need for the back end code. Although downloading a document seems clunky.
There are lots of Django file browsers but none seem to interface with CMSIlib.
Do I have to code my own or have I missed something?
The version is Alfresco Community v5.0.0 (d r99759-b2) schema 8022 Spring Surf and Spring WebScripts - v5.0.0.
To be honest, I am not a python guy ! But I heard over the official #alfresco IRC channel that cmislib is not so much of an active project, and questions about it only bump once in a while .... The RESTful api however may be considered as a good alternative in your use case:
To access alfresco content using the RESTful api, you should be querying this webscript: /alfresco/d/<d|a>/<workspace>/<store>/<nodeId>/<filename>
where :
d and a refer to direct / attached mode
<workspace>, <store> and <nodeId> reference your content nodeRef
<filename> a file name of your choice
So you should be making a GET Request an a URL that looks something like this http://<host>:<port>/alfresco/d/d/workspace/SpacesStore/8444ad61-4734-40e3-b2d4-b8b1c81347fd/myFile.ext
Note : Depending on the permission set on your node, you might need to attach an alf_ticket to the URL for an authenticated alfresco user. Please check this for further insights.
UPDATE 1:
If you have a problem identifying your file nodeRef, then you can setup a repo webscript implementing your custom logic (browsing some folder / searching for a document by name or metadata ....)
If your are not familiar with webscript development check Jeff Pott's tutorial on the subject
UPDATE 2:
To get started with your webscript development check out Alfresco docs/wiki!
Check this wiki page to learn how to retrieve children for a given node !
Or check this wiki page to learn how to develop webscripts implementing your custom business logic.
If you do not have anything against the YUI javascript library (that is no longer actively maintained), you can integrate the object-finder already available in Alfresco Share. The library is in
share/components/object-finder/object-finder.js
You will need to modify it a bit given that you are not inside Share.
To be totally honest, I do not know if it is feasible because it has other dependencies but being a browser site library, in theory can be integrated everywhere.

WSO2 EMM - Manage data to wrapping them in multi page

I have added new report to EMM, but as the report data recorde are too much, I would like to wrap them in multiple pages like configuration tab (users, roles and policies), How can I fix this or how it works for those tabs?
Thanks
WSO2 EMM is built on top of bootstrap 2. You can add Bootstrap tabs as mention in following doc and have multiple tabs on your page
http://getbootstrap.com/2.3.2/javascript.html#tabs
Edit:
WSO2 EMM 1.1.0 is built on top of a Jaggery MVC framework.
Create a report by adding a function to emm/controller/reports.js. This is a controller and you can use modules to retrieve data to the controller. see devices_complience function for example in the following file
https://github.com/wso2/product-emm/blob/master/modules/apps/emm/controller/reports.js
Add the corresponding view file to emm/views/reports
Eg: https://github.com/wso2/product-emm/blob/master/modules/apps/emm/views/reports/devices_complience.hbs
Add a link to your report in the emm/views/reports/index.hbs file
If you need to have additional java-script functions you can add them to emm/client/js/reports/reports.js file
I should edit "Carbone_Home\repository\deployment\server\jaggeryapps\emm\client\js\reports.js" file to managing record on table.
"sDom":"t"
to
"sDom":"<'row-fluid't<'row-fluid'<'span6'i><'span6'p>>"
and for setting number of record per page I should set this :
"iDisplayLength": 10,
which uses emm\assets\jqueryext\datatables\jquery.datatables.

Can Velocity or Freemarker template be used for VIEW of Custom plugin portlet?

I am trying to have a custom plugin portlet in liferay for which I can customize the view page with velocity or free-marker template like we have for Asset Publisher in Liferay 6.2.
Requirement
I have a screen for admin (CRUD) through which data would be added in my custom tables through this portlet and then there is a VIEW page for all other users.
Now this portlet can be deployed on different sites or different pages with page-scope and the requirement is that it should have a different look & feel for different pages. Currently we are handling this scenario through deploying different themes to configure the look & Feel of the portlet, but we also need some layout changes which is a limitation with themes.
So I was thinking if we can utilize something similar to a velocity template for the View page but I am not sure where to start and whether liferay provides some easy way to do this. So that we create a template and upload it in the configuration and the VIEW page UI is changed.
I would be grateful if there are some pointers to help me in this direction or atleast can say about the feasibility part of it or an alternative.
Thanks
Environment: Liferay 6.2 GA1

Problem in provisioning when using stapling to customize sharepoint 2010 blog template

I'm trying to use stapling to customize sharepoint 2010 blog template. I created a stapling feature and another feature for customizing the the site definition (onet.xml). It's work fine for web parts but if I include List Views it gives an error when I'm trying to activate the "customizing feature" (Not the stapling feature)
Error is,
"Error occurred in deployment step 'Activate Features': Cannot complete this action."
This is the xml snippet which causes this problem. (I couldn't post the xml part here)
http://social.msdn.microsoft.com/Forums/en/sharepoint2010programming/thread/6ba343f3-020b-47e5-938c-aeedcf094adc
BTW I'm trying to customize the default page here and my approach is
1) Get a copy of the existing custom page and rename and include in the feature
2) Change the master page of the above file to custom.master
3) Change the layout of the above page without removing "ContentPlaceHolders"
4) In feature element put module element copied from onet.xml
Appreciate if anyone can provide some insite on this.
Thanks
-Madhawa
Try provisioning the file without the View to make sure that your Url and Path attributes are correct. Once an empty page is displaying, add the View XML back. For the List attribute, try using the relative URL path (ex. Lists/Blog) instead of the template ID.