Updating a document with category metadata using updateDocument(): error!

I have studied the sample code and the API docs, and I feel pretty sure I am coding it according to the docs, but I cannot successfully update a document with category metadata. I always get a MetaDataSchemaInvalid exception.
My process goes like this:
1. Upload a new file, creating a new document publicobject.
2. Create a CATEGORY_DEFINITION with all the metadata name/value pairs I wish to write.
3. Call FileManager.updateDocument() with this CATEGORY_DEFINITION.
My process differs from the docs in that I am first uploading the document, and then adding the metadata as a second step. I want to get it working this way to make my system more modular. I do not want to make my upload method dependent upon metadata attributes, and vice versa.
Step 1 is working fine. The document is being uploaded to the right folder. Good to go.
Step 3 is where I get the error. If the error is my fault, then it must be a result of what I do in step 2. The structure of my CATEGORY_DEFINITION must be messed up.
Here is my code for creating the CATEGORY_DEFINITION. The Document class is my own entity that encapsulates the binary data for a document, as well as the metadata attributes that are to be assigned to the document once it is uploaded into Content Services. We don't need to worry about where the data comes from. Just assume the raw data is correct.
public NamedValue[] newCategoryAttributeDefinition(Document document, String categoryDisplayName) throws WebserviceClientException {
/* Get the category attribute name-value pairs as a 2-D array. */
Map metadataMap = document.getMetadataParser().getAttributeNameMapping();
List categoryDefinitionAttributeList = new ArrayList();
for(Iterator i = metadataMap.entrySet().iterator(); i.hasNext();) {
Map.Entry entry = (Map.Entry)i.next();
String name = "CUSTOM_" + (String)entry.getKey();
Object value = entry.getValue();
if(value != null) {
categoryDefinitionAttributeList.add(new Object[] { name, value });
Object[][] categoryDefinitionAttributeArray = new Object[categoryDefinitionAttributeList.size()][];
int index = 0;
for(Iterator i = categoryDefinitionAttributeList.iterator(); i.hasNext();) {
Object[] value = (Object[])i.next();
categoryDefinitionAttributeArray[index++] = value;
/* Create the NamedValue tree that describes this category's attribute values. */
Long categoryId = new Long(getCategoryClassId(categoryDisplayName));
NamedValue[] categoryAttributeDefinition = WebserviceUtils.newNamedValueArray(new Object[][] {
{ Options.CATEGORY_ID, categoryId },
{ Options.CATEGORY_DEFINITION_ATTRIBUTES, WebserviceUtils.newNamedValueArray(categoryDefinitionAttributeArray) }
NamedValue[] categoryDefinition = WebserviceUtils.newNamedValueArray(Options.CATEGORY_DEFINITION, categoryAttributeDefinition);
return categoryDefinition;
And below is the resulting CATEGORY_DEFINITION, as seen in a jdb debugger.
-- The OPT.CATEGORY_ID value is equal to the ID column in ODMV_SCHEMACATEGORY, otherwise known as the category class id.
-- My OPT.CATEGORY_DEFINITION_ATTRIBUTES tree for this document has the 4 attributes that I want to set. The category has more than these 4 attributes; I am not populating every attribute. None of the attributes are required, and all are editable. I don't need to include every attribute in my CATEGORY_DEFINITION, even if the values are null, do I? Also, all the attribute names start with "CUSTOM_", which I believe is necessary - right?
-- I am setting only the OPT.CATEGORY_ID and OPT.CATEGORY_DEFINITION_ATTRIBUTES. Am I missing some other required attribute?
http-8888-Processor5[1] http-8888-Processor5[1] dump categoryDefinition
categoryDefinition = {
instance of oracle.ifs.fdk.NamedValue(id=2562)
http-8888-Processor5[1] dump categoryDefinition[0]
categoryDefinition[0] = {
name: "OPT.CATEGORY_DEFINITION"
value: instance of oracle.ifs.fdk.NamedValue[2] (id=2559)
__equalsCalc: null
__hashCodeCalc: false
typeDesc: instance of org.apache.axis.description.TypeDesc(id=2564)
class$oracle$ifs$fdk$NamedValue: instance of java.lang.Class(reflected class=oracle.ifs.fdk.NamedValue, id=1975)
http-8888-Processor5[1] dump categoryDefinition[0].value[0]
categoryDefinition[0].value[0] = {
name: "OPT.CATEGORY_ID"
value: instance of java.lang.Long(id=2558)
__equalsCalc: null
__hashCodeCalc: false
typeDesc: instance of org.apache.axis.description.TypeDesc(id=2564)
class$oracle$ifs$fdk$NamedValue: instance of java.lang.Class(reflected class=oracle.ifs.fdk.NamedValue, id=1975)
http-8888-Processor5[1] dump categoryDefinition[0].value[0].value.toString()
categoryDefinition[0].value[0].value.toString() = "60068"
http-8888-Processor5[1] dump categoryDefinition[0].value[1]
categoryDefinition[0].value[1] = {
name: "OPT.CATEGORY_DEFINITION_ATTRIBUTES"
value: instance of oracle.ifs.fdk.NamedValue[4] (id=2570)
__equalsCalc: null
__hashCodeCalc: false
typeDesc: instance of org.apache.axis.description.TypeDesc(id=2564)
class$oracle$ifs$fdk$NamedValue: instance of java.lang.Class(reflected class=oracle.ifs.fdk.NamedValue, id=1975)
http-8888-Processor5[1] dump categoryDefinition[0].value[1].value[0]
categoryDefinition[0].value[1].value[0] = {
name: "CUSTOM_From"
value: "SA"
__equalsCalc: null
__hashCodeCalc: false
typeDesc: instance of org.apache.axis.description.TypeDesc(id=2564)
class$oracle$ifs$fdk$NamedValue: instance of java.lang.Class(reflected class=oracle.ifs.fdk.NamedValue, id=1975)
http-8888-Processor5[1] dump categoryDefinition[0].value[1].value[1]
categoryDefinition[0].value[1].value[1] = {
name: "CUSTOM_Footer Number"
value: "PRM 34-318"
__equalsCalc: null
__hashCodeCalc: false
typeDesc: instance of org.apache.axis.description.TypeDesc(id=2564)
class$oracle$ifs$fdk$NamedValue: instance of java.lang.Class(reflected class=oracle.ifs.fdk.NamedValue, id=1975)
http-8888-Processor5[1] dump categoryDefinition[0].value[1].value[2]
categoryDefinition[0].value[1].value[2] = {
name: "CUSTOM_To"
value: "PROJECT TEAM"
__equalsCalc: null
__hashCodeCalc: false
typeDesc: instance of org.apache.axis.description.TypeDesc(id=2564)
class$oracle$ifs$fdk$NamedValue: instance of java.lang.Class(reflected class=oracle.ifs.fdk.NamedValue, id=1975)
http-8888-Processor5[1] dump categoryDefinition[0].value[1].value[3]
categoryDefinition[0].value[1].value[3] = {
name: "CUSTOM_Subject"
value: "Riverside Energy Resource Center Meeting Minutes-Internal"
__equalsCalc: null
__hashCodeCalc: false
typeDesc: instance of org.apache.axis.description.TypeDesc(id=2564)
class$oracle$ifs$fdk$NamedValue: instance of java.lang.Class(reflected class=oracle.ifs.fdk.NamedValue, id=1975)
After building this CATEGORY_DEFINITION, I go on to attempt an update to the document with this information. Here is the method I call. I always fall into the catch(), and the error dump follows the code snippet. Unfortunately, the error doesn't tell me a lot about what's wrong. That's why I am asking for help in spotting any conspicuous errors in my CATEGORY_DEFINITION.
public Item addCategoryToDocument(Item documentItem,
NamedValue[] categoryDefinition)
throws WebserviceClientException {
FileManager fileManager = getWebserviceClient().getFileManager();
Item documentItemWithCategory = null;
try {
documentItemWithCategory = fileManager.updateDocument(documentItem.getId(), categoryDefinition, null);
} catch(Exception e) {
throw new WebserviceClientException("Could not update document with category definition.", e);
return documentItemWithCategory;
http-8888-Processor4[1] http-8888-Processor4[1] dump e
e = {
detailedErrorCode: "ORACLE.FDK.AggregateError"
errorCode: "ORACLE.FDK.AggregateError"
exceptionEntries: instance of oracle.ifs.fdk.FdkExceptionEntry[1] (id=2691)
info: null
serverStackTraceId: ""
__equalsCalc: null
__hashCodeCalc: false
typeDesc: instance of org.apache.axis.description.TypeDesc(id=2694)
class$oracle$ifs$fdk$FdkException: instance of java.lang.Class(reflected class=oracle.ifs.fdk.FdkException, id=1972)
org.apache.axis.AxisFault.log: instance of org.apache.commons.logging.impl.Log4JLogger(id=2695)
org.apache.axis.AxisFault.faultCode: instance of javax.xml.namespace.QName(id=2696)
org.apache.axis.AxisFault.faultSubCode: null
org.apache.axis.AxisFault.faultString: "ORACLE.FDK.AggregateError:ORACLE.FDK.AggregateError"
org.apache.axis.AxisFault.faultActor: null
org.apache.axis.AxisFault.faultDetails: instance of java.util.Vector(id=2698)
org.apache.axis.AxisFault.faultNode: null
org.apache.axis.AxisFault.faultHeaders: null
org.apache.axis.AxisFault.class$org$apache$axis$AxisFault: instance of java.lang.Class(reflected class=org.apache.axis.AxisFault, id=1928)
java.rmi.RemoteException.serialVersionUID: -5148567311918794206
java.rmi.RemoteException.detail: null
java.lang.Exception.serialVersionUID: -3387516993124229948
java.lang.Throwable.serialVersionUID: -3042686055658047285
java.lang.Throwable.detailMessage: null
java.lang.Throwable.cause: null
java.lang.Throwable.stackTrace: instance of java.lang.StackTraceElement[76] (id=2699)
http-8888-Processor4[1] dump e.exceptionEntries[0]
e.exceptionEntries[0] = {
detailedErrorCode: "ORACLE.FDK.MetadataSchemaInvalid"
errorCode: "ORACLE.FDK.MetaDataError"
id: 348018
info: null
serverStackTraceId: ""
__equalsCalc: null
__hashCodeCalc: false
typeDesc: instance of org.apache.axis.description.TypeDesc(id=2705)
class$oracle$ifs$fdk$FdkExceptionEntry: instance of java.lang.Class(reflected class=oracle.ifs.fdk.FdkExceptionEntry, id=1973)
}

1 – For an existing document, how do I determine what category instances have been applied to it and their attribute values
FdkSession session = …;
// Consider we have an existing item myDoc of type document
Item myDoc = …;
CommonManager cm = Managers.getCommonManager(session);
AttributeRequest[] requestedAttributes = new AttributeRequest[]
  // The Categories associated with this Document, if any
new AttributeRequest(Attributes.CATEGORIES,
  // sub attributerequest
  new AttributeRequest[] {
    // the actual attributes name/values for the category instance – returns a namedvalue array
    new AttributeRequest(Attributes.CUSTOM_ALL,null),
    // the actual category class for the category instance – returns an item
    new AttributeRequest(Attributes.CATEGORY_CLASS_OBJECT,null)
myDoc = cm.getItem(myDoc.getId(), requestedAttributes);
log(myDoc); /* output could look like:
(Item) 14385 DOCUMENT sample3.doc
requested attributes ...
CATEGORIES (Item[])=
(Item) 14387 CATEGORY
requested attributes ...
CUSTOM_ALL (NamedValue[])=
CUSTOM_14352=true (Boolean)
CUSTOM_14353=Internal Only Pending Review (String)
CATEGORY_CLASS_OBJECT (Item)=
(Item) 14354 CATEGORY_CLASS 5044-14351
This means, that for document sample3.doc, we have 1 instance of a category object applied to it.
The category object instance has id 14387. The instance is of a category class object type 14354. The instance has two attributes with internal names CUSTOM_14352, and CUSTOM_15353. The values of these attributes are of type Boolean and String respectively.
2 - How do I update an attribute value of an existing category instance applied to an item
FdkSession session = …;
// Consider we have an existing item myDoc of type document
Item myDoc = …;
.. perform code along the lines of that shown in step1 above to determine existing category instance info on the document ..
FileManager fm = Managers.getFileManager(session);
NamedValue[] categoryInstanceAttributes = new NamedValue[] {
  // use the internal attribute name for all attributes
  new NamedValue("CUSTOM_14352", Boolean.FALSE),
  new NamedValue("CUSTOM_14352", "Company Confidential")
NamedValue[] categoryDef = new NamedValue[] {
  // the category instance that we are updating
new NamedValue(Options.UPDATE_CATEGORY_ID,new Long(14387)),
// the updated values of the category instance
  new NamedValue(Options.CATEGORY_DEFINITION_ATTRIBUTES, categoryInstanceAttributes)
NamedValue[] documentDef = new NamedValue[] {
new NamedValue(Options.CATEGORY_DEFINITION, categoryDef)
requestedAttributes = ...
myDoc = fm.updateDocument(myDoc.getId(),documentDef,requestedAttributes) ;
3 – For a document item X, what is the associated category configuration which could include
a) what are the category objects I can apply on it (either explicitly restricted by way of ALLOWED_CATEGORIES on the folder configuration, or any site/domain category by way of ALLOW_ALL_CATEGORIES)
b) is there any attribute overrides
c) is there any enforced categories
FdkSession session = …;
// Consider we have an existing item myDoc of type document
Item myDoc = …;
CommonManager cm = Managers.getCommonManager(session);
AttributeRequest[] categoryObjectAttributes = new AttributeRequest[]
// What is the category object class name
new AttributeRequest(Attributes.CLASS_NAME,null),
  // What is the category classobject display name
new AttributeRequest(Attributes.DISPLAY_NAME,null),
// get attributes inherited and introduced by category object
new AttributeRequest(Attributes.METADATA_ATTRIBUTES,
  new AttributeRequest[]
    // Attribute internal name
    new AttributeRequest(Attributes.ATTRIBUTE_NAME,null),
    // Attribute display name
    new AttributeRequest(Attributes.DISPLAY_NAME,null),
    new AttributeRequest(Attributes.ATTRIBUTE_TYPE,null),
    new AttributeRequest(Attributes.ATTRIBUTE_DEFAULT,null),
    new AttributeRequest(Attributes.ATTRIBUTE_ENUMERATION,null),
    new AttributeRequest(Attributes.ATTRIBUTE_REQUIRED,null),
    new AttributeRequest(Attributes.ATTRIBUTE_SETTABLE,null),
    new AttributeRequest(Attributes.ATTRIBUTE_UPDATEABLE,null),
    new AttributeRequest(Attributes.ATTRIBUTE_HIDDEN,null),
    new AttributeRequest(Attributes.ATTRIBUTE_PROMPTED,null),
    new AttributeRequest(Attributes.ATTRIBUTE_OVERRIDEABLE,null),
AttributeRequest[] overrideAttributes = new AttributeRequest[]
// id of the attribute to be overridden
new AttributeRequest(Attributes.ATTRIBUTE_OVERRIDE_ATTRIBUTE,null),
// id of the category class object to which this attribute override applies
new AttributeRequest(Attributes.ATTRIBUTE_OVERRIDE_CATEGORY_CLASS,null),
// new default value
new AttributeRequest(Attributes.ATTRIBUTE_OVERRIDE_DEFAULT,null),
// should attribute now be prompted
new AttributeRequest(Attributes.ATTRIBUTE_OVERRIDE_PROMPT,null),
// is the attribute now required
new AttributeRequest(Attributes.ATTRIBUTE_OVERRIDE_REQUIRED,null),
// can instances of this attribute have there value updated
new AttributeRequest(Attributes.ATTRIBUTE_OVERRIDE_SETTABLE,null),
AttributeRequest[] requestedAttributes = new AttributeRequest[]
// what is the category configuration for the item
new AttributeRequest(Attributes.CATEGORY_CONFIGURATION,
  new AttributeRequest[]
    // Is the category configuration enabled
     new AttributeRequest(Attributes.CONFIGURATION_ENABLED,null),
     // Can the category configuration be overridden or is it final
    new AttributeRequest(Attributes.CONFIGURATION_FINAL,null),
    // What are the required categories for the category configuration and associated attribute information
    new AttributeRequest(Attributes.REQUIRED_CATEGORIES,categoryObjectAttributes),
    // Can any categories in the site be utilized
    new AttributeRequest(Attributes.ALLOW_ALL_CATEGORIES,null),
    // or .. are we restricting the categories to only the following
    new AttributeRequest(Attributes.ALLOWED_CATEGORIES,categoryObjectAttributes),
    // are there any attribute overrides on category object attributes for this category config?
    new AttributeRequest(Attributes.ATTRIBUTE_OVERRIDES,overrideAttributes)
log(cm.getItem(myDoc.getId(), requestedAttributes); /*
If ALLOW_ALL_CATEGORIES is set to true, any category in the domain can be utilized that is not abstract. To determine these, the domain item has a property CATEGORY_CLASSES that returns all category objects in the domain. It also has a property ROOT_CATEGORY_CLASSES which returns just the top level categories (those that have no custom category superclass). You would create a sub AttributeRequest[] checking for CLASS_ABSTRACT when requesting the appropriate categories attribute from the domain.
If ALLOW_ALL_CATEGORIES is set to false, the applicable categories objects that can be utilized on items contained in the folder is determined by the items contained in the ALLOWED_CATEGORIES attribute of the category configuration.
Finally, the REQUIRED_CATEGORIES attribute list the category items that must be applied to all new items added to the folder.
4 – How do I manually apply an instance of a category to an existing item
FdkSession session = …;
// Consider we have an existing item myDoc of type document
Item myDoc = …;
.. use techniques in step3 above to determine what category objects that you planning to apply to the document ..
.. if the category configuration on the item has ALLOW_ALL_CATEGORIES set to true, you can use any category in the system
.. otherwise, you must use a category defined in the allowed categories list
.. the code here is essentially the same as step2 above
.. you must utilize internal attribute names, and specify the id of the category class object
FileManager fm = Managers.getFileManager(session);
NamedValue[] categoryInstanceAttributes = new NamedValue[] {
  // use the internal attribute name for all attributes
  new NamedValue("CUSTOM_14352", Boolean.FALSE),
  new NamedValue("CUSTOM_14352", "Company Confidential")
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(14354)),
// the updated values of the category instance
  new NamedValue(Options.CATEGORY_DEFINITION_ATTRIBUTES, categoryInstanceAttributes)
NamedValue[] documentDef = new NamedValue[] {
new NamedValue(Options.CATEGORY_DEFINITION, categoryDef)
requestedAttributes = ...
myDoc = fm.updateDocument(myDoc.getId(),documentDef,requestedAttributes);
// Note – it is possible for one to peform creation, updating, and deletion of various category instances for an existing item in the fileManager updateDocument call!
// you simply supply multiple Options.CATEGORY_DEFINITIONs to the fm.updateDocument call along with any Options.REMOVE_CATEGORY_IDs 5 – How do I specify a category instance when creating a new item
FdkSession session = …;
.. use techniques in step3 above to determine what category objects that you planning to apply to the new document ..
.. you get the category configuration information from the destination folder!!!
Item destinationFolder = …;
CommonManager cm = Managers.getCommonManager(session);
AttributeRequest[] requestedAttributes = new AttributeRequest[]
// what is the category configuration for the item
new AttributeRequest(Attributes.CATEGORY_CONFIGURATION,
destinationFolder = cm.getItem(destinationFolder.getId(),requestedAttributes);.. if the category configuration on the folder item has ALLOW_ALL_CATEGORIES set to true, you can use any category in the system
.. otherwise, you must use a category defined in the allowed categories list
.. the code here is essentially the same as step2 above, just we are using createDocument and document definitions now
.. you must utilize internal attribute names, and specify the id of the category class object
FileManager fm = Managers.getFileManager(session);
NamedValue[] categoryInstanceAttributes = new NamedValue[] {
  // use the internal attribute name for all attributes
  new NamedValue("CUSTOM_14352", Boolean.FALSE),
  new NamedValue("CUSTOM_14352", "Company Confidential")
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(14354)),
// the attribute values for this new category instance
  new NamedValue(Options.CATEGORY_DEFINITION_ATTRIBUTES, categoryInstanceAttributes)
String destinationFile = "sample.doc";
requestedAttributes = new AttributeRequest[]
  new AttributeRequest(Attributes.URL,null)
Item docDef = fm.createDocumentDefinition(new NamedValue[]
  new NamedValue(Attributes.NAME, destinationFile),
},requestedAttributes);
String defURL = ...  // get URL from document definition
doFileUpload(...)  // upload file using http put to defURL
NamedValue[] documentDef = new NamedValue[] {
  new NamedValue(Options.USE_SAVED_DEFINITION,new Long(docDef.getId())),
new NamedValue(Options.DESTFOLDER, new Long(destinationFolder.getId())),
// specify character set if appropriate
  new NamedValue(Attributes.DOCUMENT_CHARACTER_SET,"ISO-8859-1"),
  // specify language if appropriate
new NamedValue(Attributes.DOCUMENT_LANGUAGE,"ENGLISH"),
// apply category instance information
new NamedValue(Options.CATEGORY_DEFINITION, categoryDef),
requestedAttributes = ...
Item doc = fm.createDocument(documentDef,null, requestedAttributes);
// Note – it is possible for one to peform creation of multiple category instances on a document at the same time
// you simply supply multiple Options.CATEGORY_DEFINITIONs to the fm.createDocument call
// Note – that if a folder has a category configuration containing required categories, and you do not specify
// all applicable category definitions on createDocument, you will receive an FdkException along the lines of
// missing metadata. You can catch this exception, and retry the createDocument call supplying the valid category definition(s).

Similar Messages

  • Using Content Query webpart for specific Document library with multiple managed metadata - Document with multiple metadata tags not showing up

    Hi,
    I am having an issue where when I insert a Content Query webpart into a page, and filter to managed metadata, all the right documents show up except one document that happens to have two metadata tags attached to it.  The content query webpart is set
    to only look through a specific document library.  I'm not sure what I am doing wrong.
    Here is the one document with two metadata tags:
    Below is the Content Query:

    Hi,
    As I understand, you did not get the results with multiple metadata tags through Content Query web part in SharePoint 2013.
    Check things below:
    1. Check if you have set the item limit more than the display items in Presentation section of the web part. If the item number more than item limit, the rest items will not show.
    2. Check if the item you cannot find uses the content type you have set in the content type section of content query web part.
    When you edit the properties of the item, you will see the content type the item is using.
    Best regards
    Sara Fan
    TechNet Community Support

  • Any way to update PO document through DTW without using "Doc Entry"

    Dear all,
    Just have a question.
    I need to use DTW to update existing PO document. I realized that I have to have Doc Entry to be entered in the DTW template.
    Is there any way to update PO document through DTW without using that field, "Doc Entry"?
    thanks
    Tony

    Tony,
    A similar situation related to Bank files was resolved with one of my clients on the following way...
    The file from the Vendor can be an any order or format on the Excel.  Till the time it is consistant it should work fine..
    We created a Job in SQL Server to read this Excel file and to use the DocNum to get the DocEntry from SAP PO and output another excel file which is exactly the template format for PO Update.
    This may even not be required in your case.....
    You can get this done through an Excel Macro....which will connect to the database and using the DocNum get the DocEntry and update the Excel....
    This is 100% achievable and a better solution for regular use
    Suda

  • So i made a direct download of iOS 5, then when i try to update my update my iPod with it, it gives me error 3002

    so i made a direct download of iOS 5, then when i try to update my update my iPod with it, it gives me error 3002

    Error 3002: If you experience this error while updating an iPod touch (2nd generation) or iPhone 3G, please use the standard update or restore process in iTunes (click Update or Restore).
    From:
    http://support.apple.com/kb/TS3694#error3002
    I also suspect you have a 2G iPod. Those can only go to iOS 4.2.1
    Identifying iPod models
    iPod touch (3rd generation)
    iPod touch (3rd generation) features a 3.5-inch (diagonal) widescreen multi-touch display and 32 GB or 64 GB flash drive. You can browse the web with Safari and watch YouTube videos with Wi-Fi. You can also search, preview, and buy songs from the iTunes Wi-Fi Music Store on iPod touch.
    The iPod touch (3rd generation) can be distinguished from iPod touch (2nd generation) by looking at the back of the device. In the text below the engraving, look for the model number. iPod touch (2nd generation) is model A1288, and iPod touch (3rd generation) is model A1318.

  • Update list item with managed metadata field returns The security validation for this page is invalid

    Using SharePoint 2010 Server
    I'm attempting to programtically update a managed metadata field in a document library. I'm able to do it without issue on all other non-managed metadata fields. When I attempt it on a MM field I get the error message
    "The security validation for this page is invalid. Click Back in your Web browser, refresh the page, and try your operation again."
    After some digging I realised that this error was being caused because SharePoint was trying to write to the TaxonomyHiddenList list (../sites/mysite/Lists/TaxonomyHiddenList/AllItems.aspx)
    When I update a document through the browser with a term (Term01), it shows up in this TaxonomyHiddenList . I can then run my application, apply Term01 to my new document and it works fine. But if I apply Term02 to my new document it gives me the error above.
    Summary
    My app can read the TaxonomyHiddenList fine but it can not perform an operation that would write to it, resulting in not being able to update the MM field.
    Question
    Is there any advice on how I can further debug this issue?

    Hi,
    According to your post, my understanding is that you want to update managed metadata field in document library programmatically.
    I have made a simple code demo below to updata managed metadata field in document library, it works like a charm, you can refer to it.
    public static void UpdateMSField()
    using (SPSite site = new SPSite("http://YourSiteURL"))
    using (SPWeb web = site.OpenWeb())
    //SPList list = web.Lists.TryGetList("Libs_1");
    SPDocumentLibrary lib = (SPDocumentLibrary)web.Lists["Libs_1"];
    // No point in proceeding if we can't find the list
    if (lib != null)
    // add a new item
    // SPListItem item = list.AddItem();
    SPListItem item = lib.GetItemById(1);
    //Console.WriteLine(item.Name);
    // get the current taxonomy session, which wraps up all of the
    // associated TermStore objects for this SPSite object
    TaxonomySession metadataService = new TaxonomySession(site);
    // get the taxonomy field
    TaxonomyField taxField = item.Fields["MMS_1"] as TaxonomyField;
    // get the term store associated with the taxonomy field
    TermStore termStore = metadataService.TermStores[taxField.SspId];
    // get the actual term set associated with the taxonomy field
    TermSet termSet = termStore.GetTermSet(taxField.TermSetId);
    // search for the terms we wish to set the field to
    var terms = termSet.GetTerms("term_1", true, StringMatchOption.ExactMatch, 1, false);
    // if we have found a term populate the field
    if (terms.Count > 0)
    // set the field to the term(s) we have found
    taxField.SetFieldValue(item, terms.First());
    // Update the item
    item.Update();
    Console.WriteLine("success...");
    More reference:
    http://www.3guysonsharepoint.com/?p=1052
    http://vineet-winit.blogspot.com/2013/04/how-to-update-managed-metadata-field-in.html
    Thanks & Regards,
    Jason
    Jason Guo
    TechNet Community Support

  • How to update many documents in one go using portal permissions

    Hello,
    I have two users in the portal with different permissions on a folder:
    rct2774: Total control
    rct3343: Read
    So, connected to the portal, rct3343 can´t upload (or erase) any document.
    Now, I´ve followed these instructions to update many documents in one go (found in "how to upload a folder containg HTML files in a KM folder" topic 22 - jun - 2006)
    "You can use the WebDaV.
    1. Get the WebDav path of your KM folder by going to details->properties->Access Links
    2. Copy the url for the WebDav
    3. Go to your desktop. Right Click on My Network Places.
    click on open.
    4. Click on add a network place.
    5. Click on "Choose another network location"
    6. Paste your copied url and click on next.
    7. Enter your portal userid and password. Now drag and drop your files from desktop. "
    But, updating this way both users (rct2774 and rct3343) can update, download and erase any document that belongs to that location.
    Do you know a way to update many documents in one go respecting or keeping the portal permissions?
    Thanks in advance.
    Best Regards,
    Esteban

    Hi Marc,
    First of all, thaks for your prompt reply. I´m new in these themes and any help is wellcome.
    We are doing many tests now, so we´re using the server portal as repository in itself. It´s quite strange because the permissions work at the portal correctly but not by the other way.
    Should I download the portal drive to the client PC for mantain the portal permissions?
    Thank you!

  • How to create a  PDF document with page curls using Adobe  CS 4?

    My  goal is to create a  PDF document with page curls. I am using Adobe  CS 4.
    1.      The document was created in Adobe InDesign  CS 4  where the page  turn (curl) transition  was applied.
    2.      Then the document was exported to .swf.
    3.     The .swf file was imported into   Adobe Acrobat Pro  to create a PDF file with  flip page or page curl transitions.
    These are the problems.
    1.      The background is not  transparent.
    2.      Page dimensions have to be increased at least an inch in width and length so that the full page can show
    3.      The command and+   will not only increases the document's  screen size. It increases the page margins.

    PDF was never designed to support the Flash page curl effect (it didn't exist back then). Anything you try (and you've tried the standard hack) will look like a hack. Personally, I don't think the effort is worth it for an effect that's much overused.

  • Recordset - updating 2 tables with 1 recordset using application object update record

    I have a recordset that uses a field from 2 different tables
    with a select statement where clause that joins a userid. I can
    display the field’s data just fine. Now I want to use the
    Application object “update record” so I can modify
    either of the fields. The problem is the Application object
    “update record” only allows you to update one table.
    How does Dreamweaver mx 2004 allow me to update 2 tables with one
    recordset and 1 submit button? Currently using php.
    Example of where:
    Where member.userid = member_detail.userid
    I tried creating the one form with the field from the first
    table and that works just fine. I added the other field from the
    other table into the form but ofcourse there isn’t any code
    that will update the second table so it won’t work.
    My application requires me to update alot of fields between 2
    tables at the same time.
    Does anyone know a way using Dreamweaver mx 2004 to do this?
    I don’t have much php experience.

    jon-rookie wrote:
    > DreamerJim,
    >
    > I am sorry but I don't think you are correct. I just
    can't believe that with
    > all the powers to be at Macromedia and now Adobe can't
    figure out how to update
    > two tables at once. There are millions of db's out there
    that require this. I
    > spent several hours today perusing lots of posts on the
    internet. It seems I
    > am not the only one out there that has asked this
    question. Unfortunately
    > there are no good answers yet to my surprise.
    >
    > I did find a Dreamweaver extension that does exactly
    what I myself and many
    > others want. The problem is it is no longer available
    unless you purchase a
    > bundle of software from Adobe.
    >
    > I have not looked into it in detail so I am not 100%
    sure that is accurate!
    >
    > Still, alot of php programmers do this all the time
    without much trouble. I
    > just want to know if Dreamweaver mx 2004 has the
    capability if a person knows
    > the right steps.
    >
    > Hopefully a Dreamweaver expert will post something to
    let us know for sure.
    > Until then I am stuck.
    >
    Not even CS3 has this built in, you will either have to code
    it yourself
    or buy the extension you have found. Dreamweaver gives you
    basic
    features to help you develop applications, but if you want to
    do
    anything really clever you have to do it yourself.
    One thing to consider is maybe creating an SQL view that is
    can be
    updated. I am pretty sure it exists, then you use the view
    instead of
    the table in the update behaviour. I have never done it
    myself, but I am
    sure it can be done.
    Steve

  • Function Module to Update Shipment Document with FURTHER DATES

    Hi All,
    i need to update (create an event entry) with the 'Begin Plan Date' and 'End Plan Date' of one Event in the 'FURTHER DATES' TAB
    (2nd Tab) of the Shipment Document. I got to do this using the separate program after the shipment gets created from external system in ECC.
    Any ideas on how to do it? the function modules belong to the function group
    TSEG.. but am not sure which function module can cater my requirement..  or can we do it with a BDC call.
    Appreciate ur early reply...
    Regards,
    Leona

    hi,
    YOu can use fm 'HR_99S_date_plus_time_unit'.
    hope it helps
    regards,
    pawan

  • Create a followup document with selected items using actions

    Hi Experts,
    We are working on CRM 5.0 with ECC 6.0 as backend.
    As per the clients business process we have to create a service order automatically from a sales order whenever there is a serviceline item with item category ZSRV presents in the sales order. The service order which is created should only contain service line item with item category ZSRV. Which means the action should copy only the selected line items to the service order.
    Now the problem is using the standard method COPY_DOCUMENT, I dont have any option for selecting the line items. I have found a method COPY_DEF_ITEMS which may be the most relavant for my scenario. But I am not able to give the processing parameters for this.
    Can any body help me about how to use the standard method    COPY_DEF_ITEMS.
    Points shall be rewarded for the helpful answer.
    Regards,
    Madhu

    PDF was never designed to support the Flash page curl effect (it didn't exist back then). Anything you try (and you've tried the standard hack) will look like a hack. Personally, I don't think the effort is worth it for an effect that's much overused.

  • [SOLVED] Updating a package with renamed dependency using yaourt

    I am trying to update  aur/python2-epd-oss using yaourt. The problem is that the installed version depends on biopython and the new one depends on python2-biopython. When yaourt tries to replace  biopython with python2-biopython I get this:
    :: python2-biopython and biopython are in conflict. Remove biopython? [y/N] y
    error: failed to prepare transaction (could not satisfy dependencies)
    :: python2-epd-oss: requires biopython>=1.57
    and I never reach te point where aur/python2-epd-oss gets updated.
    How should I update  aur/python2-epd-oss? Is this a case to force the update?
    Last edited by asafparis (2012-12-24 16:59:10)

    pacman -R python2-epd-oss
    yaourt -Syua # and answer yes
    yaourt -S python2-epd-oss
    This isn't really yaourt specific, you'd need to do something like this whenever AUR dependencies change names.
    Yaourt advertises that it manages dependencies ... but it doesn't really.
    Last edited by Trilby (2012-12-24 16:11:09)

  • Populate word document with default metadata information

    Problem is revers as it is available in internet.  I have created list and
     columns. Which are populated  with default value. I have created word
     template. I can enter  data related to “Document properties”, ect. When I save that document to document library, I can see that filed data, that I type it in newly created word document.
    But because I have several project document library and sites, I would like to create library, 
    and fill all data with required values.  Then when I open new document from pre defied 
    template, I would like to have all fields  that are empty in document, to be filed 
    from  default columns value. Problem is, that when I save document, All fields are empty.
    There is no problem, upending document, and default properties are presented.
    How can I merge  default values from library, to word document ?

    I have word template, that I added-it as a site content type. It has all standard 
    fields  that are mapped to document library filed. If I open 
    new document in  document library, and input 
    required filed,  after  saving document, I can 
    see those fields in SharePoint document library (Item properties).
    Problem that I have is, following :
    When I open that  document “new document” from template, I would like to have all fields filed with default values of that particular library.
    Reason : Because  I will generate  hundred project (
    Each new library is based on new project, build fields are the same, values changes to mimic project)
    ),  I do not wont to create additional template, that would have required fields fill up wit project value, and add it to content type.. .
    I do not won`t to fill those properties manually.
    Option 1 :  After saving document based on template, it will fill out  
    required fields.
    Option 2: Create template, for each project, and save that template as project template, that users open, and save it to project Site/library.
    Option 1, is preferred.  Can that be done, when item is created, and copy project 
    information, from different location ?
    So I have  document library fields :
    Name of the project,  Projec Manager,  Project ref number, Contract, ...
    These filed are mapped to document filed :
    Name of the project,  Projec Manager,  Project ref number, Contract, ...
    I have document library : Project A
    Project A  ,  John dear, 
    REF2014_01_01, C1243332_2014, ...
    I have document library : Project B
    Project B ,  Same Jones ,  REF2014_03_05, AS563332_2014, ...
    I would like,  that when I save  document
     using New document (template),  that have those filed fill up. I do not wont to 
    create  new template for every project.

  • Devtools update causes problems with sudo when used in a script?

    I'm a little confused by this one, but I'm not convinced that it's a bug.. yet.
    Long story short, I compile packages using the ABS via a script/wrapper which uses devtools. The script is available here: https://github.com/WorMzy/compilepackage
    Now, this script is far from perfect, but has worked perfectly well (in various states of completeness) for the past year or so. However, with the recent update of devtools (20120720-1 => 20121013-1), my script fails to execute correctly. After entering the password when prompted (by sudo, at this line: https://github.com/WorMzy/compilepackag … tions#L107), the script terminates unexpectedly.
    Downgrading devtools "fixes" this problem, but I'm not sure if this is a bug in devtools, sudo, zsh, my script, or something else.
    Here is the full output from the compilation of "arch-install-scripts":
    build@sakura[pts/10]:~/builds/devtools$ . ~/.scripts/compilepackage arch-install-scripts
    ==> Downloading sources
    ==> arch-install-scripts directory already exist. Replace ? [Y/n]
    ==> Download arch-install-scripts sources
    receiving file list ... done
    sent 28 bytes received 70 bytes 39.20 bytes/sec
    total size is 656 speedup is 6.69
    :: Synchronizing package databases...
    core is up to date
    extra is up to date
    community is up to date
    :: Starting full system upgrade...
    there is nothing to do
    ==> Building in chroot for [extra] (x86_64)...
    ==> Creating clean working copy...done
    ==> Making package: arch-install-scripts 8-1 (Fri Oct 19 23:45:52 BST 2012)
    ==> Checking runtime dependencies...
    ==> Checking buildtime dependencies...
    ==> Retrieving Sources...
    -> Found arch-install-scripts-8.tar.gz
    -> Found arch-install-scripts-8.tar.gz.sig
    ==> Validating source files with md5sums...
    arch-install-scripts-8.tar.gz ... Passed
    arch-install-scripts-8.tar.gz.sig ... Passed
    ==> Verifying source file signatures with gpg...
    arch-install-scripts-8.tar.gz ... FAILED (unknown public key 1EB2638FF56C0C53)
    ==> WARNING: Warnings have occurred while verifying the signatures.
    Please make sure you really trust them.
    ==> Extracting Sources...
    -> Extracting arch-install-scripts-8.tar.gz with bsdtar
    ==> Starting build()...
    make: Entering directory `/build/src/arch-install-scripts-8'
    GEN arch-chroot
    GEN genfstab
    GEN pacstrap
    make: Leaving directory `/build/src/arch-install-scripts-8'
    ==> Entering fakeroot environment...
    ==> Starting package()...
    make: Entering directory `/build/src/arch-install-scripts-8'
    install -dm755 /build/pkg/usr/bin
    install -m755 arch-chroot genfstab pacstrap /build/pkg/usr/bin
    install -Dm644 zsh-completion /build/pkg/usr/share/zsh/site-functions/_archinstallscripts
    make: Leaving directory `/build/src/arch-install-scripts-8'
    ==> Tidying install...
    -> Purging unwanted files...
    -> Compressing man and info pages...
    -> Stripping unneeded symbols from binaries and libraries...
    ==> Creating package...
    -> Generating .PKGINFO file...
    -> Compressing package...
    ==> Leaving fakeroot environment.
    ==> Finished making: arch-install-scripts 8-1 (Fri Oct 19 23:45:54 BST 2012)
    ==> Installing package arch-install-scripts with pacman -U...
    loading packages...
    resolving dependencies...
    looking for inter-conflicts...
    Targets (1): arch-install-scripts-8-1
    Total Installed Size: 0.03 MiB
    Proceed with installation? [Y/n]
    (1/1) checking package integrity [######################################################################] 100%
    (1/1) loading package files [######################################################################] 100%
    (1/1) checking for file conflicts [######################################################################] 100%
    (1/1) installing arch-install-scripts [######################################################################] 100%
    resolving dependencies...
    looking for inter-conflicts...
    Targets (5): elfutils-0.155-1 pyalpm-0.5.3-2 python-3.3.0-1 python-pyelftools-0.20-2 namcap-3.2.4-2
    Total Installed Size: 99.58 MiB
    Proceed with installation? [Y/n]
    (5/5) checking package integrity [######################################################################] 100%
    (5/5) loading package files [######################################################################] 100%
    (5/5) checking for file conflicts [######################################################################] 100%
    (1/5) installing python [######################################################################] 100%
    Optional dependencies for python
    tk: for tkinter
    sqlite
    (2/5) installing pyalpm [######################################################################] 100%
    (3/5) installing elfutils [######################################################################] 100%
    (4/5) installing python-pyelftools [######################################################################] 100%
    (5/5) installing namcap [######################################################################] 100%
    Checking PKGBUILD
    Checking arch-install-scripts-8-1-any.pkg.tar.xz
    arch-install-scripts W: Dependency bash included but already satisfied
    arch-install-scripts W: Dependency included and not needed ('coreutils')
    arch-install-scripts W: Dependency included and not needed ('pacman')
    arch-install-scripts W: Dependency included and not needed ('util-linux')
    ==> Compilation complete, installing...
    Password:
    loading packages...
    warning: arch-install-scripts-8-1 is up to date -- reinstalling
    resolving dependencies...
    looking for inter-conflicts...
    Targets (1): arch-install-scripts-8-1
    Total Installed Size: 0.03 MiB
    Net Upgrade Size: 0.00 MiB
    Proceed with installation? [Y/n] % build@sakura[pts/10]:~/builds/arch-install-scripts$
    That "%" is inverted, just like what you get when you run
    echo -n "text"
    in zsh. Incidentally, here is my .zshrc: https://github.com/WorMzy/Config-files/ … ter/.zshrc, however, the problem persists with a new user with an unconfigured zsh.
    Here is my sudoers too:
    ## sudoers file.
    ## This file MUST be edited with the 'visudo' command as root.
    ## Failure to use 'visudo' may result in syntax or file permission errors
    ## that prevent sudo from running.
    ## See the sudoers man page for the details on how to write a sudoers file.
    ## Host alias specification
    ## Groups of machines. These may include host names (optionally with wildcards),
    ## IP addresses, network numbers or netgroups.
    # Host_Alias WEBSERVERS = www1, www2, www3
    ## User alias specification
    ## Groups of users. These may consist of user names, uids, Unix groups,
    ## or netgroups.
    # User_Alias ADMINS = millert, dowdy, mikef
    ## Cmnd alias specification
    ## Groups of commands. Often used to group related commands together.
    # Cmnd_Alias PROCESSES = /usr/bin/nice, /bin/kill, /usr/bin/renice, \
    # /usr/bin/pkill, /usr/bin/top
    ## Defaults specification
    ## You may wish to keep some of the following environment variables
    ## when running commands via sudo.
    ## Locale settings
    # Defaults env_keep += "LANG LANGUAGE LINGUAS LC_* _XKB_CHARSET"
    ## Run X applications through sudo; HOME is used to find the
    ## .Xauthority file. Note that other programs use HOME to find
    ## configuration files and this may lead to privilege escalation!
    # Defaults env_keep += "HOME"
    ## X11 resource path settings
    # Defaults env_keep += "XAPPLRESDIR XFILESEARCHPATH XUSERFILESEARCHPATH"
    ## Desktop path settings
    # Defaults env_keep += "QTDIR KDEDIR"
    ## Allow sudo-run commands to inherit the callers' ConsoleKit session
    # Defaults env_keep += "XDG_SESSION_COOKIE"
    ## Uncomment to enable special input methods. Care should be taken as
    ## this may allow users to subvert the command being run via sudo.
    # Defaults env_keep += "XMODIFIERS GTK_IM_MODULE QT_IM_MODULE QT_IM_SWITCHER"
    ## Uncomment to enable logging of a command's output, except for
    ## sudoreplay and reboot. Use sudoreplay to play back logged sessions.
    # Defaults log_output
    # Defaults!/usr/bin/sudoreplay !log_output
    # Defaults!/usr/local/bin/sudoreplay !log_output
    # Defaults!/sbin/reboot !log_output
    Defaults timestamp_timeout=0,passwd_timeout=0,passprompt="Password:",badpass_message="Incorrect password",editor=/usr/bin/vim:/usr/bin/vi,targetpw
    ## Runas alias specification
    ## User privilege specification
    root ALL=(ALL) ALL
    build sakura=/usr/bin/pacman-color -U *,/usr/bin/pacman-color -Sy,/usr/bin/pacman-color -Syy
    build sakura=/usr/bin/pacman -U *
    build sakura=NOPASSWD: /usr/bin/extra-x86_64-build,/usr/bin/multilib-build,/usr/sbin/makechrootpkg
    ## Uncomment to allow members of group wheel to execute any command
    %wheel sakura=(ALL) ALL
    ## Same thing without a password
    #%wheel ALL=(ALL) NOPASSWD: /sbin/sdshutdown, /sbin/sdreboot
    ## Uncomment to allow members of group sudo to execute any command
    # %sudo ALL=(ALL) ALL
    ## Uncomment to allow any user to run sudo if they know the password
    ## of the user they are running the command as (root by default).
    # Defaults targetpw # Ask for the password of the target user
    # ALL ALL=(ALL) ALL # WARNING: only use this together with 'Defaults targetpw'
    ## Read drop-in files from /etc/sudoers.d
    ## (the '#' here does not indicate a comment)
    #includedir /etc/sudoers.d
    Further information will be provided on request. Suggestions for improving the script will also be appreciated.
    Thanks.

    Update: It appears that the cause is systemd's nspawn. Disabling it in mkarchroot (have_nspawn=0) resolves the problem.
    However, I don't understand why it's causing this behaviour. User input works fine for the sudo password prompt, but then fails for the pacman user prompt? Do they use different input buffers or something? Does that question even make sense?
    Anyway, I'll open a bug report on flyspray and upstream about this when I get the chance.

  • Updating Sales document with new sub sequent sales document

    Hello All,
    I am creating one sales contract from one sales document through some user exits and batch jobs.
    After creating this new sales contract i want to update this doc number in Old Referenced sales document flow.
    Is there any standard function module for this.. i tried some function modules containing FLOW..But no use..
    Thanks&Regards,
    Krishna.

    It is resolved..
    as I am using FM SD_SALESDOCUMENT_CREATE to create this contract i just updated the Reference document number in header structure...

  • Updating a JPanel with new data, using CardLayout

    Hi,
    I'm using a CardLayout to change between JPanels.
    I have 2 JPanels: panel1, panel2; 2 JButtons: backButton, nextButton;
    I also have 1 JTable - table1 - which get it's info from a database.
    I add nextButton and table1 to panel1, and add backButton to panel2.
    I add panel1 and panel2 to the CardLayout, and of course I add the Cardlayout to the JFrame and so on.
    When I start the application I get the panel1 with a table filled up from the DB. I then press the nextButton and get the panel2 visible.
    Problem:
    My problem now is how to do when I press the backButton so that the application checks the DB and updates the table1.
    I make a ActionListener to the backButton, which makes the panel1 visible again, but it does not update the table1 from the DB.
    How do I do that??
    Thx. for all answers!!
    /bogger

    of course it will be the same - you must call the database again.
    if you just copy and paste the code, that fills your database with data where you make the panel visible again, it'll work
    (of course it will be better to create a method to update the table, not just paste the code)

Maybe you are looking for

  • Update with EAP SIM

    Free Mobile, provider in France, uses now Eap-sim on his network Free Wifi! The request of this compatibility will be now important from french customers! I see that Xperia S has this Eap-sim while it is absent in Android 4! So it is Sony who has add

  • Problem in concurrent access of a single method

    Hi, I have one servlet named "Controllerservlet.java" and a jsp page "Inward jsp". Now from this jsp user enters data which are being passed to controller servlet 's "insertData" method which is a synchronized method then it stores the query result i

  • Config problem when transport

    Hi Experts, I created a Z output type in NACE in Dev system 200 client. and with this i create a process code to for my inbound IDOC partner profile. Along with this we created IDOC segments and other stuff. Now after transport I am not getting these

  • Lost a view

    I have my Mail setup so that all received emails are visible at the top of the screen and whatever email is highlighted is visable below the received emails. I know that this is an easy fix, but I cannot find it. Someone got on my computer and change

  • Design view breaks layout

    I have a simple 3 column layout inside a wrapper div where my source order is #content/#sidebar1/#sidebar2, and I am using a negative margin on #sidebar1 to pull it over so the display order is #sidebar1/#content/#sidebar2. It works great in the brow