ODI 12C Smart import with actions using SDK - oracle-data-integrator

HI I'm able to smart import Projects in ODI using SDK. but i'm unable to use the predefined method which sets actions like merge, create copy, ignore, reuse, while importing the projects.
Please help me to implement the below method,
setMatchedFCODefaultImportAction(java.lang.String pFCOObjType, int pSmartImportAction)
by using below method i'm directly importing projects.
importObjectsFromXml (fnameAndPath, ExportKey, ExportWithoutCipherData);
I want to implement above mentioned actions, please help me.
thanks

Unfortunately you can not use setMatchedFCODefaultImportAction to specify the action for a specific object like a project as in your code :
smartImpServ.setMatchedFCODefaultImportAction("Dev_ODI_Project", 1);
It can only define the default action for a First Class Object i.e. for all the objects of a specific type. For instance you can set the default actions for any project as CREATE/COPY (equivalent to 1 as you used in your code):
smartImpServ.setMatchedFCODefaultImportAction(ISmartImportService.PROJECT_OBJECT_NAME, ISmartImportService.SMART_IMPORT_ACTION_CREATE_COPY);
The values you can use as the pFCOObjType parameters are all the Fields ending by _OBJECT_NAME in the ISmartImportService interface.
If you want to specify the action for a specific object, you would need to use a response file from a previous import with the importFromXml method.

Related

support for java.time.Instant serde via jackson JavaTimeModule

I'd like to support serde of POJO classes that include java.time.Instant member fields. As such, I was happy to find a Jackson module that is designed precisely for this use case:
https://github.com/FasterXML/jackson-modules-java8
Unfortunately I am unable to register the JavaTimeModule as follows because it fails to compile given I need to import a flink-shaded jackson2 jar that includes JavaTimeModule but am unable to find it (eg in maven-central):
private ObjectMapper mapper = new ObjectMapper()
.enable(MapperFeature.ACCEPT_CASE_INSENSITIVE_ENUMS)
.registerModule(new JavaTimeModule());
Thoughts?
thx,
james
It's not entirely clear how you currently use jackson. But in general, there is no need to include flink-shaded-jackson in your user jar. In fact, it is heavily discouraged. The whole point of shading is that you can use your own version without class conflicts. So simply add jackson with the respective module to your gradle project and use it as is.
Now if you use any given format/connector of Flink that uses the flink-shaded-jackson, then you need to shade the time module in the same fashion, unfortunately. You can use the json schema module as a reference.

Liferay 7.1 npm-react-module localization

I'm trying to include localization into my npm-react-module, but I have failed receiving the value for the corresponding key from the Langugage.properties file. It simply returns the key. I did some research but I couldn't find any source that would help me solve my problem.
In the code which I will show you bellow, I have included a Language.properties file into my module. In my portlet, I have included the needed configuration for the language properties. I have also tried to add a separate file for a specific locale, but that didn't help me either.
This is an example of my portlet configuration:
"javax.portlet.resource-bundle=content.Language"
This is an example content from my Language.properties file:
example-key=example-value
This is how I'm trying to access the value in my React Component:
<h1> {Liferay.Language.get('example-key')} </h1>
But it only returns "example-key" instead of "example-value".
In my view.jsp file I am able to retrieve the corresponding values using
<liferay-ui:message key='example-key'/>
I have tried this method: https://portal.liferay.dev/docs/7-1/tutorials/-/knowledge_base/t/localizing-your-portlet but it didn't work either. Did anyone get this to work properly in their npm-react-module? I really don't want to spend time implementing my own localization service. Thanks!
Liferay.Language.get('key') gets text replaced by the build mechanism. Therefore there is no actual object/class to do this. I have been trying to get this to work myself and have resolved that I will have to do internationalization on my own.
localizing is done only in build time meaning if you have a language
key that generated dynamicly , you can't localizate it or for example
if you get a key from api fetch and need to localizate it, you can't
beacuse Liferay localization method for react (
Liferay.Language.get("yourLanguageKey") ) its undefined in runtime and
you can't use it.
from: https://npm.io/package/liferay-react-runtime-localization

