Audience manager - Com.Tridion.Broker.StorageException: Transaction rolled back - tridion

Edit - Should add this is for Tridion 2011 SP1
When attempting to save a new audience manager profile using the TOM.NET API, I receive the following error:
Com.Tridion.Broker.StorageException: Transaction rolled back, error executing work, error executing work
at Codemesh.JuggerNET.NTypeValue.Throw(Int64 inst)
at Codemesh.JuggerNET.JavaClass.ThrowTypedException(Int64 inst)
at Codemesh.JuggerNET.JavaMethod.CallVoid(JavaProxy jpo, Object val)
at Tridion.OutboundEmail.ContentDelivery.Profile.Contact.Save(String pageUri)
Usually with Storage Exceptions I keep thinking there is something wrong with my cd_licenses.xml file on my presentation server, or configuration doesn't seem to be pointing at it....but I've checked over both and everything appears to be ok.
Anyone come across this message before when saving audience manager profiles?

Possible causes for this problem that I've seen:
You're missing some JAR files that are needed
You're using the 32-bit version of the DLLs on a 64-bit system (or vice versa)
Having Outbound Email and Content Delivery in the same application pool

Check your cd_stroage_conf.xml to make sure you have correct storage bindings included.
<StorageBindings>
<Bundle src="AudienceManagerDAOBundle.xml"/>
</StorageBindings>
<Storage Id="profiledb" Class="com.tridion.storage.persistence.JPADAOFactory" Type="persistence"
dialect="MSSQL">
<Pool CheckoutTimeout="120" IdleTimeout="120" MonitorInterval="60" Size="5" Type="jdbc"/>
<DataSource Class="com.microsoft.sqlserver.jdbc.SQLServerDataSource">
<Property Name="serverName" Value="localhost"/>
<Property Name="portNumber" Value="1433"/>
<Property Name="databaseName" Value="tridion_submgmt_DB"/>
<Property Name="user" Value="username"/>
<Property Name="password" Value="password"/>
</DataSource>
</Storage>
Also, you need to have item typemapping to the same DB.
<Item typeMapping="AudienceManagerProfile" storageId="profiledb"/>
Optionally, if you are using tracking you should have the tracking db and tracking typemapping as well.

Related

Spring MVC: how to make site language selection remembered across browsers?

I am using Spring MVC for a website with two languages: English and Chinese.
I have the following in the Spring context
<bean id="localeChangeInterceptor" class="org.springframework.web.servlet.i18n.LocaleChangeInterceptor">
<property name="paramName" value="lang" />
</bean>
I am able to see the language of the website changes if I select another language through a dropdown in the HTML interface.
Suppose I am viewing the website when its language is Chinese. I close the browser. Then I open the browser again and I enter the url of the website without the lang parameter in the URL.
Here is the issue: Chrome is able to remember what the language was when the browser was closed and use that language when the new browser window is opened. This is the behavior I want to have. However, Firefox does not. When I open it and enter the site url, it always shows the site in the site's default language (English in this case).
How can I make the Firefox (or other browsers) open the site with the language used when it was closed?
Thanks!
You also need to add a SessionLocaleResolver.
<bean id="localeResolver" class="org.springframework.web.servlet.i18n.SessionLocaleResolver">
<property name="defaultLocale" value="en" />
</bean>
If you do not add this then I'm pretty sure the default behavior is that the AcceptHeaderLocaleResolver will be used, which resolves the locale by checking the accept-language header in the HTTP request. This means your browser will make the determination, use your language preferences and send the language choice in the accept header.
If your application is stateless then you may need to use the CookieLocaleResolver instead.
After research, I found out the solution. I need to set locale resolver this way:
<bean id="localeResolver"
class="org.springframework.web.servlet.i18n.CookieLocaleResolver">
<property name="defaultLocale" value="en" />
<property name="cookieName" value="clientLang" />
<property name="cookieMaxAge" value="31556926" />
</bean>
Put it another, I need to give it life to persistent for some time by setting a value to cookieMaxAge. I tested it out in Firefox and Safari, it worked well. This thread has the credit:
When I used CookieLocaleResolver, I can set invalid cookie to crash spring web application
Cheers!

Alfresco Fileupload during workflow

