could any body explain the fields macros, headers, data, and bean shell in .impex file?
what are the symbols like #,$ meaning in .impex file?
what is the difference between .impEx and .imPex?
# Is a comment
$ has several meanings (depending on context)
The file extension is irrelevant, it doesn't even need to be .impex
You should read the impex documentation. It is very well documented.
https://wiki.hybris.com/display/release5/ImpEx+Syntax
Impex files uses Comma-Separated Values, it allows for exemple creating, updating, removing items.
$ Macro definitions for exemple $namemacro=name1 each time we have namemacro in the impex file, it is replaced by name1.
https://wiki.hybris.com/display/release5/Importing+and+Exporting
ImpEx is an integrated text-based import/export extension for creating, updating, removing, and exporting platform items.
For Example, I've created a demo project named training in which I can add product catalog by importing this ImpEx
$productCatalog=trainingProductCatalog
$classificationCatalog=trainingClassification
$catalogVersion=catalogversion(catalog(id[default=$productCatalog]),version[default='Staged'])[unique=true,default=$productCatalog:Staged]
$languages=ja,en,de,zh
Product catalog
INSERT_UPDATE Catalog;id[unique=true]
;$productCatalog
Related
I am working on Hybris and I generated a new extension using hybris command (ant extgen) with default settings. During extension generation, I did not change default values like I let the project name to be "training". I started developing some code just for the sake of trying it but now I wrote quite a lot of code and instead of generating a new extension, I am trying to rename "training" to a new name which is more suitable for my project.
My question is - Is there any shortcut to rename "training" to a new name. By rename I don't mean standard intellij or eclipse module rename but also updating all extension specific properties which are referring to extension name "training". Is there any hybris ant command for it?
Here is the way I can think of.
You can declare your extension as a template for extgen and then generate a new extension based on it with a new name and structure.
Let me take training as your current extension which you want to convert to some other name. Below are the steps you need to perform.
Make sure your extension (training) is there in the localextensions.xml
Update extensioninfo.xml to mark the extension as a template by adding below meta tag
<meta key="extgen-template-extension" value="true"/>
Look like
<coremodule generated="true" manager="org.training.jalo.TrainingManager" packageroot="org.training"/>
<meta key="extgen-template-extension" value="true"/>
<webmodule jspcompile="false" webroot="/training"/>
Create an extgen.properties inside training extension/folder with below properties
Please note, If your current extension is with a different name then training in that case you need to change below values accordingly.
extgen.properties:
YEXTNAME_TOKEN=training
YMODULE_TOKEN=training
YMODULE_PACKAGE_ROOT=training
YMODULE_CLASS_PREFIX=training
YPACKAGE_TOKEN=org.training
YMANAGER_TOKEN=TrainingManager
YCLASSPREFIX_TOKEN=Training
YGENERATED_TOKEN=Generated
Run ant extgen and select your extension (training) from the given selection option and give the name and package the way you want when it prompt for it.
Now replace training extension with the newly created extension inside localextensions.xml
Test and patch wherever needed! :-)
I don't think so. It might also be easier just to create a new one and move the code into the new extension.
No it is not possible. The generated extension itself was created from a template where the word "training" is inserted into many places (class names, package names, configurations...) .
The other approach would be to look into the ext-template folder (6.7). There are all templates. Search for any token in the templates and make appropriate change in your generated extensions.
Depending on the amount of your extensions, it will also take some time... and you need to understand how extgen works, first.
I have a folder with a large amount of .doc and .docx files, I would like to develop a python script to edit the tags of each file so I can find a file in the folder using the tags - thus making my life a little easier.
I am unsure of how to even start and was hoping someone could point me to a library or provide some sample code to help me get started.
I am not sure if the file extenstion matters because this seems to be a windows property (right-click file > Properties > Details > Tags > type in tags) but if the extension matters I do can change all the files to be .docx
The python-docx package provides methods to access most of the metatdata in a word file. The class docx.opc.coreprops.CoreProperties in specific allows you to modify author, category, etc. I didn't see tags mentioned but if you do some more research i'm sure you can find it.
docx.opc.coreprops.CoreProperties.keywords can be used to update doc file tags.
We have one table called CustomerPreference which has some 20+ columns and 800K records. i am trying to get the complete impex [with all the columns like all 20+ columns in the impex definition] but i don't have all the columns in the sample impex in the projectdata or essentialdata but i need to load the data in that table for one defect.
Need to know whether there is anyway or any tool in hybris can get me the complete impex statement for that table? Thanks in advance and Appreciate your help.
in the hmc (hybris management console, by default via http://localhost:9001/hmc/hybris?wid=MC0x0) you can go to
System -> Tools -> Script Generator
and click on the "Generate" button to have a script generated that will allow to export the whole type system.
You will then have to manually select the parts of the generated script that contains the types (and relationships) that you want to actually export.
But this will give you some sort of a head start for a script.
Once you have the script ready you can test it in the hac (http://localhost:9001) and click on
Console -> ImpEx Export and paste your script in there to do the export (I think) .. or use an impex cronjob to execute your script..
Hope this helps a bit.. :)
In Lotuscript you can manipulate design elements - create them, change them, rename them, etc.
Are you able to do the same thing for Xpages and custom controls design elements?
====================================================================
My question should have been clearer. What I want to accomplish is to copy an existing cc and give it a new name, programatically. The app will then close and reopen (or refresh or get rebuilt) so that the app can "see" the new cc. If I copy the cc it will only have one field on it. I will add custom code later. I could just create a new cc with no code in it, that would work too.
I am not familiar with the DXL exporter but I can research it. Using that can I just export the design of the cc to an XML file in a temp directory, use the transform to change the name, and then import the control?
I think the XPage or Custom Control design elements are probably under MISC_CODE or MISC_FORMAT design elements in a NoteCollection.
However, accessing that design element is the easy part. Doing a create / rename / change etc is a much bigger task.
Remember that the XPage or Custom Control XML file is only a starting point:
XPages and Custom Controls also have a .xsp.metadata file, as you'll see with source control.
Custom Controls will also have (and need) a .xsp-config file.
There are corresponding .java files for every XPage and Custom Control in the Local source folder. They're created by a builder based on parsing the XML. I don't think you'll be able to create those programmatically. I'm not sure of the impact of renaming them.
For Custom Controls, even if you can rename the .java file, it's referenced in the .java files of relevant XPages. Updating those is goiong to be a significant task.
The XPages runtime doesn't even use those .java files. Instead it uses the .class files in WebContent\WEB-INF (you need to use Project Explorer view and modify the filter to see those files). This is compiled byte code, so you won't be able to update the .class files for XPages containing renamed Custom Controls, as far as I know.
Even if you can rename the .class files, the XPages runtime almost certainly won't use them until either a Clean (which will overwrite anything you've done) or an HTTP restart. As far as I can tell they're cached.
Depending on your use cases, it's possible not all these points will be an issue, e.g. if you're modifying the XML files and building with headless designer.
I suspect this is why nothing was added to the NoteCollection object or a specific NotesXPage / NotesCustomControl API class added.
In Lotuscript you can manipulate design elements - create them, change them, rename them, etc.
This is only partially true. There is a LS API to create/alter views and outlines. Good luck with other design elements - although they're standard "notes", so you can access their items, in most cases you won't compile them and there will be some problems with signatures (real experience with TeamStudio CIAO).
Your question has two points of view - do you want to alter design elements in design process or alter running application?
To help a designer you can go the way of Eclipse extensions and enrich tools in IBM Designer to help developer. Something like TeamStudio Designer. In this case you need to look for source design elements, mentioned by Paul.
To enrich application you don't need to alter source design elements. IBM Designer transforms XML in source code to a Java code (JSF framework) - so you can generate your Java code from anything you wish. Take a look inside Local\xsp folder of NSF in Package explorer. You will find Java sources made from your XPages and Custom Controls. So if you don't need to work with design elements, go for Java components - they can be built on the fly.
And of course, there is always the option of DXL framework - so you can clone/alter design of the application through XML transformations. Good starting point: http://www-10.lotus.com/ldd/ddwiki.nsf/dx/ls-design-programming.htm
At this location in this jar file alfresco-remote-api-5.0.d.jar\alfresco\templates\webscripts\org\alfresco\slingshot\node-browser\ there is a webscript. But this webscript consist to 2 files (node-browser.get.desc.xml and node-browser.get.json.ftl ) There isn't the node-browser.get.js file.
I want to know what is done in this fil. I want to select categories and include certains aspects (i have added to categories) in the selection.
Thank you.
Javascript file is not mandatory while creating webscript.
Below is the URL of source file which is getting called on your specified webscript.
https://svn.alfresco.com/repos/alfresco-open-mirror/alfresco/COMMUNITYTAGS/V5.0.d/root/projects/remote-api/source/java/org/alfresco/slingshot/web/scripts/NodeBrowserScript.java
Below is context file for java file.
https://svn.alfresco.com/repos/alfresco-open-mirror/alfresco/COMMUNITYTAGS/V5.0.d/root/projects/remote-api/config/alfresco/web-scripts-application-context.xml
check bean with webscript.org.alfresco.slingshot.node-browser.node-browser.get
Id.
you need to change in that if you want to customize it.
Usually a webscript is made of 3 parts:
a description file (in your case node-browser.get.desc.xml) which
uses a description language to define many aspects of the
webscript, like security, transaction management and so on
a Server-Side Javascript js file that consists of the business logic that is performed by
the script. In your case you don't have the node-browser.get.js file
because this happens to be a Java backed webscript, that is a
webscript whose business logic is written in Java and not in
Server-Side Javascript.
a Freemarker Template file, node-browser.get.json.ftl, which contains
the presentation logic (view) that has to show the results of the invocation.
In order to achieve what you're looking for about selecting categories and include certains aspects, you'd better learn more about how webscripts work and moreover how to configure/customize Alfresco's interface.
You'd better look at these tutorials in order to get more info.