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

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.

Related

Need help to add front-end on slatwall eCommerce

I am trying to build the eCommerce store by using Slatwall and lucee. Slatwall is the ColdFusion based eCommerce framework. The admin part is working fine. But I could not create the user side. I also referred the slatwall documentation. But no luck I couldn't seen any clear example and document for adding the front end on slatwall. If anyone knows help me please?
Slatwall frontend document
As OP says, SlatWall has excellent $upport, that's where they make a living. You now have three choices for a front end:
1) Slatwall latest versions have their own integrated CMS now. I'd recommend you export your product info, install the latest Slatwall, import the data back in.
2) Load MuraCMS, an Open Source Content Management (i.e. front-end) system that has integration to Slatwall (or the other way round, IIRC)
3) Roll your own in ColdFusion after learning ins and outs of the Slatwall api. Not recommended unless you're already CF experienced and have some previous experience with an api, any api.
For completeness I am going to answer this question even though its months old, for anyone else that views this.
You have a couple options here but the easiest way:
There is a complete example of a fully implemented Slatwall site including product listing pages, shopping-cart, and checkout included with Slatwall.
You may view the sample site by visiting http://{yourslatwallsite}/meta/sample
On the sample site, you can choose from the menu to view your products, add them to your cart, or checkout. Make sure your products are both active and published in the admin or you will not see them on the sample site. If you go through the .cfm pages that makeup the sample site, there are many examples documented (as comments in the code). Note that the actual .cfm files will be stored in /public/views/xxx.cfm and the meta folder just references them. /public/views/templates/slatwall-productlisting.cfm for example has complete examples on listing products on the frontend.
The sample site is powerful enough that you could restyle it and use it as your store

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

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.

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.

Using Redmine with an external Wiki?

We've got a company wiki running Mediawiki on our intranet that has been in use for a while. We just recently installed Redmine and are in the process of getting it configured just the way we like it.
I was wondering if there's any way to use our already existing wiki instead of the built-in one that comes with Redmine. We've got alot of articles & documentation written by non-developers and don't want to lose and/or re-import into another wiki (ie redmine's). The Wiki portion of redmine will not allow me to enter the url for the external wiki as it includes various illegal characters (mainly : and /)
Edit: As a temporary work around, I've just used each project main page on the "external" Wiki as the Projects "Home Page" in Red Mine, so far this is the best I've been able to figure out. You don't get Wiki access from the various issues & what not, but the link to our other Wiki does show under the Overview for each project now.
Btw, both of these are installed on the same physical box, a Windows 2003 Server, where Mediawiki was installed using a WAMP package, and Redmine was installed pretty much manually instead of using a stack like Bitnami.
Did you see this MediaWiki integration patch for Redmine? http://www.redmine.org/attachments/572/redmine-mediawiki.patch and its reference page http://www.redmine.org/issues/617 I have not used it so im not sure if it meets your needs but it might be worth a shot. (Be sure to backup first)
The reference page says this about the patch:
Here's a patch for 0.7 that will add a
MediaWiki tab to your project settings
and integrate it into the issues
pages. You will also need to add:
is_mediawiki tinyint(1) NOT NULL
default '0', mediawikiurl
varchar(255) NOT NULL default '',
mediawikinamespace varchar(255) NOT
NULL default ''
To the projects table for this to
work.
I know you didn't want to import but just in case someone else did here is a rake file for importing MediaWiki pages into Redmine http://www.redmine.org/issues/1224
We looked into this as an option since there are so many tools that work with mediawiki however we decided not to pursue the option since we already had so many issues and wiki pages in redmine. As far as I can tell, this patch replaces the existing redmine wiki input boxes with mediawiki boxes. This is done not only in the wiki section but also for issues and documents. We were afraid of:
Losing all of our existing wiki pages, and issue descriptions.
The whole thing breaking as Redmine updates are posted and installed.
We have found that the newest Wiki Extensions plug in http://www.r-labs.org/projects/r-labs/wiki/Wiki_Extensions_en has given us most of the features we wanted for the wiki part. It has comments, voting, tags, and many other things. It works well with the latest version of Redmine.
We still are trying to find a good way to import into the wiki all of our existing documentation from word.

Django tracking app?

Is there an application for django which tracks CRUD for objects inside a project?
If you mean an audit trail for model changes, you could start with AuditTrail. It's a little rough around the edges but I'm not aware of anything else in this area.
I do this by using signals provided by Django.
Check out django-reversion.
It keeps a detailed log of who did what that is viewable from the admin. It also lets you go back and see any older version, and also to restore deleted versions of models. It includes a middleware component to let any model change be logged, even if it wasn't done by the admin tool. It has pretty decent documetnation as well.