convert months name into Roman numbers
Hello,
I have the following requirements:
- Convert the names of months into Roman numerals. The only solution I could think of is using web reports. Can anyone provide me with a sample script for this?
- Generate an auto number (1, 2, 3...) in a workflow attribute. I found an attribute type called ADN Reference & ADN table Key Lookup, but unfortunately, these ADN functions only work for XECM Engineering. I only have XECM installed on my server. Can anyone provide a workaround for this?
Regards,
Novi
Answers
-
Hi,
Your use case isn’t entirely clear, but my recommendation is to work on the backend rather than the frontend. If you implement the conversion on the frontend with JavaScript, you’re relying on the browser, which isn’t something you can control 100%. If you have AnswerModules' ModuleSuite available, you can write code similar to the following in the Content Script controller of your Beautiful WebForms:
def monthToRoman = [ "January": "I", "February": "II", "March": "III", "April": "IV", "May": "V", "June": "VI", "July": "VII", "August": "VIII", "September": "IX", "October": "X", "November": "XI", "December": "XII" ] def convertMonthsToRoman(monthNames) { monthNames.collect { monthToRoman[it] ?: "Invalid month" } }
By doing this, you can ensure that the code is executed exactly how, when, and where you want (and you won’t need to rely on OScript and you don't even have to deploy anything).
The same applies for the incremental ID. ADN is available only in certain flavors of xECM, and if you don’t have it, you can create a field based on a value stored in the database and increment it using backend mechanisms (again, with very simple ContentScript). These mechanisms would account for race conditions, simultaneous access, and all best practices for parallel access to the same unique resource by different threads.
Once again, if you handle this on the frontend, it’s a sure recipe for disaster.
Jacopo Malnati
0 -
This would require a change to the code formatters, if you trace the code from ?func=admin.dateformat you can find where the formats are used and then trace them to where they are used in the utils methods.
0
Categories
- All Categories
- 122 Developer Announcements
- 53 Articles
- 151 General Questions
- 147 Thrust Services
- 56 OpenText Hackathon
- 35 Developer Tools
- 20.6K Analytics
- 4.2K AppWorks
- 9K Extended ECM
- 917 Cloud Fax and Notifications
- 84 Digital Asset Management
- 9.4K Documentum
- 31 eDOCS
- 181 Exstream
- 39.8K TeamSite
- 1.7K Web Experience Management
- 8 XM Fax
- Follow Categories