Why no BCC UI for inventory management in ATG? - user-interface

As per my understanding, inventory of SKUs should be maintainted by business users. But, I don't see option(UI) for that in BCC. Is my understand wrong? If not, what is the strategy Oracle/ATG recommending business users to maintain inventory management? Why no UI given for business users for the same? what is the reason behind it?

But default inventory administration is done via dyn/admin.
The reason for this even i donno.ACC and dyn/admin are legacy modules of ATG.So may be when BCC came in picture they just left inventory as is.If u see even ACC is capable of doing almost all things what BCC does.Infact it also additionally configures scenarios for ATG.So all i could say there may be a reason behind all this.Infact they(Oracle) are the market leaders.
In http://hostname:8080/dyn/admin go to Commerce Administration->Inventory Administration.or just http://hostname:8080/dyn/admin/atg/commerce/admin/inventory/index.jhtml
assuming 8080 is publishing port.You can also view inventory in production server also.
This page allows an administrator to view the results of the inventory query operations, to manipulate the various properties of each item, and to notify the system of inventory updates. Out-of-the-box, the interface allows the administrator to set, increase, or decrease the stockLevel, backorderLevel, and preorderLevel of any item in the inventory. This page also allows the administrator to set the stockThreshold, backorderThreshold, preorderThreshold, availabilityStatus, and availabilityDate for each item. is configured through The properties files of the servlet beans described below configure the updated inventory.
But to be honest we can override this behaviour by doing the following.
you can add the Invenory repository as a separate tab in bcc as follows by doing the following changes.
config/atg/remote/controlcenter/service/ApplicationConfigurationManager.properties (OOTB)
applicationFiles+=/com/remote/controlcenter/service/inventory.xml
config/com/remote/controlcenter/service/inventory.xml (Custom)
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE application-configuration
PUBLIC "-//Art Technology Group, Inc.//DTD BCC Application Configuration //EN"
"http://www.atg.com/dtds/application-configuration/application-configuration_1.0.dtd">
<applications>
<application id="editInventory">
<resource-bundle>com.webui.WebAppResources</resource-bundle>
<display-name-resource>editInventory.displayName</display-name-resource>
<destination-page>
<url>/AssetManager/assetManager.jsp</url>
<query-parameter key="project" value="-1" />
<query-parameter key="activity" value="editInventory" />
</destination-page>
<acl>Profile$role$epubAdmin:read;Profile$role$epubSuperAdmin:read;Profile$role$epubManager:read;Profile$role$epubUser:read</acl>
<initializer>
</initializer>
<sort-priority>30</sort-priority>
<category>yourProjectExtras</category>
</application>
</applications>
config/atg/web/assetmanager/configuration/taskConfiguration.xm (OOTB)
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE task-configuration
PUBLIC "-//Art Technology Group, Inc.//DTD Asset Manager Task Configuration//EN"
'http://www.atg.com/dtds/web/assetmanager/taskConfiguration_1.0.dtd'>
<task-configuration>
<!-- Define an activity for editing the inventory repository -->
<activity id="editInventory" inherit-from="assetManager.defaultEdit">
<activity-name>editInventory</activity-name>
<!-- Configure the buttons on the toolbar -->
<operations>
<operation>create</operation>
<operation>delete</operation>
</operations>
<!-- Define tabs for the left pane -->
<tabs>
<tab-order>
<tab-id>browse</tab-id>
<tab-id>search</tab-id>
</tab-order>
<initial-tab>browse</initial-tab>
<!-- Configure the Browse tab with a list view of inventory items -->
<tab id="browse">
<display-name-resource>assetManager.tab.browse</display-name-resource>
<page>/browse/browseTab.jsp</page>
<views>
<view-order>
<view-id>editInventory.inventory</view-id>
</view-order>
<initial-view>editInventory.inventory</initial-view>
<view id="editInventory.inventory">
<resource-bundle>com.webui.WebAppResources</resource-bundle>
<display-name-resource>editInventory.browseTab.view.inventory</display-name-resource>
<configuration>/com/web/assetmanager/InventoryViewConfiguration</configuration>
<page>/browse/list.jsp</page>
</view>
</views>
</tab>
<!-- Configure the Search tab to allow searching for inventory items -->
<tab id="search">
<display-name-resource>assetManager.tab.search</display-name-resource>
<page>/search/searchTab.jsp</page>
<views>
<initial-view>form</initial-view>
<view id="form">
<page>/search/searchForm.jsp</page>
<item-types>
<item-type>/atg/commerce/inventory/InventoryRepository:inventory</item-type>
</item-types>
</view>
<view id="results">
<page>/search/searchResults.jsp</page>
</view>
</views>
</tab>
</tabs>
</activity>
</task-configuration>
config/com/web/assetmanager/InventoryViewConfiguration.properties (Custom)
$class=atg.web.assetmanager.configuration.FilterableBrowseListViewConfiguration
# The path to the repository from which to draw the items
repositoryPath=/atg/commerce/inventory/InventoryRepository
# The type of items to display
assetTypeName=inventory
# Types the user is allowed to create in this view
createableTypesList=inventory
# Number of items to show per page
itemsPerPage=50
/config/atg/bizui/activity/ActivityManager.properties (OOTB)
activitySources+=/com/activity/ActivitySource
config/com/activity/ActivitySource.properties (Custom)
$class=atg.bizui.activity.PortalActivitySource
# The name and description for the entry that appears on the left side of the home page.
activitySourceResourceBundle=com.webui.WebAppResources
activitySourceNameResource=activitySourceName
activitySourceDescriptionResource=activitySourceDescription
# Generic activity definitions
genericActivityDefinitionFiles=/com/activity/genericActivities.xml
genericActivityFileModificationInterval=every 300 seconds
securityConfiguration=/atg/dynamo/security/SecurityConfiguration
XMLToolsFactory=/atg/dynamo/service/xml/XMLToolsFactory
scheduler=/atg/dynamo/service/Scheduler
#defaultCreateWorkflowURL=/atg/bcc/process
defaultCreateWorkflowURL=/atg/bcc/process?successURL=/AssetManager/assetManager.jsp
# Default URL for the main project page.
defaultProcessURL^=/atg/bizui/activity/PublishingActivitySource.defaultProcessURL
# Default URL for the workflow task page. All tasks use the AssetManager UI.
defaultTaskURL=/AssetManager/assetManager.jsp
fallbackPriority=2
/config/com/activity/genericActivities.xml (Custom)
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE gsa-template
PUBLIC "-//Art Technology Group, Inc.//DTD General SQL Adapter//EN"
"http://www.atg.com/dtds/activitymanager/activitymanager_1.0.dtd">
<generic-activities>
<!-- Add a link named "Edit Inventory" -->
<activity>
<id>editInventory</id>
<resource-bundle>com.webui.WebAppResources</resource-bundle>
<display-name-resource>editInventory.displayName</display-name-resource>
<description-resource>editInventory.description</description-resource>
<destination-page>
<!-- This link takes the user to the AssetManager UI -->
<url>/AssetManager/assetManager.jsp</url>
<!-- The clear-context flag clears any active Content Administration project references out of the user's session. -->
<clear-context>true</clear-context>
<!-- The ACL is optional. This ACL limits the visibility of this link to people with any of the epub roles. -->
<acl>Profile$role$epubAdmin:read;Profile$role$epubSuperAdmin:read;Profile$role$epubManager:read;Profile$role$epubUser:read</acl>
</destination-page>
</activity>
</generic-activities>
Restart the publishing server if it is already running.
source:
https://community.oracle.com/thread/2354883

