Importing tags into AEM from a CSV file - tags

Our client has a spreadsheet of about two thousand tags they want to start using on their AEM-based website.
I need a quick way to automatically import them as AEM tags.
I was thinking of writing a script to parse the document and issue a number of POST requests to AEM to create the content at /etc/tags
As an alterative, I considered uploading the CSV file to the repository and handling the creation of tags by means of a custom component or running a Groovy script in the AEM Groovy console.
Both solutions would require a lot of work and I'm a bit short in time. I also wouldn't like to reinvent the wheel. I don't think there's a way to do complete this task using OOTB functionality but is there any way to speed up the process?

You could use the Tag Maker provided by ACS AEM Tools.
You can find it in Tools > ACS AEM Tools > Tag Maker after installing the AEM Tools package on your instance.
It allows you to import tag hierarchies from CSV files and has a number of pre-defined converter that infer tag names and titles.

Related

Create a desktop app that generate ms word file

I'm now working with tons of MS Word files and trying to find a way in improving my workflow.
I'm wondering if there's a way to create a desktop app which can preview certain parts from a Word file, select them and generate a new one with controls in Word's text style, paragraph, etc.
I supposed that this would take MS Word API and some frame structure particularly. I've been using Electron/node.js to create some cross platform applications, wondering if it can do as well? Or is there any reference that I can dig in?
Sorry if this sounds like a rookie one. I've tried to search but still can't find out where to start.
There are three possible ways to get the job done:
Automate MS Word to get job done. See Automate MS Office Applications using Python win32com module for more information. For example:
import win32com.client
word = win32com.client.Dispatch("Word.Application")
Use the Open XML SDK for generating Word documents at runtime, see Welcome to the Open XML SDK 2.5 for Office for more information.
Use third-party components.
If you are on Windows, there seem to be some way to access Word files in Python: https://www.blog.pythonlibrary.org/2010/07/16/python-and-microsoft-office-using-pywin32/. Maybe in node too.

What's the best way to use CSV source data in a list component?

Disclaimer: I am not an AEM developer, I'm filling in on a project, so forgive me if I am missing the obvious.
I have a page template that will contain a component that will show a list of locations, this template will be used for many city pages.
I'm trying to figure out the best way to get the content into the JCR or read it using a script from a CSV file.
Are there any out-of-the box or open source components out there that can accomplish this?
There are several ways to accomplish your task. The easy part should be rendering the information. You would usually implement a Sling model or a class extending WCMUse, access the repository via the Sling API and render the resources via Adobe HTL. The resources being rendered have to be selected of course: write a Servlet which provides an interface to the resources and use an adequate form element in the component's dialog.
The hard part consists of two parts:
Perhaps just upload the file, process the data and by using the Sling API for resource creation, you can write the data into the repo. You could also utilise the DAM for such tasks and implement a workflow.
Depending on the amount of data, you might want to save the data as JSON string as property of a node.
I hoped that helped a bit.
"Are there any out-of-the box or open source components out there that can accomplish this?"
Simple answer: NO
While there are several libraries that can help you parse CSV files, storing it in JCR depends completely on your project. The structure can be arbitrary or (in a brute force way) you can just store the CSV file as data in your node but that may not be useful.
Depending on how you plan to use the data, it may be useful and optimal to save it in a relevant hierarchy for your project.

Tableau: can a visualization be created via javascript or other language?

I am trying to create a new visualization (sheet) in a tableau online workbook via javascript API or by another language. Not by using Tableau Desktop or "manual" interaction into Tableau Online.
I know that the JS API allows me to control (filter, display, etc.) existing visualizations, and the SDK can extract data and publish, but my need is to "create" a new visualization into an existing workbook.
Is there a way to do this?
The only methods of creating Tableau content that I'm aware of is using Tableau Desktop or Web authoring of something that is already published.
I explain how to do what you're asking on the blog post linked below. You can use Python with Jinja2.
The basics ...
Create a template of your XML.
Put in the necessary Jinja2 templating language code into your template as placeholders for the data and XML that needs to be rendered by Jinja2. You can render data conditionally as well.
Create a CSV file that specifies what the Python program needs to know to create your workbooks.
Run your Python application to generate a TWB file based on your template and input file. You can also easily create TWBX by zipping the TWB and data together.
The link gives code examples and an example CSV file for specifying your input.
https://www.linkedin.com/pulse/create-tableau-visualizations-programmatically-allan-thompson