how to customize export data(listview) SuiteCRM

I am able to customize if i write create_export_query() in main modules(modules/Leads/lead.php)
but I want this should be upgrade safe code,
can we add create_export_query() method in custom path instead of in lead.php
if so in which file we can add this function other than main module location?
custom/modules/Leads/lead.php will work?
thanks
Naren
custom/modules/Leads/lead.php will not work until you change beanFile location into main bean.
There are 2 ways to do this.
1) Make an extension, custom/Extension/application/Ext/Include, make
a new file CustomLeads.php, put your custom BeanFile location here
for lead module.
2) As export is certainly an action,you may create a custom
controller,ie custom/modules/Leads/controller.php, create a new
function action_export, put your custom code there.
Overriding bean of Suite core module is not recommeneded as it may crack whole system at any point. You should go with #2.

Close method not working in Office

Im trying to use Microsoft.Office.Interop.Word._Document.Close() in a .net 3.5 windows form app.
No matter how much I search here and on Google I cannot find the correct parameters to put in the Close method.
I am using version 14.0.0.0 of Microsoft.Office.Interop.Word and I would like to close the document without saving and ideally ensure that the application can isolate the document thread so that users can still open word documents outside the running application.
See the Close method of the Document class described in MSDN. If you need to omit the parameter and use the default value - pass the Type.Missing parameter.
Try this:
object doNotSaveChanges = Word.WdSaveOptions.wdDoNotSaveChanges;
object missing = System.Reflection.Missing.Value;
_Document.Close(ref doNotSaveChanges, ref missing, ref missing);
This is the source
I'm not sure if you'll need the middle line or not. It's not from the original source it's from here

How to list all datasets in CKAN (not only the active ones)

I am working on a project based on CKAN, and I am required to list in a page all the datasets that have the state "active" and "draft". When you go to the datasets page, you can only see the ones that have the state marked as "active", but not "draft".
If I use the API (call the package_list() method) or REST calls (http://localhost/api/3/action/package_list), CKAN only returns "active" datasets, but not "drafts". I double and triple checked the documentation, and apparently one cannot lists the datasets by their state.
Does anybody have a clue on how to do this? Has anybody done this already?
Thanks!
If nothing else, you could write an extension to do this. The database call itself will be pretty simple:
SELECT id,title,name FROM package WHERE state='active' OR state='draft';
I managed to modify CKAN core to list the datasets that do not have the state "draft" or "deleted", and it works, but I do no want to touch CKAN's core, I want to do this using a plugin, so the normal thing to do is to implement plugins.IActions and override the package_list method with a custom one. I have already written my own extension to try to modify CKAN behavior on method package_list(), but I can't seem to figure it out how to make it work.
Here is my code:
#side_effect_free
def package_list_custom(context, data_dict=None):
datasets = []
dataset_q = (model.Session.query(model.Package)
.join(model.PackageRole))
for dataset in dataset_q:
if dataset.state != 'draft' and dataset.state != 'deleted':
datasets.append(dataset)
return [dataset.id for dataset in datasets]
class Cnaf_WorkflowPlugin(plugins.SingletonPlugin):
plugins.implements(plugins.IActions)
def get_actions(self):
return {
'package_list' : package_list_custom
}
If I modify CKAN core it works very well, but the problem is that I am not to touch it, so I am obliged to do it via an extension.
EDIT: Ok, I managed to make it work, you need to decorate the method with #side_effect_free. I modified my code, and now it works.
The package_search API is capable of this, by searching for state:draft and setting the include_drafts=True flag. Something like this:
https://my-site.com/api/action/package_search?q=state:draft&include_drafts=True
You should be able to access this from a plugin with something like: ckan.plugins.toolkit.get_action('package_search')(context=context, data_dict={'q': 'state:draft', 'include_drafts': True}) (you'll need to assemble the context yourself, containing a 'user' key for the current username and a 'userobj' key for the current user object).
Then make a page from the results.

Resources