How can I have file upload property during workflow in my model file?
I have use alfresco 4.2 version. I like to add property for fileupload in below code which allow user to upload file during workflow.
<type name="iabookwf:createProjectSizingTask">
<parent>bpm:workflowTask</parent>
<properties>
<property name="iabookwf:mandays">
<title>Estimated Man Days</title>
<type>d:int</type>
<mandatory>true</mandatory>
</property>
<property name="iabookwf:totalCost">
<title>Total Estimated Cost</title>
<type>d:double</type>
<mandatory>true</mandatory>
</property>
</properties>
<overrides>
<property name="bpm:packageItemActionGroup">
<default>edit_package_item_actions</default>
</property>
</overrides>
<mandatory-aspects>
<aspect>bpm:assignee</aspect>
</mandatory-aspects>
</type>
You will need to add a site-webscript form control that utilizes the alfresco/components/upload/ components. The way to achieve this is to add a Share module extension, which will load the upload components onto the Tasks page or template. Then override the alfresco form control, via the web-extensions directory to include the Upload button on the Form control for associations.
In addition to the Upload button, you will need to add an upload handler so that Alfresco knows how to handle the newly uploaded file. Generally this can go into a workflow site, a workflow directory, dedicated for workflow items, etc. You can copy/paste and extend the alfresco's upload.post.* webscripts and modify them for your own use. However, regardless of where the newly uploaded files go, the user accessing the workflow, must have permissions to access the file, otherwise the associated entry will be blank for that user.
Here is a screenshot of a typical project layout:
Once your form controls are in place, edit the share-config-custom.xml to define the form used in your workflow, and override the form entry for that control, to use your new control.
share-config-custom.xml
<alfresco-config>
<config evaluator="string-compare" condition="activiti$activitiAdhoc">
<forms>
<form>
<appearance>
<field id="packageItems">
<control >
<control-param name="allowUpload">true</control-param>
</control>
</field>
</appearance>
</form>
</forms>
</config>
For a working example, you can see may visit my blog on this feature which includes source codes for an Alfresco Enterprise Maven Project.

Is there a way to tell if a particular *-context.xml file has been loaded?

I was advised that the proper way to load multiple share customisations was to create a custom bootstrap for it like so:
<!-- Provide extensions config -->
<bean id="MyCustomClientConfig" class="org.springframework.extensions.config.ConfigBootstrap" init-method="register">
<property name="configService" ref="web.config" />
<property name="configs">
<list>
<value>classpath:alfresco/web-extension/mycustom-config.xml</value>
</list>
</property>
</bean>
However the customisations in my custom share config, specifically making an aspect visible, does not seem to be working.
I'd like to find a log4j debugging key that I can enable or 'turn up' to get more debugging info out, ideally to see if this bootstrap, which is in a *-context.xml file is being loaded.
I'm deploying this code as an AMP if that's relevant, and I've placed the context file in config/alfresco/web-extension

Alfresco Java backend webscript: reading properties file

I need to include a properties file into my Alfresco webscript developed in Java.
How can I include it?
The properties file includes a hash map useful for service work.
How can use ResourceBundle?
Note that it is not a i18n file.
Thanks
-- Marco
you should be able to get your props as map via spring injection with your java webscript bean:
<property name="your map">
<bean class="org.springframework.beans.factory.config.PropertiesFactoryBean">
<property name="location" value="your_properties.properties"/>
</bean>
</property>

Tridion deployer removes localized/parent files

We are facing weird behaviour during publishing pages in Tridion.
We have English pages in 050 publication and same pages are localized in 060 publication. Let's take a sample page accounts (tcm:120-1234) in English publication and same localized page (tcm:125-1234) in Spanish Publication.
When we publish English page, accounts, it gets published successfully but local deployer removes the its spanish page (tcm:125-1234). When we publish Spanish page, it removes its English page (tcm:120-1234).
We have verified the deployer side and confirmed that other file gets removed from the server itself.
Please refer below the deployer log for instructing to remove the page. But we are not sure why it removes other publication file. Is it becasue of the same page item id? I think it shouldn't, since it is localized.
DEBUG FSEntityManager - Removing pagemeta/pageurl/business/accounts.content in transaction tcm:0-754-66560.
We understand from this log that this been instructed from deployer but not sure how & why it was requested. We are analyzing what FSEntityManager class is doing.
Can anyone help me on this?
That looks like both publications share the same webroot. Check your storage Conf and publication path properties.
If the File System is used for storing content and metadata, the content of the Master or Child Publications will be over written.
To account for this, set explicit settings for metadata in cd_storage_conf.xml, to ensure that all metadata does not go to the same storage location, for example:
<Storage Type="filesystem" Class="com.tridion.storage.filesystem.FSDAOFactory" Id="defaultFile" defaultFilesystem="false">
<Root Path="c:\published\localFileSystem" />
</Storage>
<Storage Type="filesystem" Class="com.tridion.storage.filesystem.FSDAOFactory" Id="defaultDataFile" defaultFilesystem="true" defaultStorage="true">
<Root Path="c:\published\localFileSystem\data" />
</Storage>
<ItemTypes defaultStorageId="defaultFile" cached="false">
<!-- Query type mapping is replacement for Query gnenerator. If there was query generator defined in a Broker configuration then Query type mapping should be binded to default DB. -->
<Item typeMapping="Query" storageId="defaultdb"/>
<Item typeMapping="PageMeta" cached="true" storageId="defaultDataFile"/>
<Item typeMapping="ComponentPresentationMeta" cached="true" storageId="defaultDataFile"/>
<Item typeMapping="ComponentMeta" cached="true" storageId="defaultDataFile"/>
</ItemTypes>

Resources