Related

Unable to render Html MvcSiteMap Nodes based on User Types

I have two user types-
-Admin
-Visitor
If the user type is "Visitor" then the Sub1 node will not be there in the menu.But the below code doesn't work to hide/remove the specific node.
My Sitemap looks like:
<mvcSiteMapNode title="Home" controller="Home" action="Index">
<mvcSiteMapNode title="Site Map Test" controller="SitemapTest"action="Index" key="sitemaptestnode">
<mvcSiteMapNode title="Sub1" controller="SitemapTest" action="Sub1" key="Childsitemaptestnode1" visibility ="false"/>
<mvcSiteMapNode title="Sub2" controller="SitemapTest" action="Sub2" key="Childsitemaptestnode2"/>
<mvcSiteMapNode title="Sub3" controller="SitemapTest" action="Sub3" />
</mvcSiteMapNode>
</mvcSiteMapNode>
From the Layout.cshtml I have called
#Html.Action(“RenderMenu”,”Menu”);
Public void RenderMenu(){
var node = MvcSiteMapProvider.SiteMaps.Current.FindSiteMapNodeFromKey("Childsitemaptestnode1");
If (node.title =="Sub1"){
//Function to get the user type from database
String UserType=GetUserTypes();
If(UserType=="Visitor"){
//Hide Sub1 node from Menu
node.Attributes["visibility"]="!*"; }
}}
The most common way to handle this is to use group-based security and use the AuthorizeAttribute.
However, in this simple scenario you don't even really need groups. Adding the AuthorizeAttribute to your action method will automatically deny any users that are not logged in.
[Authorize]
public ActionResult Sub1()
{
return View();
}
This assumes you have setup a security framework that implements IPrincipal and IIdentity (of which ASP.NET Identity and Membership both do). You can get the basic framework for one of these options by using one of the default templates created by Visual Studio and copying over the relevant bits (AccountController, ManageController, related views, and related startup code) into your project.
All that would be required in MvcSiteMapProvider would be to enable security trimming.
Internal DI (web.config)
<appSettings>
<add key="MvcSiteMapProvider_SecurityTrimmingEnabled" value="true"/>
</appSettings>
External DI (MvcSiteMapProvider Module)
bool securityTrimmingEnabled = true; // Near the top of the module
That will make the nodes automatically hide when the user doesn't have access and AuthorizeAttribute will actually secure the URL so the user can't navigate there directly.
Changing visibility of a link doesn't secure anything, but if that is all you want, you should refer to the visibility provider section of the documentation.