AEM - import static pages?

We're considering using Adobe Experience Manager for an upcoming project. But we have a number of pre-made static pages we'd like to import into this project. What would be the best way to 'import' these pages into an AEM project?
Note: these pages are HTML that may contain some CSS and JS.
You can serve static HTML, CSS and JS files from AEM. There are multiple ways of getting your files in AEM including but not limited to:
1) Through CRXDE, goto Create > Create File... name your HTML file and save. On the jcr:content subnode, double click on the jcr:data binary property, upload your HTML file and click save.
2) cURL your files into AEM. See the documentation on the SlingPostServlet. You can write a script in Bash, Python or your language of choice to loop over your files and POST to the AEM instance.
3) Go to CRXDE Package Manager, create a simple package, download it and unzip the file. Examine the contents of the zip including the .content.xml files and the /META-INF/vault/filter.xml file. Add your HTML files and update the package filters, zip up the files, upload the package to AEM through the CRXDE Package Manager and install.
Adding to what "nateyolles" has already mentioned,
Adobe Experience Manager provides several options (direct/Indirect) for either importing or exporting data (within the AEM tool they are labeled importers and are found under the tools area). Lets look at each option so you can decide which one will best service your current needs.
1) Site Importer – Allows you to import either a web page or an entire website into AEM. For site imports, you will need to need to specify the project title, site URL (of page or site to import), thumbnail image for the template, the sitemap (for the pages in CQ using the template) and whether or not you want to overwrite (if page or site exist in AEM)
"Use of Site Importer tool"
Link:- https://docs.adobe.com/docs/en/aem/6-2/develop/dev-tools/site-importer.html
2) Feed Importer – The feed import option within Adobe Experience Manager provides the ability to import content via a feed (whether that be an RSS feed or an Atom feed). This can be extremely beneficial to blog creators, like myself, who might want to bring in the content of their blog (from say WordPress, Drupal or another CMS) into an AEM environment.
3) Offline Importer – This functionality, within Adobe Experience Manager, provides the ability to import content from Microsoft Office Word document files into AEM templates (ending with the file extension of .doc). Please note that you should reach out to Adobe’s consulting team for asssistance on this so that they can set up the inputs in the most optimal way to receive your offline data.
4) Import from older version of CQ – This is a pretty straightforward way to import or upgrade from an older version of CQ. If you are familar with AEM, you can stop existing instance, if you have a stand alone instance of AEM replace the jar file, and restart
If you have an application server instance, you will follow these steps:
Stop existing instance, replace the war file and restart.
5) Bulk Editor – This feature provides a multitude of functionality within AEM. For starters, you can make large changes to content at once. Secondly, you can export content to CSV (Microsoft Excel) files.
Kautuk Sahni
(Adobe AEM Community)

Launching a GWT module when clicking on an XML

Greetings,
I'm looking for a way to launch a GWT module when a user clicks on an XML file and have the module consume the xml data. Ideally I would like to render the XML in a rich manner and would prefer to use GWT controls instead of having to lay it out by hand via xslt + javascript.
I'm supposing one way would be to point the xml to a well known xslt that creates a simple html page that forces a redirect to the gwt module but how would I transfer the xml data to said module to allow for enhanced formatting?
Another way would be to have the process that produces the xml also include the bootstrap gwt module but it would be creating multiple bootstrap instances over time and pollute the user's directory.
The use case is that a user would run this app on their local machine which outputs an XML file. If they try and view the xml file in a browser, I'd like to have the GWT module take over and present the data accordingly. I would rather they not have to go to a page and upload the data manually.
Appreciate any ideas on the matter.
TIA
If it's something that runs on the user's machine, I would recommend to ship an executable, or generate a parallel HTML file to present the data. JavaScript run from file:/// will not be able to acces the filesystem.