Category Attribute - Text
Dear MDM Experts,
I want to import a quite long text into a Category Attribute, but when I do the mapping in the Import Manager, the message says that the imported text is too long, and it will be cutted to 128 character.
Is there any solution for this problem? Can I change the type of this Category Attribute to Large Text, as it is possible by Fields in Console?
thanks,
Ádá
Hi Adam,
I have done a quick explore on this context and would like to share some information.
1. The Taxonomy metadata like Name,Alias,Definition of Attribute not physically present in the Console ( up to my knowledge ) - so it hard to change the data types...either we have to go with 128 or split the actual text into Name and Alias.
2. Even Data manager import also not supporting the Definition import since its not recognized field by MDM..
eagar to know what other experts says ....
thanks
Alexander
Similar Messages
-
Not able to import Attribute Text Values in Taxonomy table
Hi Experts,
I have an excel file with 54K records of Attribute text values need to import in to taxonomy table. my excel file has 3 fields like ID, Name, Text Values. While mapping the fields in feild mapping grid, I have mapped ID field with Attribute Alias, Name with Attribute name, Text Value with Text Value and clone field of Text Value with [Text Value Remote Key]. Based on the field mapping I was trying to map values for ID filed with Attribute Alias field. Here I found Attribute Alias field has values in destination grid which were imported before for Attribute Name ID's in to the Alias field for attribute names.
Here I found these values are different when I tried to map these values and the Value map buttons(Automap/Map/Add) were disabled.
in the same way I tried with out maping the values for Attribute value id and selected the Attribute Alias field as value mapping field. but here in the import actions tab the records are active and disabled the import action option.
so I have executed the import process, but no attribute text values were imported in to Taxonomy table.
I am using the MDM 7.1 with build version 7.1.01.46.
Please let me know if anyone came across this situation.
Thanks,
RDNPrasadproblem solved
-
Category attributes default values updating
Hi,
I'm developing an application that, upon upload of a file to the specified root folder(through the application), reads some values from a file, creates a folder structure based on those values, and moves the file in the bottom folder. Now, a predefined category should be attached to the file, to enable search by category attributes. My idea is to set the category as required on that bottom folder (or the first), and modify it's attribute default values, so that the file inherits them when moved in it. I have found mshannon's examples in some other thread ( Updating a document with category metadata using updateDocument(): error! ), the first one works only with files, not folders, and the second one doesn't work for me at all, I get an error:
javax.faces.el.EvaluationException: ORACLE.FDK.AggregateError:ORACLE.FDK.AggregateError
here is my code:
public static void updateAttributes() throws FdkException, RemoteException{
login();
FileManager fm = s_WsCon.getFileManager();
Item fajl = fm.resolvePath(prop.getProperty("userhome") + "/root folder/folder1/readme1.txt",
null);
long docID = fajl.getId();
NamedValue[] catInstAtr = new NamedValue[] {
new NamedValue("CUSTOM_138297", "changed value for att1"),
new NamedValue("CUSTOM_138299", "changed value for att2")
NamedValue[] catDef = new NamedValue[] {
new NamedValue(Options.UPDATE_CATEGORY_ID,new Long(139054)),
new NamedValue(Options.CATEGORY_DEFINITION_ATTRIBUTES, catInstAtr)
NamedValue[] docDef = new NamedValue[] {
new NamedValue(Options.CATEGORY_DEFINITION, catDef)
AttributeRequest[] reqAtr = new AttributeRequest[]{
new AttributeRequest(Attributes.DESCRIPTION, null)
fajl = fm.updateDocument(docID, docDef, reqAtr);
logut();
This example is (I think) only for updating on document level, but I could use a solution for folder-level updating, as I explained before. Can anyone help me?
Thanks,
PedjaPedja,
Here is my code to get category from Folder this is updated version from sample code TestCategory2.java
1. It will get the required category of a folder.
2. gets the internal category attribute names
3. get Category id if uploading file along with category attribute values OR
updating file and also updating previous category instance values..
package oracle.ifs.examples.content.testcases;
import java.util.Map;
import java.util.Properties;
import java.util.*;
// Facade Objects
import oracle.ifs.fdk.AttributeRequest;
import oracle.ifs.fdk.Attributes;
import oracle.ifs.fdk.FdkConstants;
import oracle.ifs.fdk.FdkErrorCodes;
import oracle.ifs.fdk.FdkException;
import oracle.ifs.fdk.FdkExceptionEntry;
import oracle.ifs.fdk.Item;
import oracle.ifs.fdk.Options;
import oracle.ifs.fdk.NamedValue;
import oracle.ifs.fdk.NamedValueSet;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import HTTPClient.HTTPConnection;
import HTTPClient.HTTPResponse;
import HTTPClient.HttpOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.URL;
// Web Services Managers
import oracle.ifs.fdk.CategoryManager;
import oracle.ifs.fdk.CommonManager;
import oracle.ifs.fdk.FileManager;
// Framework
import oracle.ifs.examples.content.fdk.FdkSession;
import oracle.ifs.examples.content.fdk.FdkUtils;
import oracle.ifs.examples.content.fdk.Managers;
import oracle.ifs.examples.content.fdk.constants.ItemAttributes;
import oracle.ifs.examples.content.fdk.constants.NamedValueConstants;
import oracle.ifs.examples.content.testcases.AbstractTest;
public class TestCategories3
implements ItemAttributes, NamedValueConstants
public TestCategories3()
public static void main(String[] args)
TestCategories3 tc3= new TestCategories3();
tc3.getCatinfo();
* This is where you write your test program.
public void getCatinfo()
log(this.getClass().getName()+": starting");
FdkSession session = null;
try
AttributeRequest[] requestedAttributes = null;
NamedValue[] sortOptions = null;
Map returnedAttrs = null, map = null;
log("\nAuthenticating as regular test user ...");
session = new FdkSession("http://xxx.com:8320/content/","anakkala","sample");
CommonManager commonM = Managers.getCommonManager(session);
CategoryManager categoryM = Managers.getCategoryManager(session);
FileManager fileM = Managers.getFileManager(session);
// save this attribute request so that it can be used later
AttributeRequest[] AR_CATEGORY_CONFIGURATION_ATTRIBUTES =
FdkUtils.newAttributeRequestArray(Attributes.CATEGORY_CONFIGURATION,
FdkUtils.newAttributeRequestArray(new Object[]
// Is the category configuration enabled
FdkUtils.newAttributeRequest(Attributes.CONFIGURATION_ENABLED),
// Can the category configuration be overridden or is it final
FdkUtils.newAttributeRequest(Attributes.CONFIGURATION_FINAL),
// What are the required categories for the category configuration
FdkUtils.newAttributeRequest(Attributes.REQUIRED_CATEGORIES,
// for the required categories ...
FdkUtils.newAttributeRequestArray(new Object[]
// What is the category classobject display name
FdkUtils.newAttributeRequest(Attributes.DISPLAY_NAME),
// get attributes inherited and introduced by category object
FdkUtils.newAttributeRequest(Attributes.METADATA_ATTRIBUTES,
// get full settings for each of these attributes
FdkUtils.newAttributeRequestArray(METADATA_ATTRIBUTE_ATTRIBUTES)
// Are there any attribute overrides for this category config?
FdkUtils.newAttributeRequest(Attributes.ATTRIBUTE_OVERRIDES,
// get full settings for each of these attribute overrides
FdkUtils.newAttributeRequestArray(ATTRIBUTE_OVERRIDE_ATTRIBUTES))
log("\nLooking up folder /d-rco/C1/L1/folder1 ...");
// convert attribute request map to AttributeRequest[]
requestedAttributes = AR_CATEGORY_CONFIGURATION_ATTRIBUTES;
Item folder =fileM.resolvePath(
"/d-rco/C1/L1/folder1",
requestedAttributes);
log("folder id is="+folder.getId());
log("\nProcessing requested attributes - goal: generate override ...");
//returns a map
returnedAttrs = FdkUtils.getAttributesMap(folder);
Item categoryConfig = (Item)
returnedAttrs.get(Attributes.CATEGORY_CONFIGURATION);
returnedAttrs = FdkUtils.getAttributesMap(categoryConfig);
// is CategoryConfiguration enabled?
Boolean ccEnabled = (Boolean) returnedAttrs.
get(Attributes.CONFIGURATION_ENABLED);
// is CategoryConfiguration final? false=subfolders can override
Boolean ccFinal = (Boolean) returnedAttrs.
get(Attributes.CONFIGURATION_FINAL);
// what are the attribute overrides for this category configuration
log("\nAttribute overrides ...");
Item[] attributeOverrides = (Item[]) returnedAttrs.
get(Attributes.ATTRIBUTE_OVERRIDES);
FdkUtils.log(attributeOverrides);
// what are the requred categories for this category configuration
log("\nRequired categories ...");
Item[] reqCategories = (Item[]) returnedAttrs.get(Attributes.REQUIRED_CATEGORIES);
FdkUtils.log(reqCategories);
log("After printing required categories");
if(ccEnabled.booleanValue() && !ccFinal.booleanValue()
&& reqCategories != null && reqCategories.length >= 1)
// Folder /<domain>/<basecontainer>/L1/F3.EC has an enabled category
// configuration that can be overridden and has required categories
// present ...
Item category = null;
for (int i=0; i < reqCategories.length; i++)
returnedAttrs = FdkUtils.getAttributesMap(reqCategories);
log( "xxx name="+((String) returnedAttrs.get(Attributes.DISPLAY_NAME) ));
if ( ((String) returnedAttrs.get(Attributes.DISPLAY_NAME)).
equals("BG_Serv_Req"))
category = reqCategories[i];
break;
log("category id="+category.getId());
if (category != null)
NamedValue[] internalCategoryAttrs = null;
try {
internalCategoryAttrs =getInternalCategoryAttrNames("BG_Serv_Req",session);
}catch(Exception e)
log("error getting internal names");
e.printStackTrace();
log("Category Attribute internal Name ="+ (String)internalCategoryAttrs[0].getValue());
log("Category Attribute internal Name ="+ (String)internalCategoryAttrs[1].getValue());
NamedValue[] categoryInstanceAttributes = new NamedValue[] {
// use the internal attribute name for all attributes
new NamedValue((String)internalCategoryAttrs[0].getValue(), "XNXNXNXN 234"),
new NamedValue((String)internalCategoryAttrs[1].getValue(), "SNKKSKSK 1234")
NamedValue[] categoryDef = new NamedValue[] {
// the id of the category object class for which this new category will be an
//instance of
new NamedValue(Options.CATEGORY_CLASS_ID, new Long(category.getId())),
// the updated values of the category instance
new NamedValue(Options.CATEGORY_DEFINITION_ATTRIBUTES, categoryInstanceAttributes)
String sourceFile="test.doc";
String folderPath = "C:\\upload";
requestedAttributes = FdkUtils.newAttributeRequestArray(Attributes.URL);
Item doc = fileM.resolveRelativePath(folder.getId(),sourceFile, requestedAttributes);
log("START ORACLE TEST CODE FROM TAR");
// this will get the category instance id
AttributeRequest categoryAR = new AttributeRequest();
categoryAR.setAttributeName(Attributes.CATEGORIES);
AttributeRequest[] attrRequests = new AttributeRequest[]
{ categoryAR};
Item myDoc = commonM.getItem(doc.getId(), attrRequests);
NamedValue[] requestedAttributesNV = myDoc.getRequestedAttributes();
int length = requestedAttributesNV == null ? 0 :
requestedAttributesNV.length;
Item[] itemCategories = null;
log("length="+length);
for (int i = 0; i < length; i++)
log("requestedAttributesNV[i].getName()="+requestedAttributesNV[i].getName());
if(requestedAttributesNV[i].getName().equals(Attributes.CATEGORIES))
itemCategories = (Item[]) requestedAttributesNV[i].getValue();
length = itemCategories == null ? 0 : itemCategories.length;
log("length="+length);
long categoryInstanceId = 0;
for (int i = 0; i < length; i++)
log("Category instance " + itemCategories[i].getName() + " has id " +
itemCategories[i].getId());
categoryInstanceId = itemCategories[i].getId();
log("END ORACLE TEST CODE FROM TAR");
/* If the document does not exist in OCS */
if (doc == null) {
requestedAttributes = FdkUtils.newAttributeRequestArray(Attributes.URL);
NamedValue[] nvdoc = FdkUtils.newNamedValueArray(
new Object[][] { { Attributes.NAME,sourceFile} }
Item def = fileM.createDocumentDefinition(nvdoc,requestedAttributes);
int uploadStatusCode = uploadContent(
session,
getSampleFileStream(sourceFile,folderPath),
(String) FdkUtils.getAttribute(def,Attributes.URL)
log("Upload Status to definition file: "+uploadStatusCode);
nvdoc = FdkUtils.newNamedValueArray(
new Object[][]
{ Attributes.NAME,sourceFile},
{ Options.USE_SAVED_DEFINITION, new Long(def.getId())},
{ Options.DESTFOLDER, new Long(folder.getId()) },
// apply category instance informationnew
{ Options.CATEGORY_DEFINITION, categoryDef }
requestedAttributes = FdkUtils.newAttributeRequestArray(Attributes.URL);
doc = fileM.createDocument(nvdoc,null,requestedAttributes);
}else /* if document already exist in OCS */
log(sourceFile+" file exists so updating ...");
int uploadStatusCode = uploadContent(
session,
getSampleFileStream(sourceFile,folderPath),
(String) FdkUtils.getAttribute(doc ,Attributes.URL)
log("uploadStatusCode="+uploadStatusCode);
FileInputStream fi= getSampleFileStream(sourceFile,folderPath);
log("category id using in update="+ category.getId());
NamedValue[] updatecatdef = new NamedValue[] {
//new NamedValue(Options.UPDATE_CATEGORY_ID, new Long(category.getId())),
new NamedValue(Options.UPDATE_CATEGORY_ID, new Long(categoryInstanceId)),
new NamedValue(Options.CATEGORY_DEFINITION_ATTRIBUTES,
new NamedValue[] {
new NamedValue((String)internalCategoryAttrs[0].getValue(), "AH234 V2"),
new NamedValue((String)internalCategoryAttrs[1].getValue(), "SNHGZ12 V2")
NamedValue[] nv = FdkUtils.newNamedValueArray(
new Object[][]
{ Attributes.NAME,sourceFile},
{ Attributes.DESCRIPTION,"Sample file"},
//{Options.CONTENTSTREAM, fi},
{ Options.CATEGORY_DEFINITION, updatecatdef }//Newly added for category upload
requestedAttributes = FdkUtils.newAttributeRequestArray(Attributes.URL);
// THIS IS WHERE WE ARE GETTING ERROR
fileM.updateDocument(doc.getId(),nv,requestedAttributes);
System.out.println("doc = fm.updateDocument is complete ........." );
} // end if (Document Confidentiality category present)
} // end if category configuration enabled / overridable etc
catch (FdkException fe)
FdkUtils.log(fe);
fe.printStackTrace();
catch (Exception e)
// java.net.MalformedURLException;
// java.rmi.RemoteException;
// javax.xml.rpc.ServiceException;
// org.apache.axis.AxisFault
log("Fatal exception occurred in run():");
e.printStackTrace();
finally
if (session != null)
session.disconnect();
log("\n"+this.getClass().getName()+": ending");
private FileInputStream getSampleFileStream(String filename,String path)
throws FileNotFoundException
FileInputStream stream = null;
if (filename != null && filename.length() >= 1)
if (path.length() >=1 && !path.endsWith("/"))
path += "/";
stream = new FileInputStream(new File(path+filename));
return stream;
public int uploadContent(
FdkSession session,
InputStream inputStream,
String destinationURL
throws Exception
int statusCode = -1;
if (inputStream == null) return statusCode;
HTTPConnection conn = null;
try
URL url = new URL(destinationURL);
conn = session.getHttpConnection(url);
byte[] buffer = new byte[8192];
int count=0;
HttpOutputStream outputStream = new HttpOutputStream();
HTTPResponse response = conn.Put(url.getFile(), outputStream);
try
while ((count = inputStream.read(buffer)) != -1)
outputStream.write(buffer, 0, count);
finally
outputStream.flush();
outputStream.close();
statusCode = response.getStatusCode();
finally
if (inputStream != null)
inputStream.close();
if (conn != null)
conn.stop();
conn = null;
return statusCode;
// Handle the response. Note that a successful response may not be
// 200, but may also be 201 Created, 204 No Content or any of the other
// 2xx range responses.
public void log(String s)
System.out.println(s);
public NamedValue[] getInternalCategoryAttrNames(String categoryName,FdkSession session) throws Exception
NamedValue[] returnNV = null;
Map attmap = new HashMap();
attmap.put(Attributes.METADATA_ATTRIBUTES,
FdkUtils.newAttributeRequestArray(
new String[] { Attributes.ATTRIBUTE_NAME,
Attributes.DISPLAY_NAME }));
AttributeRequest[] request = FdkUtils.getAttributeRequestArray(attmap);
Item cat = FdkUtils.getCategoryObject(session, null, categoryName, request);
log("inside method cat id="+cat.getId());
/** ANAKKALA START **/
NamedValue[] catNV = cat.getRequestedAttributes();
if( catNV != null && catNV.length >0)
for (int i=0; i<catNV.length; i++)
if(catNV[i].getName().equals("METADATA_ATTRIBUTES"))
//log("** CatNV.getName="+catNV[i].getName()+" value="+catNV[i].getValue());
Item[] meta = (Item[]) catNV[i].getValue();
log("meta length="+meta.length);
returnNV = new NamedValue[meta.length];
for (int j=0; j<meta.length; j++)
log("--Item getname="+meta[j].getName()+" value="+meta[j].getId()+" gettype="+meta[j].getType()+" gettypedesc="+meta[j].getTypeDesc());
returnNV[j] = new NamedValue(meta[j].getName(),meta[j].getName());
NamedValue[] metaNV = meta[j].getRequestedAttributes();
log("---metaNV length="+metaNV.length);
for(int k=0; k<metaNV.length; k++)
log("------metaNV.getName="+metaNV[k].getName()+" value="+metaNV[k].getValue());
/** ANAKKALA END **/
//NamedValue[] ret = null;
return returnNV; -
Can we update the Category attribute values of a file
Can we update the Category attibute values of a file with out checkout the file?
I have set the version configuration to folder and try to update the category attribute values of a file under that folder,
It is asking to checkout the file before modifying the category attibute values.
Is it required to checkout the file before modifying the category attribute values of that file?
Is there any way to update the category attribute values without checkout the file?
Please help on thisOne of the ways i can think of is using Batch Loader script for large number of files. Mention such files in Batch Loader script, and it will update category and all meta-data required in terms of next revision.
In case number of files are less manual checkout and check-in will help. -
ALERT Category Lont Text (email) fomatting
I have Alert Management configured to send an email alert correctly. I need some formatting for the email and therefore I choose to edit the alert category long text using SO10 ( remembering that the Text-id is ALRT ). while editing the Alert's Long Text using SO10, I add bolding, paragraph formatting and some IF statement as I would in a sapscipt for as commands. Print Preview of the newly updated standard text ( example used ALRTFRMWRKTESTL for SAP supplied alert category ASRTFRMWRKTEST ) show the formatting looks great, but when we triger the alert and view the correponding email based on this long text, we find the formatting is lost. Is there a way to hae the formatting show in the email?
Hello,
I Think you are able to send the email with HTML tags.
You can also use the famous FM ZOUTLOOK to send email with the format you want, but you can only do it with you oulook client.
hope this helps
Gabriel -
Modifying Category Attributes without bumping the version of a versioned do
Hi,
I was wondering if anybody knows how I can make a change to a document's category attributes without having the document bump up a version.
I have an Event Handler that detects specific events where I am required to change a couple of attribute values.
The document itself could have versioning turned on explicitly or it could have inherited the feature via the folder. Either way, I'd like to shut down the versioning for a moment, make the change and re-set it to normal operation.
Thanks
WinstonHi Winston,
Once the file is under version control and checked-in, there is no way to make a subsequent change(s) without causing a new version to be created.
One option you could do from your event handler after changing the metadata (which causes a new version to be created), is to remove the old version, then look to update the new version's creator/lastmodifier with the old version's details.
As the code above may likely re-trigger your event handler, you may need to some how flag the file (using metadata) so as to be able to determine whether the new version resulted from the event handler rather than end-user so as to be able to skip processing. -
Attribute Texts in Decision Report
Hi OPA Experts,
We have multiple test forms in our project which have same/similar field. Eg. the field "Common" is spread across multiple test forms. So, during our build we had to make each attribute text unique by prefixing them with the test form name, since system does not allow duplicate attribute text. Now, when we look at the Decision Report, we see <Test Form Name>_Common instead of the screen display text.
Is there a way to overcome this issue, or is there any work-around?
If multiple attributes exist across different properties, with the same text, Build itself fails. And we cannot even Build & Debug nor Build & Run.
Regards,
Suan.Yes - you can add the attribute to your properties file and then click the Override button to override the text that appears in your decision report. That said, this is not recommended! It will make your decision report very difficult to use for debugging - your attributes have different texts because they have different proofs (otherwise you wouldn't need different attributes) so if you remove the unique part of the attribute text you will find it difficult to know which attribute you are seeing in your decision report.
Think about why you have a decision report - do you use it to understand the operation of the rules or do you show it to your end users? If you are using it to understand your rules I certainly wouldn't be overriding the attribute text (for the reasons above). If you are showing it to an end user, perhaps you could represent the information in another, more succinct way (eg using summary screen labels which show/hide as appropriate or put the information in a generated document). Don't forget you can always just hide attributes in the decision report by setting them to Invisible (hides the attribute itself) or Silent (hides the proof) - to do this, add your attribute to your properties file and select the 'Decision Reports' tab. If you make an attribute Silent or Invisible you can still see it in the debugger, but it won't show to your end users (best of both worlds!).
Hope that helps,
Fiona -
HTML in Alert Category Long Text?
Hi All,
Can I include HTML in the Alert Category Long Text and have it show in the alert email that's sent out?
Thanks,
J WolffI donot think this would be possible...but i maybe wrong...
The reason is that the content type set by the alerting framework for the mail that it sends is "text/plain", so even if you have html tags it would just be interpreted as plain text only...
If by some chance we can set the alerting framework to send emails with a content type "text/html"..then it would be possible..
Thanks,
Renjith -
How to check hierarchies,attribute ,text
Bw 3.x system is there any way to check
how many hierarchies,attribute,text available in the system in active stat
Edited by: nam2000ind on Jun 11, 2008 2:42 PMOk...Thanks...
But Can you tell me how to find how many characteristis
defined with master data -
Need Attribute Text instead of public name in Siebel
Hi Experts,
Is it possible in OPA to send across attribute text instead of public name / attributeName in the "SaveSession" inbound interface to Siebel application?
Thanks,
VinayVinay,
Unforunately SaveSession only saves the attributes and their values. The text of an attribute cannot be saved.
If you really need the attribute text, you would probably have to use some custom code to do the following:
1. Create a text attribute (a2) that will hold the text of the attribute you want the text for (a1):
2. Create a event handler that sets the value of the text attribute (a2) to the text of the attribute (a1).
3. When save is called the text attribute (a2) will be saved to the session.
Its no a very elegant solution, but its the only way I can think of to do it.
Cheers
Frank -
CRM Item Category for Text Sales Order
Hi,
we are using SAP CRM 6.0 and I am looking for a way to define a transaction item type in a way that I can create a standard sales order with a text item (no material number).
In ECC, I would choose item type B="text" (e.g. item category TATX), however I couldn't find any similar category in CRM.
Can you give me any ideas?
Thanks
AnkeHi Anke,
You can create an item category which has item category BUS2000128- Text item.
Regards,
Shalini Chauhan -
Maintain Free Texts as Attribute Text Values
Hi Friends,
Is there a way to maintain random text values in an MDM Taxonomy Attribute. I understand that Attributes are designed to handle pre-defined values, but do we have a work-around to maintain free texts as Attribute Text Values.
Any help would be appreciated.
Regards,
Anil MadhavanHi Anil
To add- we can also define new values from Data manager in record mode. Suppose we have attribute Nationality with text values maintained as Indian and German. While editing/creating a record in Data manager we need to enter a new value as Chinese this can be done by right clicking on attribute value cell and select Modify text attribute value list.
This way we can add new values on ad hoc basis.
hope this helps-
Ravi -
Updating category attribute (metadata) value
How do you update the value of a category attribute ?
For exemple, I have a document x with a category myCat with an attribute myAttr.
I want to change the value of myAttr once in a while. Is this possible?
How can I update that value ?
ThanksHi,
With removing category(using the categoryManager.deleteCategory) and reassigning the updated category attribute back to the document using (filemanager.UpdateDocument), this can be achive,
Have you worked out any other way?
Regards, -
Get Folder Content with category attributes
Hi Gurus,
I want to get all documents of a folder with few custom category attributes values.
How can I query this?
Thanks
JOYes, you make a SearchExpression tree that holds all your attributes and values to compare them to. Here is something I used for a category with 7 attributes:
AttributeRequest[] ar = new AttributeRequest[]{
new AttributeRequest(Attributes.CLASS_NAME, null),
new AttributeRequest(Attributes.METADATA_ATTRIBUTES, new AttributeRequest[]{
new AttributeRequest(Attributes.ATTRIBUTE_NAME, null),
new AttributeRequest(Attributes.DISPLAY_NAME, null)
NamedValue[] SEARCH_INCLUDES_VERSIONHISTORY = new NamedValue[] {
new NamedValue(Options.SEARCH_VERSION_HISTORY,Boolean.TRUE)
NamedValue[] PRI_SORT_NAME_ASC = new NamedValue[] {
new NamedValue(Options.PRIMARY_SORT_ATTRIBUTE,Attributes.NAME),
new NamedValue(Options.PRIMARY_SORT_DIRECTION,Boolean.TRUE) // asc
NamedValue[] options = (NamedValue[])FdkUtils.combineArrays(PRI_SORT_NAME_ASC, SEARCH_INCLUDES_VERSIONHISTORY);
AttributeRequest[] reqAtr1 = new AttributeRequest[]{
new AttributeRequest(Attributes.CATEGORIES, new AttributeRequest[]{
new AttributeRequest(Attributes.CUSTOM_ALL, null),
new AttributeRequest(Attributes.CATEGORY_CLASS_OBJECT, null) }),
new AttributeRequest(Attributes.PATH, null),
new AttributeRequest(Attributes.URL, null)
Item kat = FdkUtils.getCategoryObject(s_WsCon, null, "DICOM", ar);
String className = (String)FdkUtils.getAttribute(kat, Attributes.CLASS_NAME);
String atr1 = FdkUtils.getAttributeNameFromDisplayName(s_WsCon, kat.getId(), "Ime pacijenta");
String atr2 = FdkUtils.getAttributeNameFromDisplayName(s_WsCon, kat.getId(), "ID pacijenta");
String atr3 = FdkUtils.getAttributeNameFromDisplayName(s_WsCon, kat.getId(), "Ime per doktora");
String atr4 = FdkUtils.getAttributeNameFromDisplayName(s_WsCon, kat.getId(), "Ime ref doktora");
String atr5 = FdkUtils.getAttributeNameFromDisplayName(s_WsCon, kat.getId(), "ID studije");
String atr6 = FdkUtils.getAttributeNameFromDisplayName(s_WsCon, kat.getId(), "Opis studije");
String atr7 = FdkUtils.getAttributeNameFromDisplayName(s_WsCon, kat.getId(), "Datum studije");
String atr1Operand = "[" + className + FdkConstants.SEPARATOR + atr1 + "]";
String atr2Operand = "[" + className + FdkConstants.SEPARATOR + atr2 + "]";
String atr3Operand = "[" + className + FdkConstants.SEPARATOR + atr3 + "]";
String atr4Operand = "[" + className + FdkConstants.SEPARATOR + atr4 + "]";
String atr5Operand = "[" + className + FdkConstants.SEPARATOR + atr5 + "]";
String atr6Operand = "[" + className + FdkConstants.SEPARATOR + atr6 + "]";
String atr7Operand = "[" + className + FdkConstants.SEPARATOR + atr7 + "]";
SearchManager sem = s_WsCon.getSearchManager();
SearchExpression seExp1 = new SearchExpression();
seExp1.setOperator(FdkConstants.OPERATOR_EQUAL);
seExp1.setLeftOperand(atr1Operand);
seExp1.setRightOperand(imePac);
SearchExpression seExp2 = new SearchExpression();
seExp2.setOperator(FdkConstants.OPERATOR_EQUAL);
seExp2.setLeftOperand(atr2Operand);
seExp2.setRightOperand(IDPac);
SearchExpression seExp3 = new SearchExpression();
seExp3.setOperator(FdkConstants.OPERATOR_EQUAL);
seExp3.setLeftOperand(atr3Operand);
seExp3.setRightOperand(imePerDok);
SearchExpression seExp4 = new SearchExpression();
seExp4.setOperator(FdkConstants.OPERATOR_EQUAL);
seExp4.setLeftOperand(atr4Operand);
seExp4.setRightOperand(imeRefDok);
SearchExpression seExp5 = new SearchExpression();
seExp5.setOperator(FdkConstants.OPERATOR_EQUAL);
seExp5.setLeftOperand(atr5Operand);
seExp5.setRightOperand(IDStud);
SearchExpression seExp6 = new SearchExpression();
seExp6.setOperator(FdkConstants.OPERATOR_EQUAL);
seExp6.setLeftOperand(atr6Operand);
seExp6.setRightOperand(opisStud);
SearchExpression seExp7 = new SearchExpression();
seExp7.setOperator(FdkConstants.OPERATOR_EQUAL);
seExp7.setLeftOperand(atr7Operand);
seExp7.setRightOperand(datStud);
SearchExpression seExp8 = new SearchExpression();
seExp8.setOperator(FdkConstants.OPERATOR_AND);
seExp8.setLeftOperand(seExp1);
seExp8.setRightOperand(seExp2);
SearchExpression seExp9 = new SearchExpression();
seExp9.setOperator(FdkConstants.OPERATOR_OR);
seExp9.setLeftOperand(seExp3);
seExp9.setRightOperand(seExp4);
SearchExpression seExp10 = new SearchExpression();
seExp10.setOperator(FdkConstants.OPERATOR_AND);
seExp10.setLeftOperand(seExp5);
seExp10.setRightOperand(seExp6);
SearchExpression seExp11 = new SearchExpression();
seExp11.setOperator(FdkConstants.OPERATOR_AND);
seExp11.setLeftOperand(seExp8);
seExp11.setRightOperand(seExp9);
SearchExpression seExp12 = new SearchExpression();
seExp12.setOperator(FdkConstants.OPERATOR_AND);
seExp12.setLeftOperand(seExp10);
seExp12.setRightOperand(seExp7);
SearchExpression seExp = new SearchExpression();
seExp.setOperator(FdkConstants.OPERATOR_AND);
seExp.setLeftOperand(seExp11);
seExp.setRightOperand(seExp12);
NamedValue[] result = sem.search(seExp, options, reqAtr1);
NamedValue[] nvRezultat = null;Hope this helps!
Pedja -
Hi,
I have a question, Can we load attributes texts separatetly?thankU
This is what I too thought but was a little bit confused.
Maybe you are looking for
-
How do you transfer iTunes music from one account to another on the same computer??
i am having issues trying to copy some of my music from my itunes library to my wife's. we each have seperate accounts on the same computer(mac mini, os X). i am new to using the mac's, and have no idea of how to go about this. i have seen some stuff
-
In eBay, I was trying to upload pictures when I got this message: "You need the latest version of Adobe Flash Player to use the standard picture uploader. Download and install the latest version from Adobe before continuing." In YouTube, when trying
-
Regarding Set_item_property
Hi all, I am working on forms 10g. I have a radio group item and another is a text item. When i select redio button YES then that text item should enable and also value required . If it is NO the disable and value not required . I have written on WHE
-
I tried to create a button on report to display the picture of the current emp record .But i couldn't make ...can someone tell me the correct steps i have to follow ? Thanks in advance
-
Default values for Select options
Hi All, I want to have default values X0 and ND for a select-options field.how can i get the same? Thanks, Rakesh.