How can I find (and rehabilitate, if necessary) the Code Snippet I created?

I created a code snippet (the first of many, hopefully) using mainly this article as guidance.
It seemed to work. Here are the steps I took:
First, I created this file with the code snippet (HtmlTableRowWithTwoCells.snippet):
<?xml version="1.0" encoding="utf-8" ?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/CodeSnippet">
<CodeSnippet Format="1.0.0">
<!-- The Title of the snippet, this will be shown in the snippets manager. -->
<Title>Create a 2-Cell HTML Table Row</Title>
<!-- The description of the snippet. -->
<Description>Creates a 2-Cell Row to be added to an HtmlTable</Description>
<!-- The author of the snippet. -->
<Author>Warble P. McGorkle for Platypi R Us (Duckbills Unlimited)</Author>
<!-- The set of characters that must be keyed in to insert the snippet. -->
<Shortcut>row2</Shortcut>
<!-- The set of snippet types we're dealing with - either Expansion or -->
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
</SnippetTypes>
</Header>
<!-- Now we have the snippet itself. -->
<Snippet>
<Declarations>
<Literal>
<ID>RowName</ID>
<ToolTip>Enter the Row instance name</ToolTip>
<Default>RowName</Default>
</Literal>
<Literal>
<ID>Cell1Name</ID>
<ToolTip>Enter the name for Cell 1</ToolTip>
<Default>Cell1Name</Default>
</Literal>
<Literal>
<ID>Cell2Name</ID>
<ToolTip>Enter the name for Cell 2</ToolTip>
<Default>Cell2Name</Default>
</Literal>
</Declarations>
<!-- Sepecify the code language and the actual snippet content. -->
<Code Language="CSharp" Kind="any">
<![CDATA[
var $RowName$ = new HtmlTableRow();
var $Cell1Name$ = new HtmlTableCell();
var $Cell2Name$ = new HtmlTableCell();
$RowName$.Cells.Add($Cell1Name$);
$RowName$.Cells.Add($Cell2Name$);
]]>
</Code>
</Snippet>
</CodeSnippet>
</CodeSnippets>
Then, I created this "manifest" file (.vscontent):
<?xml version="1.0" encoding="utf-8" ?>
<VSContent xmlns="http://schemas.microsoft.com/developer/vscontent/2005" >
<Content>
<FileName>HtmlTableRowWithTwoCells.snippet</FileName>
<DisplayName>Inserts a 2-Cell HTML Table Row</DisplayName>
<Description>Inserts a 2-Cell Row to be added to an HtmlTable</Description>
<FileContentType>Code Snippet</FileContentType>
<ContentVersion>2.0</ContentVersion>
<Attributes>
<Attribute name="lang" value="csharp"/>
</Attributes>
</Content>
</VSContent>
I zipped those two files together, renamed the extension from .zip to .vsi, 2-clicked it, and installed it into the "My Code Snippets" folder here with these steps:
And it indicates the snippet was installed in a reasonable location:
Yet, when I attempt to add a Code Snippet in VS, the only categories I see are these (no "My Code Snippets"):
When I select Tools > Code Snippets Manager..., I can navigate to Visual C# > My Code Snippets, but it is empty.
When I use the Code Snippets Manager's "Import" button and navigate to the location of the snippet and attempt to add the snippet file, I get, "The snippet files chosen were not valid."
Why does it tell me it installed successfully, when it apparently didn't (or where is it hiding)? What flaming hoop did I neglect to catapult myself through?
Is the "weird" name of the "manifest" file possibly the problem? ".vscontent" seems odd to me, but that's what the article referenced above says to name it. Perhaps that was just on oversight, and it should really be [snippetName].vscontent?
UPDATE
Apparently, naming the "manifest" file *.vscontent" is not the problem. Maybe it's a problem, but it's not the problem, because I named it the same as the .snippets file (except for the extension), went through the installation process again, and got the same exact results: seeming success, actual demoralization.
BTW, by default, when choosing a category into which to place the snippet, the Code Snipeets Manager puts a checkbox in "Microsoft Visual Studio Tools for Applications 2005 > My Code Snippets". I had previously unticked that and ticked the topmost "My Code Snippets"; this time I retained the default selection, PLUS my preferred location/category PLUS "Visual C#"
But alas and anon, the only category of those that seems to dispaly via Ctrl+K, X in VS is C#, and the expected shortcut ("row2") does not appear in the snippet dropdown.
Here's an easier way (and, as a bonus, it works):
Download the Snippets Designer:
Write the code directly in Visual Studio:
var RowName = new HtmlTableRow();
var Cell1Name = new HtmlTableCell();
var Cell2Name = new HtmlTableCell();
RowName.Cells.Add(Cell1Name);
RowName.Cells.Add(Cell2Name);
Right-click and select "Export as Snippet"
This puts the code in the Snippet Designer. Here's what it looks like after setting a few properties, and electing which parts of the code would be replaceable:
This is quite easy - sure beats the "olde-fashioned" way I was trying (which would have been okay, had it worked).
All I had to do was right-click the elements of code I wanted to replace on adding a new snippet, set the snippet's shortcut and description properties in Solution Explorer, save it, and voila!
Now mashing Ctrl+K, X in VS shows the snippet in "My Code Snippets" along with its description and shortcut:
Selecting it adds the snippet with the replacement strings highlighted:

