As an example let’s take soapservice, and assume that we need to make soapservices visible in store, only when they reach "Published" state in their lifecycle.
Follow below steps for that.
Open [Home]/repository/deployment/server/jaggeryapps/store/extensions/assets/soapservice/asset.js file.
Inside asset.manager look for 'search' function, which overrides the default store behavior. [2]
Enable below line inside 'search' function.
query = buildPublishedQuery(query);
//originally commented this inorder to let anystate visible in store.
Let's decide which state should be allowed in store. For that in the asset.configure section of the same file[3], add below meta section.
lifecycle: {
publishedStates: ['Production']
}
Now the asset.configure section should look something like below.
asset.configure = function() {
return {
meta: {
lifecycle: {
publishedStates: ['Production']
},
ui: {
icon: 'fw fw-soap',
iconColor: 'orange'
},
isDependencyShown: true,
isDiffViewShown:false
}
}
};
Restart the server. Now in the store only soapservices in "published" state will be visible.
If you need to have same behavior for other asset types as well, then follow the same steps in each assets extension type, by editing [Home]/repository/deployment/server/jaggeryapps/store/extensions/assets/[ASSET-TYPE]/asset.js file.
[2] https://github.com/wso2/product-greg/blob/v5.3.0/modules/es-extensions/store/asset/soapservice/asset.js#L119
[3] https://github.com/wso2/product-greg/blob/v5.3.0/modules/es-extensions/store/asset/soapservice/asset.js#L147
No comments:
Post a Comment