Adding Images or Thumbnails to Atom 1.0 Entries

This StackOverflow answer suggests that you should use HTML entry content and use a standard <img> tag to link to your images.
<content type="html">
<![CDATA[
<a href="http://test.lvh.me:3000/listings/341-test-pics?locale=en">
<img alt="test_pic" src="http://test.lvh.me:3000/system/images/20/medium/test_pic.jpg?1343246102" />
</a>
]]>
</content>
I have also found something called the Yahoo media extensions here which allows you to add custom additional elements.
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/">
<!-- ommitted -->
<entry>
<!-- ommitted -->
<media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="path_to_image.jpg" />
</entry>
</feed>
Google also seems to have its own similar extensions. See here.
<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:g="http://base.google.com/ns/1.0">
<!-- ommitted -->
<entry>
<!-- ommitted -->
<g:image_link>http://www.google.com/images/google_sm.gif</g:image_link>
</entry>
</feed>
My own intuition tells me I should simply be able to add links to images like so:
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<!-- ommitted -->
<entry>
<!-- ommitted -->
<link rel="enclosure" type="image/png" length="1337"
href="http://example.org/image.png"/>
</entry>
</feed>
What is the correct approach for maximum compatibility?
The best practice is to do what Wordpress RSS 2.0 feeds do — if you want your post image to appear in feedly for example, put the <p><img...></p> at the top of the content. My eleventy setup has post header image inside article, but outside content variable's contents which are used in the feed. I solve the problem adding the image back:
<item>
...
<content:encoded>
<![CDATA[<p>{% include "src/components/partials/post-hero-img.njk" %}</p>{{ post.templateContent | textDeletePresentationDivs | htmlToAbsoluteUrls(absolutePostUrl) | safe }}]]>
</content:encoded>
source in git
I checked, neither Atom nor RSS 2.0 feeds have post images set anywhere as standalone tags. They're simply at the top of the article's content.
With regards to your examples...
The "vanilla" Atom RSS feed has a schema xmlns="http://www.w3.org/2005/Atom" and its documentation is defined in RFC4287.
According to it, "vanilla" Atom RSS feed strictly can have <logo> which is the 2:1 ratio image, the logo of the feed. Sadly, it is placed in the root of XML (notice atom:logo in the spec, it's not atom:entry:logo). Practically, this means, you can put a picture of your RSS feed itself, but not per-article. If you do put <logo> inside <entry>, the feed won't pass the validators and post image won't appear in feedly (I tried).
Also, spec defines <icon> which is vaguely defined as a small, square image, also placed in the root. Feedly seem to detect the website's favicon anyway, although it doesn't hurt to set this tag up in rss explicitly.
That's all there is — Atom spec doesn't officially define a way how to put images per-article.
Here's where additional namespaces come in (or RSS 2.0, different spec, different XML). You mentioned xmlns:media="http://search.yahoo.com/mrss/" in example. I tried it, post images won't show in feedly. Plus, spec link http://search.yahoo.com/mrss/ is not showing any specs.
Google namespace you quoted, xmlns:g="http://base.google.com/ns/1.0" also doesn't work, post images don't show up in feedly.
The link approach, <link rel="enclosure" type="image/png" length="1337" href="http://example.org/image.png"/> would be promising except length is meant to state the filesize in bytes. In Eleventy that's problematic value to get, for example.
To sum up, the best practice is put post header image at the top of the content, inside <content>.

MvcSiteMapProvider Sub menu within page

I have a web site using MvcSiteMapProvider for the main navigation. I have run into a scenario that I'm unable to figure out.
My site has the following navigation:
The site map looks like:
<?xml version="1.0" encoding="utf-8" ?>
<mvcSiteMap xmlns="http://mvcsitemap.codeplex.com/schemas/MvcSiteMap-File-3.0" enableLocalization="true">
<mvcSiteMapNode title="Look Up" controller="Lookup" action="Index">
<mvcSiteMapNode title="PackingList" controller="PackingList" action="Index">
<mvcSiteMapNode title="Configuration" controller="Configuration" action="Printers">
<mvcSiteMapNode title="Printers" controller="Configuration" action="Printers" />
<mvcSiteMapNode title="Quick List" controller="Configuration" action="QuickList" />
</mvcSiteMapNode>
</mvcSiteMapNode>
</mvcSiteMap>
I have not been able to figure out how to properly leverage the site map for the side tab navigation reliably. I also need to have the Configuration tab remain selected as well as the active side tab.
When two nodes have the same controller and action name, the SiteMapProvider cannot determine which node is active, and it always chooses the first matching node, in this case 'Configuration'.
The only way to make both nodes selected is:
Use a different action of the printers menu
Changed the display template to indicate the nodes in the current path with a CSS class or a like

collective.xdv and multiple theme files

I am having different theme HTML files for different site sections. There are some major layout differences depending if the page is the front page, or a certain subsection.
As far as I see the default behavior is just to have one HTML file:
http://pypi.python.org/pypi/collective.xdv#usage
What would be the best strategy to use multiple theme files, slight rule variations and collective.xdv?
Plone 4.1b.
We usually just utilize plain xdv and use the rules.xml (or whatever you want to call it) file to setup the theme templates leaving the corresponding properties in the collective.xdv controlpanel empty. Nesting rules gives you quite some fexibility when asigning different templates:
<?xml version="1.0" encoding="UTF-8"?>
<rules xmlns="http://namespaces.plone.org/xdv"
xmlns:css="http://namespaces.plone.org/xdv+css"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<theme css:if-content="body.section-front-page" href="frontpage.html" />
<theme css:if-path="/section/subsection/somefolder" href="somefolder.html" />
...
<rules css:if-content="#visual-portal-wrapper">
<!-- The default theme -->
<theme href="theme.html" />
<rules css:if-content="body.section-somefolder">
<!-- Secific rules for somefolder go here -->
...
</rules>
</rules>
You should use the Alternate Themes settings to define alternative layouts when the url matches a specific regular expression.
For example, we have a Plone site named "Plone" and accessible at url localhost:8080/Plone. To provide a different layout for the Home page, we can define the following in the registry (or TTW in the Plone Control Panel > XDV Settings section):
<record field="alternate_themes" interface="collective.xdv.interfaces.ITransformSettings" name="collective.xdv.interfaces.ITransformSettings.alternate_themes">
<field type="plone.registry.field.List">
<description>Define alternate themes and rules files depending on a given path. Should be of a form 'path theme rules' (or 'path rules' with xdv 0.4), where path may use a regular expression syntax, theme is a file path or URL to the theme template and rule is a file path to the rules file.</description>
<required>False</required>
<title>Alternate themes</title>
<value_type type="plone.registry.field.TextLine">
<title>Theme</title>
</value_type>
</field>
<value>
<element>^.*/Plone(/)?$ python://my.xdvtheme/templates/alternative/index.html python://my.xdvtheme/rules/alternative/index-rules.xml</element>
</value>
</record>
This way, the home page will use the alternative layout, while all the other pages will use the main layout specified in Theme template and Rules template
You can provide multiple definitions according to the different sections of your site.
My personal Plone site uses different theme and rules files for different parts.
Are you using the XDV control panel at /##xdv-settings?
In the Theme template and Rules File fields I put my default (i.e most used) files.
In the Alternate Themes textbox you can then provide alternate theme and rules files depending on a given path.
The format is path theme rules.
Here are some examples from my website's config:
.*/login_form|.*logged_out
/home/zope/production/theme/theme.html
/home/zope/production/theme/login.xml
/media/blog$
/home/zope/production/theme/blog.html
/home/zope/production/theme/blog.xml
/media/software
/home/zope/production/theme/software.html
/home/zope/production/theme/media.xml
As you can see, you can use regular expression syntax to match the paths.
The first line is for styling the login and logout pages.
The second for styling only my blog's landing page (henche the $)
the third styles my software page.
Works like a charm.

Resources